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
159c8af5
Commit
159c8af5
authored
Nov 01, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Nov 02, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Use consistent error checking.
parent
644dedb7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
str.c
dlls/crypt32/str.c
+22
-22
No files found.
dlls/crypt32/str.c
View file @
159c8af5
...
...
@@ -549,10 +549,10 @@ static void CRYPT_KeynameKeeperFromTokenW(struct KeynameKeeper *keeper,
TRACE
(
"Keyname is %s
\n
"
,
debugstr_w
(
keeper
->
keyName
));
}
static
DWORD
CRYPT_GetNextKeyW
(
LPCWSTR
str
,
struct
X500TokenW
*
token
,
static
BOOL
CRYPT_GetNextKeyW
(
LPCWSTR
str
,
struct
X500TokenW
*
token
,
LPCWSTR
*
ppszError
)
{
DWORD
ret
=
ERROR_SUCCESS
;
BOOL
ret
=
TRUE
;
while
(
*
str
&&
isspaceW
(
*
str
))
str
++
;
...
...
@@ -568,7 +568,8 @@ static DWORD CRYPT_GetNextKeyW(LPCWSTR str, struct X500TokenW *token,
TRACE
(
"missing equals char at %s
\n
"
,
debugstr_w
(
token
->
start
));
if
(
ppszError
)
*
ppszError
=
token
->
start
;
ret
=
CRYPT_E_INVALID_X500_STRING
;
SetLastError
(
CRYPT_E_INVALID_X500_STRING
);
ret
=
FALSE
;
}
}
else
...
...
@@ -577,10 +578,10 @@ static DWORD CRYPT_GetNextKeyW(LPCWSTR str, struct X500TokenW *token,
}
/* Assumes separators are characters in the 0-255 range */
static
DWORD
CRYPT_GetNextValueW
(
LPCWSTR
str
,
DWORD
dwFlags
,
LPCWSTR
separators
,
static
BOOL
CRYPT_GetNextValueW
(
LPCWSTR
str
,
DWORD
dwFlags
,
LPCWSTR
separators
,
struct
X500TokenW
*
token
,
LPCWSTR
*
ppszError
)
{
DWORD
ret
=
ERROR_SUCCESS
;
BOOL
ret
=
TRUE
;
TRACE
(
"(%s, %s, %p, %p)
\n
"
,
debugstr_w
(
str
),
debugstr_w
(
separators
),
token
,
ppszError
);
...
...
@@ -594,7 +595,7 @@ static DWORD CRYPT_GetNextValueW(LPCWSTR str, DWORD dwFlags, LPCWSTR separators,
{
token
->
end
=
NULL
;
str
++
;
while
(
!
token
->
end
&&
!
ret
)
while
(
!
token
->
end
&&
ret
)
{
while
(
*
str
&&
*
str
!=
'"'
)
str
++
;
...
...
@@ -610,7 +611,8 @@ static DWORD CRYPT_GetNextValueW(LPCWSTR str, DWORD dwFlags, LPCWSTR separators,
TRACE
(
"unterminated quote at %s
\n
"
,
debugstr_w
(
str
));
if
(
ppszError
)
*
ppszError
=
str
;
ret
=
CRYPT_E_INVALID_X500_STRING
;
SetLastError
(
CRYPT_E_INVALID_X500_STRING
);
ret
=
FALSE
;
}
}
}
...
...
@@ -630,7 +632,8 @@ static DWORD CRYPT_GetNextValueW(LPCWSTR str, DWORD dwFlags, LPCWSTR separators,
TRACE
(
"missing value at %s
\n
"
,
debugstr_w
(
str
));
if
(
ppszError
)
*
ppszError
=
str
;
ret
=
CRYPT_E_INVALID_X500_STRING
;
SetLastError
(
CRYPT_E_INVALID_X500_STRING
);
ret
=
FALSE
;
}
return
ret
;
}
...
...
@@ -765,7 +768,7 @@ BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
CERT_NAME_INFO
info
=
{
0
,
NULL
};
LPCWSTR
str
;
struct
KeynameKeeper
keeper
;
DWORD
i
,
error
=
ERROR_SUCCESS
;
DWORD
i
;
BOOL
ret
=
TRUE
;
TRACE
(
"(%08x, %s, %08x, %p, %p, %p, %p)
\n
"
,
dwCertEncodingType
,
...
...
@@ -774,12 +777,12 @@ BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
CRYPT_InitializeKeynameKeeper
(
&
keeper
);
str
=
pszX500
;
while
(
str
&&
*
str
&&
!
error
&&
ret
)
while
(
str
&&
*
str
&&
ret
)
{
struct
X500TokenW
token
;
error
=
CRYPT_GetNextKeyW
(
str
,
&
token
,
ppszError
);
if
(
!
error
&&
token
.
start
)
ret
=
CRYPT_GetNextKeyW
(
str
,
&
token
,
ppszError
);
if
(
ret
&&
token
.
start
)
{
PCCRYPT_OID_INFO
keyOID
;
...
...
@@ -790,7 +793,8 @@ BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
{
if
(
ppszError
)
*
ppszError
=
token
.
start
;
error
=
CRYPT_E_INVALID_X500_STRING
;
SetLastError
(
CRYPT_E_INVALID_X500_STRING
);
ret
=
FALSE
;
}
else
{
...
...
@@ -801,7 +805,8 @@ BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
{
if
(
ppszError
)
*
ppszError
=
str
;
error
=
CRYPT_E_INVALID_X500_STRING
;
SetLastError
(
CRYPT_E_INVALID_X500_STRING
);
ret
=
FALSE
;
}
else
{
...
...
@@ -820,9 +825,9 @@ BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
sep
=
crlfSep
;
else
sep
=
allSeps
;
error
=
CRYPT_GetNextValueW
(
str
,
dwStrType
,
sep
,
&
token
,
ret
=
CRYPT_GetNextValueW
(
str
,
dwStrType
,
sep
,
&
token
,
ppszError
);
if
(
!
error
)
if
(
ret
)
{
str
=
token
.
end
;
ret
=
CRYPT_ValueToRDN
(
dwCertEncodingType
,
&
info
,
...
...
@@ -833,18 +838,13 @@ BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
}
}
CRYPT_FreeKeynameKeeper
(
&
keeper
);
if
(
!
error
)
if
(
ret
)
{
if
(
ppszError
)
*
ppszError
=
NULL
;
ret
=
CryptEncodeObjectEx
(
dwCertEncodingType
,
X509_NAME
,
&
info
,
0
,
NULL
,
pbEncoded
,
pcbEncoded
);
}
else
{
SetLastError
(
error
);
ret
=
FALSE
;
}
for
(
i
=
0
;
i
<
info
.
cRDN
;
i
++
)
{
DWORD
j
;
...
...
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