Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a0207c88
Commit
a0207c88
authored
Apr 09, 2011
by
Christian Inci
Committed by
Alexandre Julliard
Apr 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Fix a string test.
parent
7d5099e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
str.c
dlls/crypt32/str.c
+4
-1
str.c
dlls/crypt32/tests/str.c
+29
-1
No files found.
dlls/crypt32/str.c
View file @
a0207c88
...
...
@@ -1074,7 +1074,8 @@ BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
static
const
WCHAR
commaSep
[]
=
{
','
,
0
};
static
const
WCHAR
semiSep
[]
=
{
';'
,
0
};
static
const
WCHAR
crlfSep
[]
=
{
'\r'
,
'\n'
,
0
};
static
const
WCHAR
allSeps
[]
=
{
','
,
';'
,
'\r'
,
'\n'
,
0
};
static
const
WCHAR
allSepsWithoutPlus
[]
=
{
','
,
';'
,
'\r'
,
'\n'
,
0
};
static
const
WCHAR
allSeps
[]
=
{
'+'
,
','
,
';'
,
'\r'
,
'\n'
,
0
};
LPCWSTR
sep
;
str
++
;
...
...
@@ -1084,6 +1085,8 @@ BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
sep
=
semiSep
;
else
if
(
dwStrType
&
CERT_NAME_STR_CRLF_FLAG
)
sep
=
crlfSep
;
else
if
(
dwStrType
&
CERT_NAME_STR_NO_PLUS_FLAG
)
sep
=
allSepsWithoutPlus
;
else
sep
=
allSeps
;
ret
=
CRYPT_GetNextValueW
(
str
,
dwStrType
,
sep
,
&
token
,
...
...
dlls/crypt32/tests/str.c
View file @
a0207c88
...
...
@@ -800,8 +800,36 @@ static void test_CertStrToNameA(void)
"Expected CRYPT_E_INVALID_X500_STRING, got %08x
\n
"
,
GetLastError
());
ret
=
pCertStrToNameA
(
X509_ASN_ENCODING
,
"CN=1+2"
,
0
,
NULL
,
buf
,
&
size
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_INVALID_X500_STRING
,
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_INVALID_X500_STRING
,
"Expected CRYPT_E_INVALID_X500_STRING, got %08x
\n
"
,
GetLastError
());
ret
=
pCertStrToNameA
(
X509_ASN_ENCODING
,
"CN=1+2"
,
CERT_NAME_STR_NO_PLUS_FLAG
,
NULL
,
buf
,
&
size
,
NULL
);
ok
(
ret
&&
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %08x
\n
"
,
GetLastError
());
ret
=
pCertStrToNameA
(
X509_ASN_ENCODING
,
"CN=1,2"
,
CERT_NAME_STR_NO_QUOTING_FLAG
,
NULL
,
buf
,
&
size
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_INVALID_X500_STRING
,
"Expected CRYPT_E_INVALID_X500_STRING, got %08x
\n
"
,
GetLastError
());
ret
=
pCertStrToNameA
(
X509_ASN_ENCODING
,
"CN=
\"
1,2;3,4
\"
"
,
CERT_NAME_STR_NO_QUOTING_FLAG
,
NULL
,
buf
,
&
size
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_INVALID_X500_STRING
,
"Expected CRYPT_E_INVALID_X500_STRING, got %08x
\n
"
,
GetLastError
());
ret
=
pCertStrToNameA
(
X509_ASN_ENCODING
,
"CN=abc"
,
0
,
NULL
,
buf
,
&
size
,
NULL
);
ok
(
ret
&&
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %08x
\n
"
,
GetLastError
());
ret
=
pCertStrToNameA
(
X509_ASN_ENCODING
,
"CN=abc"
,
CERT_NAME_STR_NO_QUOTING_FLAG
,
NULL
,
buf
,
&
size
,
NULL
);
ok
(
ret
&&
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %08x
\n
"
,
GetLastError
());
ret
=
pCertStrToNameA
(
X509_ASN_ENCODING
,
"CN=
\"
abc
\"
"
,
0
,
NULL
,
buf
,
&
size
,
NULL
);
ok
(
ret
&&
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %08x
\n
"
,
GetLastError
());
ret
=
pCertStrToNameA
(
X509_ASN_ENCODING
,
"CN=
\"
abc
\"
"
,
CERT_NAME_STR_NO_QUOTING_FLAG
,
NULL
,
buf
,
&
size
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_MORE_DATA
,
"Expected ERROR_MORE_DATA, got %08x
\n
"
,
GetLastError
());
for
(
i
=
0
;
i
<
sizeof
(
namesA
)
/
sizeof
(
namesA
[
0
]);
i
++
)
{
size
=
sizeof
(
buf
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment