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
03bf2369
Commit
03bf2369
authored
Nov 09, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bd59aa6d
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
298 additions
and
349 deletions
+298
-349
Makefile.in
dlls/crypt32/Makefile.in
+2
-0
base64.c
dlls/crypt32/base64.c
+20
-21
cert.c
dlls/crypt32/cert.c
+10
-21
chain.c
dlls/crypt32/chain.c
+21
-19
crl.c
dlls/crypt32/crl.c
+1
-2
decode.c
dlls/crypt32/decode.c
+0
-3
encode.c
dlls/crypt32/encode.c
+8
-12
filestore.c
dlls/crypt32/filestore.c
+1
-2
main.c
dlls/crypt32/main.c
+0
-1
msg.c
dlls/crypt32/msg.c
+0
-3
object.c
dlls/crypt32/object.c
+202
-203
oid.c
dlls/crypt32/oid.c
+4
-6
pfx.c
dlls/crypt32/pfx.c
+2
-6
regstore.c
dlls/crypt32/regstore.c
+1
-1
rootstore.c
dlls/crypt32/rootstore.c
+1
-17
serialize.c
dlls/crypt32/serialize.c
+0
-3
store.c
dlls/crypt32/store.c
+7
-10
str.c
dlls/crypt32/str.c
+18
-19
No files found.
dlls/crypt32/Makefile.in
View file @
03bf2369
...
...
@@ -6,6 +6,8 @@ DELAYIMPORTS = cryptnet
EXTRALIBS
=
$(SECURITY_LIBS)
EXTRAINCL
=
$(GNUTLS_CFLAGS)
EXTRADLLFLAGS
=
-mno-cygwin
C_SRCS
=
\
base64.c
\
cert.c
\
...
...
dlls/crypt32/base64.c
View file @
03bf2369
...
...
@@ -25,7 +25,6 @@
#include "winerror.h"
#include "wincrypt.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
crypt
);
...
...
@@ -331,7 +330,7 @@ static LONG encodeBase64W(const BYTE *in_buf, int in_len, LPCWSTR sep,
TRACE
(
"bytes is %d, pad bytes is %d
\n
"
,
bytes
,
pad_bytes
);
needed
=
bytes
+
pad_bytes
;
needed
+=
(
needed
/
64
+
(
needed
%
64
?
1
:
0
))
*
strlenW
(
sep
);
needed
+=
(
needed
/
64
+
(
needed
%
64
?
1
:
0
))
*
l
strlenW
(
sep
);
needed
++
;
if
(
needed
>
*
out_len
)
...
...
@@ -351,8 +350,8 @@ static LONG encodeBase64W(const BYTE *in_buf, int in_len, LPCWSTR sep,
{
if
(
i
&&
i
%
64
==
0
)
{
strcpyW
(
ptr
,
sep
);
ptr
+=
strlenW
(
sep
);
l
strcpyW
(
ptr
,
sep
);
ptr
+=
l
strlenW
(
sep
);
}
/* first char is the first 6 bits of the first byte*/
*
ptr
++
=
b64
[
(
d
[
0
]
>>
2
)
&
0x3f
];
...
...
@@ -395,7 +394,7 @@ static LONG encodeBase64W(const BYTE *in_buf, int in_len, LPCWSTR sep,
*
ptr
++
=
'='
;
break
;
}
strcpyW
(
ptr
,
sep
);
l
strcpyW
(
ptr
,
sep
);
return
ERROR_SUCCESS
;
}
...
...
@@ -436,9 +435,9 @@ static BOOL BinaryToBase64W(const BYTE *pbBinary,
charsNeeded
=
0
;
encodeBase64W
(
pbBinary
,
cbBinary
,
sep
,
NULL
,
&
charsNeeded
);
if
(
header
)
charsNeeded
+=
strlenW
(
header
)
+
strlenW
(
sep
);
charsNeeded
+=
lstrlenW
(
header
)
+
l
strlenW
(
sep
);
if
(
trailer
)
charsNeeded
+=
strlenW
(
trailer
)
+
strlenW
(
sep
);
charsNeeded
+=
lstrlenW
(
trailer
)
+
l
strlenW
(
sep
);
if
(
pszString
)
{
...
...
@@ -449,18 +448,18 @@ static BOOL BinaryToBase64W(const BYTE *pbBinary,
if
(
header
)
{
strcpyW
(
ptr
,
header
);
ptr
+=
strlenW
(
ptr
);
strcpyW
(
ptr
,
sep
);
ptr
+=
strlenW
(
sep
);
l
strcpyW
(
ptr
,
header
);
ptr
+=
l
strlenW
(
ptr
);
l
strcpyW
(
ptr
,
sep
);
ptr
+=
l
strlenW
(
sep
);
}
encodeBase64W
(
pbBinary
,
cbBinary
,
sep
,
ptr
,
&
size
);
ptr
+=
size
-
1
;
if
(
trailer
)
{
strcpyW
(
ptr
,
trailer
);
ptr
+=
strlenW
(
ptr
);
strcpyW
(
ptr
,
sep
);
l
strcpyW
(
ptr
,
trailer
);
ptr
+=
l
strlenW
(
ptr
);
l
strcpyW
(
ptr
,
sep
);
}
*
pcchString
=
charsNeeded
-
1
;
}
...
...
@@ -912,27 +911,27 @@ static LONG Base64WithHeaderAndTrailerToBinaryW(LPCWSTR pszString,
LPCWSTR
trailerBegins
;
size_t
dataLength
;
if
((
strlenW
(
header
)
+
strlenW
(
trailer
))
>
cchString
)
if
((
lstrlenW
(
header
)
+
l
strlenW
(
trailer
))
>
cchString
)
{
return
ERROR_INVALID_DATA
;
}
if
(
!
(
headerBegins
=
strstrW
(
pszString
,
header
)))
if
(
!
(
headerBegins
=
wcsstr
(
pszString
,
header
)))
{
TRACE
(
"Can't find %s in %s.
\n
"
,
debugstr_w
(
header
),
debugstr_wn
(
pszString
,
cchString
));
return
ERROR_INVALID_DATA
;
}
dataBegins
=
headerBegins
+
strlenW
(
header
);
if
(
!
(
dataBegins
=
strstrW
(
dataBegins
,
CERT_DELIMITER_W
)))
dataBegins
=
headerBegins
+
l
strlenW
(
header
);
if
(
!
(
dataBegins
=
wcsstr
(
dataBegins
,
CERT_DELIMITER_W
)))
{
return
ERROR_INVALID_DATA
;
}
dataBegins
+=
strlenW
(
CERT_DELIMITER_W
);
dataBegins
+=
l
strlenW
(
CERT_DELIMITER_W
);
if
(
*
dataBegins
==
'\r'
)
dataBegins
++
;
if
(
*
dataBegins
==
'\n'
)
dataBegins
++
;
if
(
!
(
trailerBegins
=
strstrW
(
dataBegins
,
trailer
)))
if
(
!
(
trailerBegins
=
wcsstr
(
dataBegins
,
trailer
)))
{
return
ERROR_INVALID_DATA
;
}
...
...
@@ -1091,7 +1090,7 @@ BOOL WINAPI CryptStringToBinaryW(LPCWSTR pszString,
return
FALSE
;
}
if
(
!
cchString
)
cchString
=
strlenW
(
pszString
);
cchString
=
l
strlenW
(
pszString
);
ret
=
decoder
(
pszString
,
cchString
,
pbBinary
,
pcbBinary
,
pdwSkip
,
pdwFlags
);
if
(
ret
)
SetLastError
(
ret
);
...
...
dlls/crypt32/cert.c
View file @
03bf2369
...
...
@@ -33,7 +33,6 @@
#include "winnls.h"
#include "rpc.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "crypt32_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
crypt
);
...
...
@@ -1125,10 +1124,10 @@ static BOOL container_matches_cert(PCCERT_CONTEXT pCert, LPCSTR container,
if
(
matches
)
{
keyProvInfo
->
pwszContainerName
=
CryptMemAlloc
((
strlenW
(
containerW
)
+
1
)
*
sizeof
(
WCHAR
));
CryptMemAlloc
((
l
strlenW
(
containerW
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
keyProvInfo
->
pwszContainerName
)
{
strcpyW
(
keyProvInfo
->
pwszContainerName
,
containerW
);
l
strcpyW
(
keyProvInfo
->
pwszContainerName
,
containerW
);
keyProvInfo
->
dwKeySpec
=
AT_SIGNATURE
;
}
else
...
...
@@ -1805,13 +1804,10 @@ static BOOL compare_cert_by_name_str(PCCERT_CONTEXT pCertContext,
if
(
str
)
{
LPWSTR
ptr
;
CertNameToStrW
(
pCertContext
->
dwCertEncodingType
,
name
,
CERT_SIMPLE_NAME_STR
,
str
,
len
);
for
(
ptr
=
str
;
*
ptr
;
ptr
++
)
*
ptr
=
tolowerW
(
*
ptr
);
if
(
strstrW
(
str
,
pvPara
))
wcslwr
(
str
);
if
(
wcsstr
(
str
,
pvPara
))
ret
=
TRUE
;
CryptMemFree
(
str
);
}
...
...
@@ -1833,11 +1829,8 @@ static PCCERT_CONTEXT find_cert_by_name_str_a(HCERTSTORE store, DWORD dwType,
if
(
str
)
{
LPWSTR
ptr
;
MultiByteToWideChar
(
CP_ACP
,
0
,
pvPara
,
-
1
,
str
,
len
);
for
(
ptr
=
str
;
*
ptr
;
ptr
++
)
*
ptr
=
tolowerW
(
*
ptr
);
wcslwr
(
str
);
found
=
cert_compare_certs_in_store
(
store
,
prev
,
compare_cert_by_name_str
,
dwType
,
dwFlags
,
str
);
CryptMemFree
(
str
);
...
...
@@ -1857,17 +1850,13 @@ static PCCERT_CONTEXT find_cert_by_name_str_w(HCERTSTORE store, DWORD dwType,
if
(
pvPara
)
{
DWORD
len
=
strlenW
(
pvPara
);
DWORD
len
=
l
strlenW
(
pvPara
);
LPWSTR
str
=
CryptMemAlloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
str
)
{
LPCWSTR
src
;
LPWSTR
dst
;
for
(
src
=
pvPara
,
dst
=
str
;
*
src
;
src
++
,
dst
++
)
*
dst
=
tolowerW
(
*
src
);
*
dst
=
0
;
wcscpy
(
str
,
pvPara
);
wcslwr
(
str
);
found
=
cert_compare_certs_in_store
(
store
,
prev
,
compare_cert_by_name_str
,
dwType
,
dwFlags
,
str
);
CryptMemFree
(
str
);
...
...
@@ -2216,10 +2205,10 @@ static BOOL find_matching_rdn_attr(DWORD dwFlags, const CERT_NAME_INFO *name,
name
->
rgRDN
[
i
].
rgRDNAttr
[
j
].
Value
.
cbData
)
match
=
FALSE
;
else
if
(
dwFlags
&
CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG
)
match
=
!
strncmpiW
(
nameStr
,
attrStr
,
match
=
!
wcsnicmp
(
nameStr
,
attrStr
,
attr
->
Value
.
cbData
/
sizeof
(
WCHAR
));
else
match
=
!
strncmpW
(
nameStr
,
attrStr
,
match
=
!
wcsncmp
(
nameStr
,
attrStr
,
attr
->
Value
.
cbData
/
sizeof
(
WCHAR
));
TRACE
(
"%s : %s => %d
\n
"
,
debugstr_wn
(
nameStr
,
attr
->
Value
.
cbData
/
sizeof
(
WCHAR
)),
...
...
dlls/crypt32/chain.c
View file @
03bf2369
...
...
@@ -16,16 +16,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#include <stdarg.h>
#include <wchar.h>
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#define CERT_CHAIN_PARA_HAS_EXTRA_FIELDS
#define CERT_REVOCATION_PARA_HAS_EXTRA_FIELDS
#include "wincrypt.h"
#include "wininet.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "crypt32_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
crypt
);
...
...
@@ -704,18 +706,18 @@ static BOOL url_matches(LPCWSTR constraint, LPCWSTR name,
* The format for URIs is in RFC 2396.
*
* First, remove any scheme that's present. */
colon
=
strchrW
(
name
,
':'
);
colon
=
wcschr
(
name
,
':'
);
if
(
colon
&&
*
(
colon
+
1
)
==
'/'
&&
*
(
colon
+
2
)
==
'/'
)
name
=
colon
+
3
;
/* Next, find the end of the authority component. (The authority is
* generally just the hostname, but it may contain a username or a port.
* Those are removed next.)
*/
authority_end
=
strchrW
(
name
,
'/'
);
authority_end
=
wcschr
(
name
,
'/'
);
if
(
!
authority_end
)
authority_end
=
strchrW
(
name
,
'?'
);
authority_end
=
wcschr
(
name
,
'?'
);
if
(
!
authority_end
)
authority_end
=
name
+
strlenW
(
name
);
authority_end
=
name
+
l
strlenW
(
name
);
/* Remove any port number from the authority. The userinfo portion
* of an authority may contain a colon, so stop if a userinfo portion
* is found (indicated by '@').
...
...
@@ -726,7 +728,7 @@ static BOOL url_matches(LPCWSTR constraint, LPCWSTR name,
if
(
*
colon
==
':'
)
authority_end
=
colon
;
/* Remove any username from the authority */
if
((
at
=
strchrW
(
name
,
'@'
)))
if
((
at
=
wcschr
(
name
,
'@'
)))
name
=
at
;
/* Ignore any path or query portion of the URL. */
if
(
*
authority_end
)
...
...
@@ -760,11 +762,11 @@ static BOOL rfc822_name_matches(LPCWSTR constraint, LPCWSTR name,
*
trustErrorStatus
|=
CERT_TRUST_INVALID_NAME_CONSTRAINTS
;
else
if
(
!
name
)
;
/* no match */
else
if
(
strchrW
(
constraint
,
'@'
))
else
if
(
wcschr
(
constraint
,
'@'
))
match
=
!
lstrcmpiW
(
constraint
,
name
);
else
{
if
((
at
=
strchrW
(
name
,
'@'
)))
if
((
at
=
wcschr
(
name
,
'@'
)))
match
=
domain_name_matches
(
constraint
,
at
+
1
);
else
match
=
!
lstrcmpiW
(
constraint
,
name
);
...
...
@@ -3195,15 +3197,15 @@ static BOOL match_dns_to_subject_alt_name(const CERT_EXTENSION *ext,
* label, then requires an exact match of the remaining
* string.
*/
server_name_dot
=
strchrW
(
server_name
,
'.'
);
server_name_dot
=
wcschr
(
server_name
,
'.'
);
if
(
server_name_dot
)
{
if
(
!
strcmpiW
(
server_name_dot
,
if
(
!
wcsicmp
(
server_name_dot
,
subjectName
->
rgAltEntry
[
i
].
u
.
pwszDNSName
+
1
))
matches
=
TRUE
;
}
}
else
if
(
!
strcmpiW
(
server_name
,
else
if
(
!
wcsicmp
(
server_name
,
subjectName
->
rgAltEntry
[
i
].
u
.
pwszDNSName
))
matches
=
TRUE
;
}
...
...
@@ -3226,13 +3228,13 @@ static BOOL find_matching_domain_component(const CERT_NAME_INFO *name,
const
CERT_RDN_ATTR
*
attr
;
attr
=
&
name
->
rgRDN
[
i
].
rgRDNAttr
[
j
];
/* Compare with
strncmpiW rather than strcmpiW
in order to avoid
/* Compare with
wcsnicmp rather than wcsicmp
in order to avoid
* a match with a string with an embedded NULL. The component
* must match one domain component attribute's entire string
* value with a case-insensitive match.
*/
if
((
len
==
attr
->
Value
.
cbData
/
sizeof
(
WCHAR
))
&&
!
strncmpiW
(
component
,
(
LPCWSTR
)
attr
->
Value
.
pbData
,
len
))
!
wcsnicmp
(
component
,
(
LPCWSTR
)
attr
->
Value
.
pbData
,
len
))
return
TRUE
;
}
return
FALSE
;
...
...
@@ -3283,7 +3285,7 @@ static BOOL match_domain_component(LPCWSTR allowed_component, DWORD allowed_len,
}
}
if
(
matches
)
matches
=
to
lowerW
(
*
allowed_ptr
)
==
tolowerW
(
*
server_ptr
);
matches
=
to
wlower
(
*
allowed_ptr
)
==
towlower
(
*
server_ptr
);
}
if
(
matches
&&
server_ptr
-
server_component
<
server_len
)
{
...
...
@@ -3301,7 +3303,7 @@ static BOOL match_common_name(LPCWSTR server_name, const CERT_RDN_ATTR *nameAttr
LPCWSTR
allowed_component
=
allowed
;
DWORD
allowed_len
=
nameAttr
->
Value
.
cbData
/
sizeof
(
WCHAR
);
LPCWSTR
server_component
=
server_name
;
DWORD
server_len
=
strlenW
(
server_name
);
DWORD
server_len
=
l
strlenW
(
server_name
);
BOOL
matches
=
TRUE
,
allow_wildcards
=
TRUE
;
TRACE_
(
chain
)(
"CN = %s
\n
"
,
debugstr_wn
(
allowed_component
,
allowed_len
));
...
...
@@ -3332,9 +3334,9 @@ static BOOL match_common_name(LPCWSTR server_name, const CERT_RDN_ATTR *nameAttr
do
{
LPCWSTR
allowed_dot
,
server_dot
;
allowed_dot
=
memchrW
(
allowed_component
,
'.'
,
allowed_dot
=
wmemchr
(
allowed_component
,
'.'
,
allowed_len
-
(
allowed_component
-
allowed
));
server_dot
=
memchrW
(
server_component
,
'.'
,
server_dot
=
wmemchr
(
server_component
,
'.'
,
server_len
-
(
server_component
-
server_name
));
/* The number of components must match */
if
((
!
allowed_dot
&&
server_dot
)
||
(
allowed_dot
&&
!
server_dot
))
...
...
@@ -3395,11 +3397,11 @@ static BOOL match_dns_to_subject_dn(PCCERT_CONTEXT cert, LPCWSTR server_name)
LPCWSTR
ptr
=
server_name
;
do
{
LPCWSTR
dot
=
strchrW
(
ptr
,
'.'
),
end
;
LPCWSTR
dot
=
wcschr
(
ptr
,
'.'
),
end
;
/* 254 is the maximum DNS label length, see RFC 1035 */
size_t
len
;
end
=
dot
?
dot
:
ptr
+
strlenW
(
ptr
);
end
=
dot
?
dot
:
ptr
+
l
strlenW
(
ptr
);
len
=
end
-
ptr
;
if
(
len
>=
255
)
{
...
...
dlls/crypt32/crl.c
View file @
03bf2369
...
...
@@ -24,7 +24,6 @@
#include "winbase.h"
#include "wincrypt.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "crypt32_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
crypt
);
...
...
@@ -614,7 +613,7 @@ static BOOL compare_dist_point_name(const CRL_DIST_POINT_NAME *name1,
switch
(
entry1
->
dwAltNameChoice
)
{
case
CERT_ALT_NAME_URL
:
match
=
!
strcmpiW
(
entry1
->
u
.
pwszURL
,
match
=
!
wcsicmp
(
entry1
->
u
.
pwszURL
,
entry2
->
u
.
pwszURL
);
break
;
case
CERT_ALT_NAME_DIRECTORY_NAME
:
...
...
dlls/crypt32/decode.c
View file @
03bf2369
...
...
@@ -30,9 +30,6 @@
* MSDN, especially "Constants for CryptEncodeObject and CryptDecodeObject"
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
...
...
dlls/crypt32/encode.c
View file @
03bf2369
...
...
@@ -30,9 +30,6 @@
* MSDN, especially "Constants for CryptEncodeObject and CryptDecodeObject"
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
...
...
@@ -46,7 +43,6 @@
#include "snmp.h"
#include "wine/debug.h"
#include "wine/exception.h"
#include "wine/unicode.h"
#include "crypt32_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
cryptasn
);
...
...
@@ -1015,7 +1011,7 @@ static BOOL CRYPT_AsnEncodeUTF8String(const CERT_NAME_VALUE *value,
if
(
value
->
Value
.
cbData
)
strLen
=
value
->
Value
.
cbData
/
sizeof
(
WCHAR
);
else
if
(
str
)
strLen
=
strlenW
(
str
);
strLen
=
l
strlenW
(
str
);
else
strLen
=
0
;
encodedLen
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
str
,
strLen
,
NULL
,
0
,
NULL
,
...
...
@@ -1186,7 +1182,7 @@ static BOOL CRYPT_AsnEncodeRdnAttr(DWORD dwCertEncodingType,
return
ret
;
}
static
int
BLOBComp
(
const
void
*
l
,
const
void
*
r
)
static
int
__cdecl
BLOBComp
(
const
void
*
l
,
const
void
*
r
)
{
const
CRYPT_DER_BLOB
*
a
=
l
,
*
b
=
r
;
int
ret
;
...
...
@@ -1999,7 +1995,7 @@ static BOOL CRYPT_AsnEncodeUnicodeStringCoerce(const CERT_NAME_VALUE *value,
if
(
value
->
Value
.
cbData
)
encodedLen
=
value
->
Value
.
cbData
/
sizeof
(
WCHAR
);
else
if
(
str
)
encodedLen
=
strlenW
(
str
);
encodedLen
=
l
strlenW
(
str
);
else
encodedLen
=
0
;
CRYPT_EncodeLen
(
encodedLen
,
NULL
,
&
lenBytes
);
...
...
@@ -2036,7 +2032,7 @@ static BOOL CRYPT_AsnEncodeNumericString(const CERT_NAME_VALUE *value,
if
(
value
->
Value
.
cbData
)
encodedLen
=
value
->
Value
.
cbData
/
sizeof
(
WCHAR
);
else
if
(
str
)
encodedLen
=
strlenW
(
str
);
encodedLen
=
l
strlenW
(
str
);
else
encodedLen
=
0
;
CRYPT_EncodeLen
(
encodedLen
,
NULL
,
&
lenBytes
);
...
...
@@ -2078,7 +2074,7 @@ static BOOL CRYPT_AsnEncodeNumericString(const CERT_NAME_VALUE *value,
static
inline
BOOL
isprintableW
(
WCHAR
wc
)
{
return
is
alnumW
(
wc
)
||
isspaceW
(
wc
)
||
wc
==
'\''
||
wc
==
'('
||
return
is
walnum
(
wc
)
||
iswspace
(
wc
)
||
wc
==
'\''
||
wc
==
'('
||
wc
==
')'
||
wc
==
'+'
||
wc
==
','
||
wc
==
'-'
||
wc
==
'.'
||
wc
==
'/'
||
wc
==
':'
||
wc
==
'='
||
wc
==
'?'
;
}
...
...
@@ -2094,7 +2090,7 @@ static BOOL CRYPT_AsnEncodePrintableString(const CERT_NAME_VALUE *value,
if
(
value
->
Value
.
cbData
)
encodedLen
=
value
->
Value
.
cbData
/
sizeof
(
WCHAR
);
else
if
(
str
)
encodedLen
=
strlenW
(
str
);
encodedLen
=
l
strlenW
(
str
);
else
encodedLen
=
0
;
CRYPT_EncodeLen
(
encodedLen
,
NULL
,
&
lenBytes
);
...
...
@@ -2145,7 +2141,7 @@ static BOOL CRYPT_AsnEncodeIA5String(const CERT_NAME_VALUE *value,
if
(
value
->
Value
.
cbData
)
encodedLen
=
value
->
Value
.
cbData
/
sizeof
(
WCHAR
);
else
if
(
str
)
encodedLen
=
strlenW
(
str
);
encodedLen
=
l
strlenW
(
str
);
else
encodedLen
=
0
;
CRYPT_EncodeLen
(
encodedLen
,
NULL
,
&
lenBytes
);
...
...
@@ -2197,7 +2193,7 @@ static BOOL CRYPT_AsnEncodeUniversalString(const CERT_NAME_VALUE *value,
if
(
value
->
Value
.
cbData
)
strLen
=
value
->
Value
.
cbData
/
sizeof
(
WCHAR
);
else
if
(
str
)
strLen
=
strlenW
(
str
);
strLen
=
l
strlenW
(
str
);
else
strLen
=
0
;
CRYPT_EncodeLen
(
strLen
*
4
,
NULL
,
&
lenBytes
);
...
...
dlls/crypt32/filestore.c
View file @
03bf2369
...
...
@@ -21,7 +21,6 @@
#include "wincrypt.h"
#include "winnls.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "crypt32_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
crypt
);
...
...
@@ -356,7 +355,7 @@ WINECRYPT_CERTSTORE *CRYPT_FileNameOpenStoreW(HCRYPTPROV hCryptProv,
{
static
const
WCHAR
spc
[]
=
{
's'
,
'p'
,
'c'
,
0
};
static
const
WCHAR
p7c
[]
=
{
'p'
,
'7'
,
'c'
,
0
};
LPCWSTR
ext
=
strrchrW
(
fileName
,
'.'
);
LPCWSTR
ext
=
wcsrchr
(
fileName
,
'.'
);
if
(
ext
)
{
...
...
dlls/crypt32/main.c
View file @
03bf2369
...
...
@@ -17,7 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
...
...
dlls/crypt32/msg.c
View file @
03bf2369
...
...
@@ -16,9 +16,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#define NONAMELESSUNION
#include "windef.h"
...
...
dlls/crypt32/object.c
View file @
03bf2369
...
...
@@ -27,7 +27,6 @@
#include "wintrust.h"
#include "crypt32_private.h"
#include "cryptres.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
crypt
);
...
...
@@ -870,9 +869,9 @@ static BOOL WINAPI CRYPT_FormatHexString(DWORD dwCertEncodingType,
for
(
i
=
0
;
i
<
cbEncoded
;
i
++
)
{
if
(
i
<
cbEncoded
-
1
)
ptr
+=
s
printfW
(
ptr
,
fmt
,
pbEncoded
[
i
]);
ptr
+=
s
wprintf
(
ptr
,
4
,
fmt
,
pbEncoded
[
i
]);
else
ptr
+=
s
printfW
(
ptr
,
endFmt
,
pbEncoded
[
i
]);
ptr
+=
s
wprintf
(
ptr
,
3
,
endFmt
,
pbEncoded
[
i
]);
}
}
else
...
...
@@ -904,9 +903,9 @@ static BOOL CRYPT_FormatBits(BYTE bits, const struct BitToString *map,
if
(
bits
&
map
[
i
].
bit
)
{
if
(
!
localFirst
)
bytesNeeded
+=
strlenW
(
commaSpace
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
commaSpace
)
*
sizeof
(
WCHAR
);
localFirst
=
FALSE
;
bytesNeeded
+=
strlenW
(
map
[
i
].
str
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
map
[
i
].
str
)
*
sizeof
(
WCHAR
);
}
if
(
!
pbFormat
)
{
...
...
@@ -931,12 +930,12 @@ static BOOL CRYPT_FormatBits(BYTE bits, const struct BitToString *map,
{
if
(
!
localFirst
)
{
strcpyW
(
str
,
commaSpace
);
str
+=
strlenW
(
commaSpace
);
l
strcpyW
(
str
,
commaSpace
);
str
+=
l
strlenW
(
commaSpace
);
}
localFirst
=
FALSE
;
strcpyW
(
str
,
map
[
i
].
str
);
str
+=
strlenW
(
map
[
i
].
str
);
l
strcpyW
(
str
,
map
[
i
].
str
);
str
+=
l
strlenW
(
map
[
i
].
str
);
}
*
first
=
localFirst
;
}
...
...
@@ -981,7 +980,7 @@ static BOOL WINAPI CRYPT_FormatKeyUsage(DWORD dwCertEncodingType,
LoadStringW
(
hInstance
,
IDS_INFO_NOT_AVAILABLE
,
infoNotAvailable
,
ARRAY_SIZE
(
infoNotAvailable
));
if
(
!
bits
->
cbData
||
bits
->
cbData
>
2
)
{
bytesNeeded
+=
strlenW
(
infoNotAvailable
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
infoNotAvailable
)
*
sizeof
(
WCHAR
);
if
(
!
pbFormat
)
*
pcbFormat
=
bytesNeeded
;
else
if
(
*
pcbFormat
<
bytesNeeded
)
...
...
@@ -995,7 +994,7 @@ static BOOL WINAPI CRYPT_FormatKeyUsage(DWORD dwCertEncodingType,
LPWSTR
str
=
pbFormat
;
*
pcbFormat
=
bytesNeeded
;
strcpyW
(
str
,
infoNotAvailable
);
l
strcpyW
(
str
,
infoNotAvailable
);
}
}
else
...
...
@@ -1098,12 +1097,12 @@ static BOOL WINAPI CRYPT_FormatBasicConstraints2(DWORD dwCertEncodingType,
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
{
sep
=
crlf
;
sepLen
=
strlenW
(
crlf
)
*
sizeof
(
WCHAR
);
sepLen
=
l
strlenW
(
crlf
)
*
sizeof
(
WCHAR
);
}
else
{
sep
=
commaSpace
;
sepLen
=
strlenW
(
commaSpace
)
*
sizeof
(
WCHAR
);
sepLen
=
l
strlenW
(
commaSpace
)
*
sizeof
(
WCHAR
);
}
if
(
!
stringsLoaded
)
...
...
@@ -1114,19 +1113,19 @@ static BOOL WINAPI CRYPT_FormatBasicConstraints2(DWORD dwCertEncodingType,
LoadStringW
(
hInstance
,
IDS_PATH_LENGTH
,
pathLengthHeader
,
ARRAY_SIZE
(
pathLengthHeader
));
stringsLoaded
=
TRUE
;
}
bytesNeeded
+=
strlenW
(
subjectTypeHeader
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
subjectTypeHeader
)
*
sizeof
(
WCHAR
);
if
(
info
->
fCA
)
subjectType
=
subjectTypeCA
;
else
subjectType
=
subjectTypeEndCert
;
bytesNeeded
+=
strlenW
(
subjectType
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
subjectType
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
sepLen
;
bytesNeeded
+=
strlenW
(
pathLengthHeader
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
pathLengthHeader
)
*
sizeof
(
WCHAR
);
if
(
info
->
fPathLenConstraint
)
s
printfW
(
pathLength
,
pathFmt
,
info
->
dwPathLenConstraint
);
s
wprintf
(
pathLength
,
ARRAY_SIZE
(
pathLength
)
,
pathFmt
,
info
->
dwPathLenConstraint
);
else
LoadStringW
(
hInstance
,
IDS_PATH_LENGTH_NONE
,
pathLength
,
ARRAY_SIZE
(
pathLength
));
bytesNeeded
+=
strlenW
(
pathLength
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
pathLength
)
*
sizeof
(
WCHAR
);
if
(
!
pbFormat
)
*
pcbFormat
=
bytesNeeded
;
else
if
(
*
pcbFormat
<
bytesNeeded
)
...
...
@@ -1140,15 +1139,15 @@ static BOOL WINAPI CRYPT_FormatBasicConstraints2(DWORD dwCertEncodingType,
LPWSTR
str
=
pbFormat
;
*
pcbFormat
=
bytesNeeded
;
strcpyW
(
str
,
subjectTypeHeader
);
str
+=
strlenW
(
subjectTypeHeader
);
strcpyW
(
str
,
subjectType
);
str
+=
strlenW
(
subjectType
);
strcpyW
(
str
,
sep
);
l
strcpyW
(
str
,
subjectTypeHeader
);
str
+=
l
strlenW
(
subjectTypeHeader
);
l
strcpyW
(
str
,
subjectType
);
str
+=
l
strlenW
(
subjectType
);
l
strcpyW
(
str
,
sep
);
str
+=
sepLen
/
sizeof
(
WCHAR
);
strcpyW
(
str
,
pathLengthHeader
);
str
+=
strlenW
(
pathLengthHeader
);
strcpyW
(
str
,
pathLength
);
l
strcpyW
(
str
,
pathLengthHeader
);
str
+=
l
strlenW
(
pathLengthHeader
);
l
strcpyW
(
str
,
pathLength
);
}
LocalFree
(
info
);
}
...
...
@@ -1165,7 +1164,7 @@ static BOOL CRYPT_FormatHexStringWithPrefix(const CRYPT_DATA_BLOB *blob, int id,
LoadStringW
(
hInstance
,
id
,
buf
,
ARRAY_SIZE
(
buf
));
CRYPT_FormatHexString
(
X509_ASN_ENCODING
,
0
,
0
,
NULL
,
NULL
,
blob
->
pbData
,
blob
->
cbData
,
NULL
,
&
bytesNeeded
);
bytesNeeded
+=
strlenW
(
buf
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
buf
)
*
sizeof
(
WCHAR
);
if
(
!
str
)
{
*
pcbStr
=
bytesNeeded
;
...
...
@@ -1180,9 +1179,9 @@ static BOOL CRYPT_FormatHexStringWithPrefix(const CRYPT_DATA_BLOB *blob, int id,
else
{
*
pcbStr
=
bytesNeeded
;
strcpyW
(
str
,
buf
);
str
+=
strlenW
(
str
);
bytesNeeded
-=
strlenW
(
str
)
*
sizeof
(
WCHAR
);
l
strcpyW
(
str
,
buf
);
str
+=
l
strlenW
(
str
);
bytesNeeded
-=
l
strlenW
(
str
)
*
sizeof
(
WCHAR
);
ret
=
CRYPT_FormatHexString
(
X509_ASN_ENCODING
,
0
,
0
,
NULL
,
NULL
,
blob
->
pbData
,
blob
->
cbData
,
str
,
&
bytesNeeded
);
}
...
...
@@ -1217,17 +1216,17 @@ static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel,
DWORD
strType
=
CERT_X500_NAME_STR
|
CERT_NAME_STR_REVERSE_FLAG
;
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
bytesNeeded
+=
indentLevel
*
strlenW
(
indent
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
indentLevel
*
l
strlenW
(
indent
)
*
sizeof
(
WCHAR
);
switch
(
entry
->
dwAltNameChoice
)
{
case
CERT_ALT_NAME_RFC822_NAME
:
LoadStringW
(
hInstance
,
IDS_ALT_NAME_RFC822_NAME
,
buf
,
ARRAY_SIZE
(
buf
));
bytesNeeded
+=
strlenW
(
entry
->
u
.
pwszRfc822Name
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
entry
->
u
.
pwszRfc822Name
)
*
sizeof
(
WCHAR
);
ret
=
TRUE
;
break
;
case
CERT_ALT_NAME_DNS_NAME
:
LoadStringW
(
hInstance
,
IDS_ALT_NAME_DNS_NAME
,
buf
,
ARRAY_SIZE
(
buf
));
bytesNeeded
+=
strlenW
(
entry
->
u
.
pwszDNSName
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
entry
->
u
.
pwszDNSName
)
*
sizeof
(
WCHAR
);
ret
=
TRUE
;
break
;
case
CERT_ALT_NAME_DIRECTORY_NAME
:
...
...
@@ -1241,7 +1240,7 @@ static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel,
LoadStringW
(
hInstance
,
IDS_ALT_NAME_DIRECTORY_NAME
,
buf
,
ARRAY_SIZE
(
buf
));
bytesNeeded
+=
(
directoryNameLen
-
1
)
*
sizeof
(
WCHAR
);
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
bytesNeeded
+=
strlenW
(
colonCrlf
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
colonCrlf
)
*
sizeof
(
WCHAR
);
else
bytesNeeded
+=
sizeof
(
WCHAR
);
/* '=' */
ret
=
TRUE
;
...
...
@@ -1249,7 +1248,7 @@ static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel,
}
case
CERT_ALT_NAME_URL
:
LoadStringW
(
hInstance
,
IDS_ALT_NAME_URL
,
buf
,
ARRAY_SIZE
(
buf
));
bytesNeeded
+=
strlenW
(
entry
->
u
.
pwszURL
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
entry
->
u
.
pwszURL
)
*
sizeof
(
WCHAR
);
ret
=
TRUE
;
break
;
case
CERT_ALT_NAME_IP_ADDRESS
:
...
...
@@ -1266,26 +1265,26 @@ static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel,
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
{
LoadStringW
(
hInstance
,
IDS_ALT_NAME_MASK
,
mask
,
ARRAY_SIZE
(
mask
));
bytesNeeded
+=
strlenW
(
mask
)
*
sizeof
(
WCHAR
);
s
printfW
(
ipAddrBuf
,
ipAddrFmt
,
bytesNeeded
+=
l
strlenW
(
mask
)
*
sizeof
(
WCHAR
);
s
wprintf
(
ipAddrBuf
,
ARRAY_SIZE
(
ipAddrBuf
)
,
ipAddrFmt
,
entry
->
u
.
IPAddress
.
pbData
[
0
],
entry
->
u
.
IPAddress
.
pbData
[
1
],
entry
->
u
.
IPAddress
.
pbData
[
2
],
entry
->
u
.
IPAddress
.
pbData
[
3
]);
bytesNeeded
+=
strlenW
(
ipAddrBuf
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
ipAddrBuf
)
*
sizeof
(
WCHAR
);
/* indent again, for the mask line */
bytesNeeded
+=
indentLevel
*
strlenW
(
indent
)
*
sizeof
(
WCHAR
);
s
printfW
(
maskBuf
,
ipAddrFmt
,
bytesNeeded
+=
indentLevel
*
l
strlenW
(
indent
)
*
sizeof
(
WCHAR
);
s
wprintf
(
maskBuf
,
ARRAY_SIZE
(
maskBuf
)
,
ipAddrFmt
,
entry
->
u
.
IPAddress
.
pbData
[
4
],
entry
->
u
.
IPAddress
.
pbData
[
5
],
entry
->
u
.
IPAddress
.
pbData
[
6
],
entry
->
u
.
IPAddress
.
pbData
[
7
]);
bytesNeeded
+=
strlenW
(
maskBuf
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
strlenW
(
crlf
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
maskBuf
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
crlf
)
*
sizeof
(
WCHAR
);
}
else
{
s
printfW
(
ipAddrBuf
,
ipAddrWithMaskFmt
,
s
wprintf
(
ipAddrBuf
,
ARRAY_SIZE
(
ipAddrBuf
)
,
ipAddrWithMaskFmt
,
entry
->
u
.
IPAddress
.
pbData
[
0
],
entry
->
u
.
IPAddress
.
pbData
[
1
],
entry
->
u
.
IPAddress
.
pbData
[
2
],
...
...
@@ -1294,7 +1293,7 @@ static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel,
entry
->
u
.
IPAddress
.
pbData
[
5
],
entry
->
u
.
IPAddress
.
pbData
[
6
],
entry
->
u
.
IPAddress
.
pbData
[
7
]);
bytesNeeded
+=
(
strlenW
(
ipAddrBuf
)
+
1
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
(
l
strlenW
(
ipAddrBuf
)
+
1
)
*
sizeof
(
WCHAR
);
}
ret
=
TRUE
;
}
...
...
@@ -1312,7 +1311,7 @@ static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel,
}
if
(
ret
)
{
bytesNeeded
+=
strlenW
(
buf
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
buf
)
*
sizeof
(
WCHAR
);
if
(
!
str
)
*
pcbStr
=
bytesNeeded
;
else
if
(
*
pcbStr
<
bytesNeeded
)
...
...
@@ -1330,24 +1329,24 @@ static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel,
{
for
(
i
=
0
;
i
<
indentLevel
;
i
++
)
{
strcpyW
(
str
,
indent
);
str
+=
strlenW
(
indent
);
l
strcpyW
(
str
,
indent
);
str
+=
l
strlenW
(
indent
);
}
}
strcpyW
(
str
,
buf
);
str
+=
strlenW
(
str
);
l
strcpyW
(
str
,
buf
);
str
+=
l
strlenW
(
str
);
switch
(
entry
->
dwAltNameChoice
)
{
case
CERT_ALT_NAME_RFC822_NAME
:
case
CERT_ALT_NAME_DNS_NAME
:
case
CERT_ALT_NAME_URL
:
strcpyW
(
str
,
entry
->
u
.
pwszURL
);
l
strcpyW
(
str
,
entry
->
u
.
pwszURL
);
break
;
case
CERT_ALT_NAME_DIRECTORY_NAME
:
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
{
strcpyW
(
str
,
colonCrlf
);
str
+=
strlenW
(
colonCrlf
);
l
strcpyW
(
str
,
colonCrlf
);
str
+=
l
strlenW
(
colonCrlf
);
}
else
*
str
++
=
'='
;
...
...
@@ -1358,24 +1357,24 @@ static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel,
case
CERT_ALT_NAME_IP_ADDRESS
:
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
{
strcpyW
(
str
,
ipAddrBuf
);
str
+=
strlenW
(
ipAddrBuf
);
strcpyW
(
str
,
crlf
);
str
+=
strlenW
(
crlf
);
l
strcpyW
(
str
,
ipAddrBuf
);
str
+=
l
strlenW
(
ipAddrBuf
);
l
strcpyW
(
str
,
crlf
);
str
+=
l
strlenW
(
crlf
);
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
{
for
(
i
=
0
;
i
<
indentLevel
;
i
++
)
{
strcpyW
(
str
,
indent
);
str
+=
strlenW
(
indent
);
l
strcpyW
(
str
,
indent
);
str
+=
l
strlenW
(
indent
);
}
}
strcpyW
(
str
,
mask
);
str
+=
strlenW
(
mask
);
strcpyW
(
str
,
maskBuf
);
l
strcpyW
(
str
,
mask
);
str
+=
l
strlenW
(
mask
);
l
strcpyW
(
str
,
maskBuf
);
}
else
strcpyW
(
str
,
ipAddrBuf
);
l
strcpyW
(
str
,
ipAddrBuf
);
break
;
}
}
...
...
@@ -1394,12 +1393,12 @@ static BOOL CRYPT_FormatAltNameInfo(DWORD dwFormatStrType, DWORD indentLevel,
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
{
sep
=
crlf
;
sepLen
=
strlenW
(
crlf
)
*
sizeof
(
WCHAR
);
sepLen
=
l
strlenW
(
crlf
)
*
sizeof
(
WCHAR
);
}
else
{
sep
=
commaSpace
;
sepLen
=
strlenW
(
commaSpace
)
*
sizeof
(
WCHAR
);
sepLen
=
l
strlenW
(
commaSpace
)
*
sizeof
(
WCHAR
);
}
for
(
i
=
0
;
ret
&&
i
<
name
->
cAltEntry
;
i
++
)
...
...
@@ -1436,7 +1435,7 @@ static BOOL CRYPT_FormatAltNameInfo(DWORD dwFormatStrType, DWORD indentLevel,
str
+=
size
/
sizeof
(
WCHAR
)
-
1
;
if
(
i
<
name
->
cAltEntry
-
1
)
{
strcpyW
(
str
,
sep
);
l
strcpyW
(
str
,
sep
);
str
+=
sepLen
/
sizeof
(
WCHAR
);
}
}
...
...
@@ -1477,16 +1476,16 @@ static BOOL CRYPT_FormatCertIssuer(DWORD dwFormatStrType,
LoadStringW
(
hInstance
,
IDS_CERT_ISSUER
,
buf
,
ARRAY_SIZE
(
buf
));
ret
=
CRYPT_FormatAltNameInfo
(
dwFormatStrType
,
1
,
issuer
,
NULL
,
&
bytesNeeded
);
bytesNeeded
+=
strlenW
(
buf
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
buf
)
*
sizeof
(
WCHAR
);
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
{
sep
=
colonCrlf
;
sepLen
=
strlenW
(
colonCrlf
)
*
sizeof
(
WCHAR
);
sepLen
=
l
strlenW
(
colonCrlf
)
*
sizeof
(
WCHAR
);
}
else
{
sep
=
colonSep
;
sepLen
=
strlenW
(
colonSep
)
*
sizeof
(
WCHAR
);
sepLen
=
l
strlenW
(
colonSep
)
*
sizeof
(
WCHAR
);
}
bytesNeeded
+=
sepLen
;
if
(
ret
)
...
...
@@ -1502,10 +1501,10 @@ static BOOL CRYPT_FormatCertIssuer(DWORD dwFormatStrType,
else
{
*
pcbStr
=
bytesNeeded
;
strcpyW
(
str
,
buf
);
bytesNeeded
-=
strlenW
(
str
)
*
sizeof
(
WCHAR
);
str
+=
strlenW
(
str
);
strcpyW
(
str
,
sep
);
l
strcpyW
(
str
,
buf
);
bytesNeeded
-=
l
strlenW
(
str
)
*
sizeof
(
WCHAR
);
str
+=
l
strlenW
(
str
);
l
strcpyW
(
str
,
sep
);
str
+=
sepLen
/
sizeof
(
WCHAR
);
ret
=
CRYPT_FormatAltNameInfo
(
dwFormatStrType
,
1
,
issuer
,
str
,
&
bytesNeeded
);
...
...
@@ -1539,12 +1538,12 @@ static BOOL WINAPI CRYPT_FormatAuthorityKeyId2(DWORD dwCertEncodingType,
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
{
sep
=
crlf
;
sepLen
=
strlenW
(
crlf
)
*
sizeof
(
WCHAR
);
sepLen
=
l
strlenW
(
crlf
)
*
sizeof
(
WCHAR
);
}
else
{
sep
=
commaSpace
;
sepLen
=
strlenW
(
commaSpace
)
*
sizeof
(
WCHAR
);
sepLen
=
l
strlenW
(
commaSpace
)
*
sizeof
(
WCHAR
);
}
if
(
info
->
KeyId
.
cbData
)
...
...
@@ -1613,7 +1612,7 @@ static BOOL WINAPI CRYPT_FormatAuthorityKeyId2(DWORD dwCertEncodingType,
{
if
(
needSeparator
)
{
strcpyW
(
str
,
sep
);
l
strcpyW
(
str
,
sep
);
str
+=
sepLen
/
sizeof
(
WCHAR
);
}
needSeparator
=
TRUE
;
...
...
@@ -1630,7 +1629,7 @@ static BOOL WINAPI CRYPT_FormatAuthorityKeyId2(DWORD dwCertEncodingType,
{
if
(
needSeparator
)
{
strcpyW
(
str
,
sep
);
l
strcpyW
(
str
,
sep
);
str
+=
sepLen
/
sizeof
(
WCHAR
);
}
/* Overestimate size available, it's already been checked
...
...
@@ -1679,7 +1678,7 @@ static BOOL WINAPI CRYPT_FormatAuthorityInfoAccess(DWORD dwCertEncodingType,
WCHAR
infoNotAvailable
[
MAX_STRING_RESOURCE_LEN
];
LoadStringW
(
hInstance
,
IDS_INFO_NOT_AVAILABLE
,
infoNotAvailable
,
ARRAY_SIZE
(
infoNotAvailable
));
bytesNeeded
+=
strlenW
(
infoNotAvailable
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
infoNotAvailable
)
*
sizeof
(
WCHAR
);
if
(
!
pbFormat
)
*
pcbFormat
=
bytesNeeded
;
else
if
(
*
pcbFormat
<
bytesNeeded
)
...
...
@@ -1691,7 +1690,7 @@ static BOOL WINAPI CRYPT_FormatAuthorityInfoAccess(DWORD dwCertEncodingType,
else
{
*
pcbFormat
=
bytesNeeded
;
strcpyW
(
pbFormat
,
infoNotAvailable
);
l
strcpyW
(
pbFormat
,
infoNotAvailable
);
}
}
else
...
...
@@ -1730,41 +1729,41 @@ static BOOL WINAPI CRYPT_FormatAuthorityInfoAccess(DWORD dwCertEncodingType,
{
/* Heading */
bytesNeeded
+=
sizeof
(
WCHAR
);
/* left bracket */
s
printfW
(
accessDescrNum
,
numFmt
,
i
+
1
);
bytesNeeded
+=
strlenW
(
accessDescrNum
)
*
sizeof
(
WCHAR
);
s
wprintf
(
accessDescrNum
,
ARRAY_SIZE
(
accessDescrNum
)
,
numFmt
,
i
+
1
);
bytesNeeded
+=
l
strlenW
(
accessDescrNum
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
sizeof
(
WCHAR
);
/* right bracket */
bytesNeeded
+=
strlenW
(
aia
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
strlenW
(
headingSep
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
aia
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
headingSep
)
*
sizeof
(
WCHAR
);
/* Access method */
bytesNeeded
+=
strlenW
(
accessMethod
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
accessMethod
)
*
sizeof
(
WCHAR
);
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
bytesNeeded
+=
strlenW
(
indent
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
indent
)
*
sizeof
(
WCHAR
);
if
(
!
strcmp
(
info
->
rgAccDescr
[
i
].
pszAccessMethod
,
szOID_PKIX_OCSP
))
bytesNeeded
+=
strlenW
(
ocsp
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
ocsp
)
*
sizeof
(
WCHAR
);
else
if
(
!
strcmp
(
info
->
rgAccDescr
[
i
].
pszAccessMethod
,
szOID_PKIX_CA_ISSUERS
))
bytesNeeded
+=
strlenW
(
caIssuers
)
*
sizeof
(
caIssuers
);
bytesNeeded
+=
l
strlenW
(
caIssuers
)
*
sizeof
(
caIssuers
);
else
bytesNeeded
+=
strlenW
(
unknown
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
unknown
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
sizeof
(
WCHAR
);
/* space */
bytesNeeded
+=
sizeof
(
WCHAR
);
/* left paren */
bytesNeeded
+=
strlen
(
info
->
rgAccDescr
[
i
].
pszAccessMethod
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
sizeof
(
WCHAR
);
/* right paren */
/* Delimiter between access method and location */
bytesNeeded
+=
strlenW
(
accessMethodSep
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
accessMethodSep
)
*
sizeof
(
WCHAR
);
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
bytesNeeded
+=
strlenW
(
indent
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
strlenW
(
accessLocation
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
strlenW
(
locationSep
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
indent
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
accessLocation
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
locationSep
)
*
sizeof
(
WCHAR
);
ret
=
CRYPT_FormatAltNameEntry
(
dwFormatStrType
,
2
,
&
info
->
rgAccDescr
[
i
].
AccessLocation
,
NULL
,
&
size
);
if
(
ret
)
bytesNeeded
+=
size
-
sizeof
(
WCHAR
);
/* Need extra delimiter between access method entries */
if
(
i
<
info
->
cAccDescr
-
1
)
bytesNeeded
+=
strlenW
(
accessMethodSep
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
accessMethodSep
)
*
sizeof
(
WCHAR
);
}
if
(
ret
)
{
...
...
@@ -1787,37 +1786,37 @@ static BOOL WINAPI CRYPT_FormatAuthorityInfoAccess(DWORD dwCertEncodingType,
LPCSTR
oidPtr
;
*
str
++
=
'['
;
s
printfW
(
accessDescrNum
,
numFmt
,
i
+
1
);
strcpyW
(
str
,
accessDescrNum
);
str
+=
strlenW
(
accessDescrNum
);
s
wprintf
(
accessDescrNum
,
ARRAY_SIZE
(
accessDescrNum
)
,
numFmt
,
i
+
1
);
l
strcpyW
(
str
,
accessDescrNum
);
str
+=
l
strlenW
(
accessDescrNum
);
*
str
++
=
']'
;
strcpyW
(
str
,
aia
);
str
+=
strlenW
(
aia
);
strcpyW
(
str
,
headingSep
);
str
+=
strlenW
(
headingSep
);
l
strcpyW
(
str
,
aia
);
str
+=
l
strlenW
(
aia
);
l
strcpyW
(
str
,
headingSep
);
str
+=
l
strlenW
(
headingSep
);
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
{
strcpyW
(
str
,
indent
);
str
+=
strlenW
(
indent
);
l
strcpyW
(
str
,
indent
);
str
+=
l
strlenW
(
indent
);
}
strcpyW
(
str
,
accessMethod
);
str
+=
strlenW
(
accessMethod
);
l
strcpyW
(
str
,
accessMethod
);
str
+=
l
strlenW
(
accessMethod
);
if
(
!
strcmp
(
info
->
rgAccDescr
[
i
].
pszAccessMethod
,
szOID_PKIX_OCSP
))
{
strcpyW
(
str
,
ocsp
);
str
+=
strlenW
(
ocsp
);
l
strcpyW
(
str
,
ocsp
);
str
+=
l
strlenW
(
ocsp
);
}
else
if
(
!
strcmp
(
info
->
rgAccDescr
[
i
].
pszAccessMethod
,
szOID_PKIX_CA_ISSUERS
))
{
strcpyW
(
str
,
caIssuers
);
str
+=
strlenW
(
caIssuers
);
l
strcpyW
(
str
,
caIssuers
);
str
+=
l
strlenW
(
caIssuers
);
}
else
{
strcpyW
(
str
,
unknown
);
str
+=
strlenW
(
unknown
);
l
strcpyW
(
str
,
unknown
);
str
+=
l
strlenW
(
unknown
);
}
*
str
++
=
' '
;
*
str
++
=
'('
;
...
...
@@ -1825,17 +1824,17 @@ static BOOL WINAPI CRYPT_FormatAuthorityInfoAccess(DWORD dwCertEncodingType,
*
oidPtr
;
oidPtr
++
,
str
++
)
*
str
=
*
oidPtr
;
*
str
++
=
')'
;
strcpyW
(
str
,
accessMethodSep
);
str
+=
strlenW
(
accessMethodSep
);
l
strcpyW
(
str
,
accessMethodSep
);
str
+=
l
strlenW
(
accessMethodSep
);
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
{
strcpyW
(
str
,
indent
);
str
+=
strlenW
(
indent
);
l
strcpyW
(
str
,
indent
);
str
+=
l
strlenW
(
indent
);
}
strcpyW
(
str
,
accessLocation
);
str
+=
strlenW
(
accessLocation
);
strcpyW
(
str
,
locationSep
);
str
+=
strlenW
(
locationSep
);
l
strcpyW
(
str
,
accessLocation
);
str
+=
l
strlenW
(
accessLocation
);
l
strcpyW
(
str
,
locationSep
);
str
+=
l
strlenW
(
locationSep
);
/* This overestimates the size available, but that
* won't matter since we checked earlier whether enough
* space for the entire string was available.
...
...
@@ -1848,8 +1847,8 @@ static BOOL WINAPI CRYPT_FormatAuthorityInfoAccess(DWORD dwCertEncodingType,
str
+=
altNameEntrySize
/
sizeof
(
WCHAR
)
-
1
;
if
(
i
<
info
->
cAccDescr
-
1
)
{
strcpyW
(
str
,
accessMethodSep
);
str
+=
strlenW
(
accessMethodSep
);
l
strcpyW
(
str
,
accessMethodSep
);
str
+=
l
strlenW
(
accessMethodSep
);
}
}
}
...
...
@@ -1910,13 +1909,13 @@ static BOOL CRYPT_FormatReason(DWORD dwFormatStrType,
{
if
(
reasonFlags
->
pbData
[
0
]
&
reason_map
[
i
].
reasonBit
)
{
bytesNeeded
+=
strlenW
(
reason_map
[
i
].
reason
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
reason_map
[
i
].
reason
)
*
sizeof
(
WCHAR
);
if
(
numReasons
++
)
bytesNeeded
+=
strlenW
(
sep
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
sep
)
*
sizeof
(
WCHAR
);
}
}
s
printfW
(
bits
,
bitsFmt
,
reasonFlags
->
pbData
[
0
]);
bytesNeeded
+=
strlenW
(
bits
);
s
wprintf
(
bits
,
ARRAY_SIZE
(
bits
)
,
bitsFmt
,
reasonFlags
->
pbData
[
0
]);
bytesNeeded
+=
l
strlenW
(
bits
);
if
(
!
str
)
*
pcbStr
=
bytesNeeded
;
else
if
(
*
pcbStr
<
bytesNeeded
)
...
...
@@ -1932,16 +1931,16 @@ static BOOL CRYPT_FormatReason(DWORD dwFormatStrType,
{
if
(
reasonFlags
->
pbData
[
0
]
&
reason_map
[
i
].
reasonBit
)
{
strcpyW
(
str
,
reason_map
[
i
].
reason
);
str
+=
strlenW
(
reason_map
[
i
].
reason
);
l
strcpyW
(
str
,
reason_map
[
i
].
reason
);
str
+=
l
strlenW
(
reason_map
[
i
].
reason
);
if
(
i
<
ARRAY_SIZE
(
reason_map
)
-
1
&&
numReasons
)
{
strcpyW
(
str
,
sep
);
str
+=
strlenW
(
sep
);
l
strcpyW
(
str
,
sep
);
str
+=
l
strlenW
(
sep
);
}
}
}
strcpyW
(
str
,
bits
);
l
strcpyW
(
str
,
bits
);
}
return
ret
;
}
...
...
@@ -2007,16 +2006,16 @@ static BOOL WINAPI CRYPT_FormatCRLDistPoints(DWORD dwCertEncodingType,
if
(
distPoint
->
DistPointName
.
dwDistPointNameChoice
!=
CRL_DIST_POINT_NO_NAME
)
{
bytesNeeded
+=
strlenW
(
distPointName
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
strlenW
(
nameSep
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
distPointName
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
nameSep
)
*
sizeof
(
WCHAR
);
if
(
distPoint
->
DistPointName
.
dwDistPointNameChoice
==
CRL_DIST_POINT_FULL_NAME
)
bytesNeeded
+=
strlenW
(
fullName
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
fullName
)
*
sizeof
(
WCHAR
);
else
bytesNeeded
+=
strlenW
(
rdnName
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
strlenW
(
nameSep
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
rdnName
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
nameSep
)
*
sizeof
(
WCHAR
);
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
bytesNeeded
+=
2
*
strlenW
(
indent
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
2
*
l
strlenW
(
indent
)
*
sizeof
(
WCHAR
);
/* The indent level (3) is higher than when used as the issuer,
* because the name is subordinate to the name type (full vs.
* RDN.)
...
...
@@ -2029,7 +2028,7 @@ static BOOL WINAPI CRYPT_FormatCRLDistPoints(DWORD dwCertEncodingType,
}
else
if
(
distPoint
->
ReasonFlags
.
cbData
)
{
bytesNeeded
+=
strlenW
(
reason
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
reason
)
*
sizeof
(
WCHAR
);
ret
=
CRYPT_FormatReason
(
dwFormatStrType
,
&
distPoint
->
ReasonFlags
,
NULL
,
&
size
);
if
(
ret
)
...
...
@@ -2038,8 +2037,8 @@ static BOOL WINAPI CRYPT_FormatCRLDistPoints(DWORD dwCertEncodingType,
}
else
if
(
distPoint
->
CRLIssuer
.
cAltEntry
)
{
bytesNeeded
+=
strlenW
(
issuer
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
strlenW
(
nameSep
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
issuer
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
nameSep
)
*
sizeof
(
WCHAR
);
ret
=
CRYPT_FormatAltNameInfo
(
dwFormatStrType
,
2
,
&
distPoint
->
CRLIssuer
,
NULL
,
&
size
);
if
(
ret
)
...
...
@@ -2049,13 +2048,13 @@ static BOOL WINAPI CRYPT_FormatCRLDistPoints(DWORD dwCertEncodingType,
if
(
haveAnEntry
)
{
bytesNeeded
+=
sizeof
(
WCHAR
);
/* left bracket */
s
printfW
(
distPointNum
,
numFmt
,
i
+
1
);
bytesNeeded
+=
strlenW
(
distPointNum
)
*
sizeof
(
WCHAR
);
s
wprintf
(
distPointNum
,
ARRAY_SIZE
(
distPointNum
)
,
numFmt
,
i
+
1
);
bytesNeeded
+=
l
strlenW
(
distPointNum
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
sizeof
(
WCHAR
);
/* right bracket */
bytesNeeded
+=
strlenW
(
crlDistPoint
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
strlenW
(
headingSep
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
crlDistPoint
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
headingSep
)
*
sizeof
(
WCHAR
);
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
bytesNeeded
+=
strlenW
(
indent
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
indent
)
*
sizeof
(
WCHAR
);
}
}
if
(
!
haveAnEntry
)
...
...
@@ -2063,7 +2062,7 @@ static BOOL WINAPI CRYPT_FormatCRLDistPoints(DWORD dwCertEncodingType,
WCHAR
infoNotAvailable
[
MAX_STRING_RESOURCE_LEN
];
LoadStringW
(
hInstance
,
IDS_INFO_NOT_AVAILABLE
,
infoNotAvailable
,
ARRAY_SIZE
(
infoNotAvailable
));
bytesNeeded
+=
strlenW
(
infoNotAvailable
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
infoNotAvailable
)
*
sizeof
(
WCHAR
);
if
(
!
pbFormat
)
*
pcbFormat
=
bytesNeeded
;
else
if
(
*
pcbFormat
<
bytesNeeded
)
...
...
@@ -2075,7 +2074,7 @@ static BOOL WINAPI CRYPT_FormatCRLDistPoints(DWORD dwCertEncodingType,
else
{
*
pcbFormat
=
bytesNeeded
;
strcpyW
(
pbFormat
,
infoNotAvailable
);
l
strcpyW
(
pbFormat
,
infoNotAvailable
);
}
}
else
...
...
@@ -2098,48 +2097,48 @@ static BOOL WINAPI CRYPT_FormatCRLDistPoints(DWORD dwCertEncodingType,
CRL_DIST_POINT
*
distPoint
=
&
info
->
rgDistPoint
[
i
];
*
str
++
=
'['
;
s
printfW
(
distPointNum
,
numFmt
,
i
+
1
);
strcpyW
(
str
,
distPointNum
);
str
+=
strlenW
(
distPointNum
);
s
wprintf
(
distPointNum
,
ARRAY_SIZE
(
distPointNum
)
,
numFmt
,
i
+
1
);
l
strcpyW
(
str
,
distPointNum
);
str
+=
l
strlenW
(
distPointNum
);
*
str
++
=
']'
;
strcpyW
(
str
,
crlDistPoint
);
str
+=
strlenW
(
crlDistPoint
);
strcpyW
(
str
,
headingSep
);
str
+=
strlenW
(
headingSep
);
l
strcpyW
(
str
,
crlDistPoint
);
str
+=
l
strlenW
(
crlDistPoint
);
l
strcpyW
(
str
,
headingSep
);
str
+=
l
strlenW
(
headingSep
);
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
{
strcpyW
(
str
,
indent
);
str
+=
strlenW
(
indent
);
l
strcpyW
(
str
,
indent
);
str
+=
l
strlenW
(
indent
);
}
if
(
distPoint
->
DistPointName
.
dwDistPointNameChoice
!=
CRL_DIST_POINT_NO_NAME
)
{
DWORD
altNameSize
=
bytesNeeded
;
strcpyW
(
str
,
distPointName
);
str
+=
strlenW
(
distPointName
);
strcpyW
(
str
,
nameSep
);
str
+=
strlenW
(
nameSep
);
l
strcpyW
(
str
,
distPointName
);
str
+=
l
strlenW
(
distPointName
);
l
strcpyW
(
str
,
nameSep
);
str
+=
l
strlenW
(
nameSep
);
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
{
strcpyW
(
str
,
indent
);
str
+=
strlenW
(
indent
);
strcpyW
(
str
,
indent
);
str
+=
strlenW
(
indent
);
l
strcpyW
(
str
,
indent
);
str
+=
l
strlenW
(
indent
);
l
strcpyW
(
str
,
indent
);
str
+=
l
strlenW
(
indent
);
}
if
(
distPoint
->
DistPointName
.
dwDistPointNameChoice
==
CRL_DIST_POINT_FULL_NAME
)
{
strcpyW
(
str
,
fullName
);
str
+=
strlenW
(
fullName
);
l
strcpyW
(
str
,
fullName
);
str
+=
l
strlenW
(
fullName
);
}
else
{
strcpyW
(
str
,
rdnName
);
str
+=
strlenW
(
rdnName
);
l
strcpyW
(
str
,
rdnName
);
str
+=
l
strlenW
(
rdnName
);
}
strcpyW
(
str
,
nameSep
);
str
+=
strlenW
(
nameSep
);
l
strcpyW
(
str
,
nameSep
);
str
+=
l
strlenW
(
nameSep
);
ret
=
CRYPT_FormatAltNameInfo
(
dwFormatStrType
,
3
,
&
distPoint
->
DistPointName
.
u
.
FullName
,
str
,
&
altNameSize
);
...
...
@@ -2150,8 +2149,8 @@ static BOOL WINAPI CRYPT_FormatCRLDistPoints(DWORD dwCertEncodingType,
{
DWORD
reasonSize
=
bytesNeeded
;
strcpyW
(
str
,
reason
);
str
+=
strlenW
(
reason
);
l
strcpyW
(
str
,
reason
);
str
+=
l
strlenW
(
reason
);
ret
=
CRYPT_FormatReason
(
dwFormatStrType
,
&
distPoint
->
ReasonFlags
,
str
,
&
reasonSize
);
if
(
ret
)
...
...
@@ -2161,10 +2160,10 @@ static BOOL WINAPI CRYPT_FormatCRLDistPoints(DWORD dwCertEncodingType,
{
DWORD
crlIssuerSize
=
bytesNeeded
;
strcpyW
(
str
,
issuer
);
str
+=
strlenW
(
issuer
);
strcpyW
(
str
,
nameSep
);
str
+=
strlenW
(
nameSep
);
l
strcpyW
(
str
,
issuer
);
str
+=
l
strlenW
(
issuer
);
l
strcpyW
(
str
,
nameSep
);
str
+=
l
strlenW
(
nameSep
);
ret
=
CRYPT_FormatAltNameInfo
(
dwFormatStrType
,
2
,
&
distPoint
->
CRLIssuer
,
str
,
&
crlIssuerSize
);
...
...
@@ -2205,12 +2204,12 @@ static BOOL WINAPI CRYPT_FormatEnhancedKeyUsage(DWORD dwCertEncodingType,
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
{
sep
=
crlf
;
sepLen
=
strlenW
(
crlf
)
*
sizeof
(
WCHAR
);
sepLen
=
l
strlenW
(
crlf
)
*
sizeof
(
WCHAR
);
}
else
{
sep
=
commaSpace
;
sepLen
=
strlenW
(
commaSpace
)
*
sizeof
(
WCHAR
);
sepLen
=
l
strlenW
(
commaSpace
)
*
sizeof
(
WCHAR
);
}
LoadStringW
(
hInstance
,
IDS_USAGE_UNKNOWN
,
unknown
,
ARRAY_SIZE
(
unknown
));
...
...
@@ -2220,9 +2219,9 @@ static BOOL WINAPI CRYPT_FormatEnhancedKeyUsage(DWORD dwCertEncodingType,
usage
->
rgpszUsageIdentifier
[
i
],
CRYPT_ENHKEY_USAGE_OID_GROUP_ID
);
if
(
info
)
bytesNeeded
+=
strlenW
(
info
->
pwszName
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
info
->
pwszName
)
*
sizeof
(
WCHAR
);
else
bytesNeeded
+=
strlenW
(
unknown
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
unknown
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
sizeof
(
WCHAR
);
/* space */
bytesNeeded
+=
sizeof
(
WCHAR
);
/* left paren */
bytesNeeded
+=
strlen
(
usage
->
rgpszUsageIdentifier
[
i
])
*
...
...
@@ -2253,13 +2252,13 @@ static BOOL WINAPI CRYPT_FormatEnhancedKeyUsage(DWORD dwCertEncodingType,
if
(
info
)
{
strcpyW
(
str
,
info
->
pwszName
);
str
+=
strlenW
(
info
->
pwszName
);
l
strcpyW
(
str
,
info
->
pwszName
);
str
+=
l
strlenW
(
info
->
pwszName
);
}
else
{
strcpyW
(
str
,
unknown
);
str
+=
strlenW
(
unknown
);
l
strcpyW
(
str
,
unknown
);
str
+=
l
strlenW
(
unknown
);
}
*
str
++
=
' '
;
*
str
++
=
'('
;
...
...
@@ -2269,7 +2268,7 @@ static BOOL WINAPI CRYPT_FormatEnhancedKeyUsage(DWORD dwCertEncodingType,
*
str
=
0
;
if
(
i
<
usage
->
cUsageIdentifier
-
1
)
{
strcpyW
(
str
,
sep
);
l
strcpyW
(
str
,
sep
);
str
+=
sepLen
/
sizeof
(
WCHAR
);
}
}
...
...
@@ -2312,7 +2311,7 @@ static BOOL WINAPI CRYPT_FormatNetscapeCertType(DWORD dwCertEncodingType,
LoadStringW
(
hInstance
,
IDS_INFO_NOT_AVAILABLE
,
infoNotAvailable
,
ARRAY_SIZE
(
infoNotAvailable
));
if
(
!
bits
->
cbData
||
bits
->
cbData
>
1
)
{
bytesNeeded
+=
strlenW
(
infoNotAvailable
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
infoNotAvailable
)
*
sizeof
(
WCHAR
);
if
(
!
pbFormat
)
*
pcbFormat
=
bytesNeeded
;
else
if
(
*
pcbFormat
<
bytesNeeded
)
...
...
@@ -2326,7 +2325,7 @@ static BOOL WINAPI CRYPT_FormatNetscapeCertType(DWORD dwCertEncodingType,
LPWSTR
str
=
pbFormat
;
*
pcbFormat
=
bytesNeeded
;
strcpyW
(
str
,
infoNotAvailable
);
l
strcpyW
(
str
,
infoNotAvailable
);
}
}
else
...
...
@@ -2424,26 +2423,26 @@ static BOOL WINAPI CRYPT_FormatSpcFinancialCriteria(DWORD dwCertEncodingType,
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
{
sep
=
crlf
;
sepLen
=
strlenW
(
crlf
)
*
sizeof
(
WCHAR
);
sepLen
=
l
strlenW
(
crlf
)
*
sizeof
(
WCHAR
);
}
else
{
sep
=
commaSpace
;
sepLen
=
strlenW
(
commaSpace
)
*
sizeof
(
WCHAR
);
sepLen
=
l
strlenW
(
commaSpace
)
*
sizeof
(
WCHAR
);
}
bytesNeeded
+=
strlenW
(
financialCriteria
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
financialCriteria
)
*
sizeof
(
WCHAR
);
if
(
criteria
.
fFinancialInfoAvailable
)
{
bytesNeeded
+=
strlenW
(
available
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
available
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
sepLen
;
bytesNeeded
+=
strlenW
(
meetsCriteria
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
meetsCriteria
)
*
sizeof
(
WCHAR
);
if
(
criteria
.
fMeetsCriteria
)
bytesNeeded
+=
strlenW
(
yes
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
yes
)
*
sizeof
(
WCHAR
);
else
bytesNeeded
+=
strlenW
(
no
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
no
)
*
sizeof
(
WCHAR
);
}
else
bytesNeeded
+=
strlenW
(
notAvailable
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
l
strlenW
(
notAvailable
)
*
sizeof
(
WCHAR
);
if
(
!
pbFormat
)
*
pcbFormat
=
bytesNeeded
;
else
if
(
*
pcbFormat
<
bytesNeeded
)
...
...
@@ -2457,24 +2456,24 @@ static BOOL WINAPI CRYPT_FormatSpcFinancialCriteria(DWORD dwCertEncodingType,
LPWSTR
str
=
pbFormat
;
*
pcbFormat
=
bytesNeeded
;
strcpyW
(
str
,
financialCriteria
);
str
+=
strlenW
(
financialCriteria
);
l
strcpyW
(
str
,
financialCriteria
);
str
+=
l
strlenW
(
financialCriteria
);
if
(
criteria
.
fFinancialInfoAvailable
)
{
strcpyW
(
str
,
available
);
str
+=
strlenW
(
available
);
strcpyW
(
str
,
sep
);
l
strcpyW
(
str
,
available
);
str
+=
l
strlenW
(
available
);
l
strcpyW
(
str
,
sep
);
str
+=
sepLen
/
sizeof
(
WCHAR
);
strcpyW
(
str
,
meetsCriteria
);
str
+=
strlenW
(
meetsCriteria
);
l
strcpyW
(
str
,
meetsCriteria
);
str
+=
l
strlenW
(
meetsCriteria
);
if
(
criteria
.
fMeetsCriteria
)
strcpyW
(
str
,
yes
);
l
strcpyW
(
str
,
yes
);
else
strcpyW
(
str
,
no
);
l
strcpyW
(
str
,
no
);
}
else
{
strcpyW
(
str
,
notAvailable
);
l
strcpyW
(
str
,
notAvailable
);
}
}
}
...
...
@@ -2511,7 +2510,7 @@ static BOOL WINAPI CRYPT_FormatUnicodeString(DWORD dwCertEncodingType,
LPWSTR
str
=
pbFormat
;
*
pcbFormat
=
value
->
Value
.
cbData
;
strcpyW
(
str
,
(
LPWSTR
)
value
->
Value
.
pbData
);
l
strcpyW
(
str
,
(
LPWSTR
)
value
->
Value
.
pbData
);
}
}
return
ret
;
...
...
dlls/crypt32/oid.c
View file @
03bf2369
...
...
@@ -18,11 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
...
...
@@ -119,7 +117,7 @@ HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR pszFuncName,
EnterCriticalSection
(
&
funcSetCS
);
LIST_FOR_EACH_ENTRY
(
cursor
,
&
funcSets
,
struct
OIDFunctionSet
,
next
)
{
if
(
!
_strnicmp
(
pszFuncName
,
cursor
->
name
,
-
1
))
if
(
!
stricmp
(
pszFuncName
,
cursor
->
name
))
{
ret
=
cursor
;
break
;
...
...
@@ -404,7 +402,7 @@ BOOL WINAPI CryptGetOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet,
if
(
!
IS_INTOID
(
pszOID
))
{
if
(
!
IS_INTOID
(
function
->
entry
.
pszOID
)
&&
!
_strnicmp
(
function
->
entry
.
pszOID
,
pszOID
,
-
1
))
!
stricmp
(
function
->
entry
.
pszOID
,
pszOID
))
{
*
ppvFuncAddr
=
function
->
entry
.
pvFuncAddr
;
*
phFuncAddr
=
NULL
;
/* FIXME: what should it be? */
...
...
@@ -1828,7 +1826,7 @@ PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey,
EnterCriticalSection
(
&
oidInfoCS
);
LIST_FOR_EACH_ENTRY
(
info
,
&
oidInfo
,
struct
OIDInfo
,
entry
)
{
if
(
!
lstrcmpW
(
info
->
info
.
pwszName
,
pvKey
)
&&
if
(
!
wcscmp
(
info
->
info
.
pwszName
,
pvKey
)
&&
(
!
dwGroupId
||
info
->
info
.
dwGroupId
==
dwGroupId
))
{
ret
=
&
info
->
info
;
...
...
dlls/crypt32/pfx.c
View file @
03bf2369
...
...
@@ -16,9 +16,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include "windef.h"
...
...
@@ -29,7 +26,6 @@
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
crypt
);
...
...
@@ -111,11 +107,11 @@ static BOOL set_key_prov_info( const void *ctx, HCRYPTPROV prov )
ptr
=
(
WCHAR
*
)(
prov_info
+
1
);
prov_info
->
pwszContainerName
=
ptr
;
strcpyW
(
prov_info
->
pwszContainerName
,
container
);
l
strcpyW
(
prov_info
->
pwszContainerName
,
container
);
ptr
+=
len_container
;
prov_info
->
pwszProvName
=
ptr
;
strcpyW
(
prov_info
->
pwszProvName
,
name
);
l
strcpyW
(
prov_info
->
pwszProvName
,
name
);
size
=
sizeof
(
prov_info
->
dwProvType
);
CryptGetProvParam
(
prov
,
PP_PROVTYPE
,
(
BYTE
*
)
&
prov_info
->
dwProvType
,
&
size
,
0
);
...
...
dlls/crypt32/regstore.c
View file @
03bf2369
...
...
@@ -132,7 +132,7 @@ static void CRYPT_RegReadSerializedFromReg(HKEY key, DWORD contextType,
TRACE
(
"comparing %s
\n
"
,
debugstr_w
(
asciiHash
));
TRACE
(
"with %s
\n
"
,
debugstr_w
(
subKeyName
));
if
(
!
lstrcmpW
(
asciiHash
,
subKeyName
))
if
(
!
wcscmp
(
asciiHash
,
subKeyName
))
{
TRACE
(
"hash matches, adding
\n
"
);
contextInterface
->
addContextToStore
(
...
...
dlls/crypt32/rootstore.c
View file @
03bf2369
...
...
@@ -15,25 +15,9 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#include <fcntl.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <errno.h>
#include <limits.h>
#ifdef HAVE_SECURITY_SECURITY_H
#include <Security/Security.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
...
...
dlls/crypt32/serialize.c
View file @
03bf2369
...
...
@@ -16,9 +16,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
...
...
dlls/crypt32/store.c
View file @
03bf2369
...
...
@@ -23,9 +23,6 @@
* - Many flags, options and whatnot are unimplemented.
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <stdarg.h>
#include "windef.h"
...
...
@@ -874,19 +871,19 @@ HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider,
FIXME
(
"unimplemented type %d
\n
"
,
LOWORD
(
lpszStoreProvider
));
}
}
else
if
(
!
_strnicmp
(
lpszStoreProvider
,
sz_CERT_STORE_PROV_MEMORY
,
-
1
))
else
if
(
!
stricmp
(
lpszStoreProvider
,
sz_CERT_STORE_PROV_MEMORY
))
openFunc
=
CRYPT_MemOpenStore
;
else
if
(
!
_strnicmp
(
lpszStoreProvider
,
sz_CERT_STORE_PROV_FILENAME_W
,
-
1
))
else
if
(
!
stricmp
(
lpszStoreProvider
,
sz_CERT_STORE_PROV_FILENAME_W
))
openFunc
=
CRYPT_FileOpenStore
;
else
if
(
!
_strnicmp
(
lpszStoreProvider
,
sz_CERT_STORE_PROV_SYSTEM
,
-
1
))
else
if
(
!
stricmp
(
lpszStoreProvider
,
sz_CERT_STORE_PROV_SYSTEM
))
openFunc
=
CRYPT_SysOpenStoreW
;
else
if
(
!
_strnicmp
(
lpszStoreProvider
,
sz_CERT_STORE_PROV_PKCS7
,
-
1
))
else
if
(
!
stricmp
(
lpszStoreProvider
,
sz_CERT_STORE_PROV_PKCS7
))
openFunc
=
CRYPT_PKCSOpenStore
;
else
if
(
!
_strnicmp
(
lpszStoreProvider
,
sz_CERT_STORE_PROV_SERIALIZED
,
-
1
))
else
if
(
!
stricmp
(
lpszStoreProvider
,
sz_CERT_STORE_PROV_SERIALIZED
))
openFunc
=
CRYPT_SerializedOpenStore
;
else
if
(
!
_strnicmp
(
lpszStoreProvider
,
sz_CERT_STORE_PROV_COLLECTION
,
-
1
))
else
if
(
!
stricmp
(
lpszStoreProvider
,
sz_CERT_STORE_PROV_COLLECTION
))
openFunc
=
CRYPT_CollectionOpenStore
;
else
if
(
!
_strnicmp
(
lpszStoreProvider
,
sz_CERT_STORE_PROV_SYSTEM_REGISTRY
,
-
1
))
else
if
(
!
stricmp
(
lpszStoreProvider
,
sz_CERT_STORE_PROV_SYSTEM_REGISTRY
))
openFunc
=
CRYPT_SysRegOpenStoreW
;
else
{
...
...
dlls/crypt32/str.c
View file @
03bf2369
...
...
@@ -25,7 +25,6 @@
#include "winuser.h"
#include "wincrypt.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "crypt32_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
crypt
);
...
...
@@ -233,10 +232,10 @@ static DWORD quote_rdn_value_to_str_a(DWORD dwValueType,
case
CERT_RDN_UTF8_STRING
:
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
(
LPCWSTR
)
pValue
->
pbData
,
pValue
->
cbData
/
sizeof
(
WCHAR
),
NULL
,
0
,
NULL
,
NULL
);
if
(
pValue
->
cbData
&&
is
spaceW
(((
LPCWSTR
)
pValue
->
pbData
)[
0
]))
if
(
pValue
->
cbData
&&
is
wspace
(((
LPCWSTR
)
pValue
->
pbData
)[
0
]))
needsQuotes
=
TRUE
;
if
(
pValue
->
cbData
&&
is
spaceW
(((
LPCWSTR
)
pValue
->
pbData
)[
pValue
->
cbData
/
sizeof
(
WCHAR
)
-
1
]))
is
wspace
(((
LPCWSTR
)
pValue
->
pbData
)[
pValue
->
cbData
/
sizeof
(
WCHAR
)
-
1
]))
needsQuotes
=
TRUE
;
for
(
i
=
0
;
i
<
pValue
->
cbData
/
sizeof
(
WCHAR
);
i
++
)
{
...
...
@@ -561,7 +560,7 @@ static DWORD CRYPT_AddPrefixW(LPCWSTR prefix, LPWSTR psz, DWORD csz)
if
(
psz
)
{
chars
=
min
(
strlenW
(
prefix
),
csz
);
chars
=
min
(
l
strlenW
(
prefix
),
csz
);
memcpy
(
psz
,
prefix
,
chars
*
sizeof
(
WCHAR
));
*
(
psz
+
chars
)
=
'='
;
chars
++
;
...
...
@@ -643,11 +642,11 @@ DWORD cert_name_to_str_with_indent(DWORD dwCertEncodingType, DWORD indentLevel,
{
if
(
psz
)
{
chars
=
min
(
strlenW
(
indent
),
csz
-
ret
-
1
);
chars
=
min
(
l
strlenW
(
indent
),
csz
-
ret
-
1
);
memcpy
(
psz
+
ret
,
indent
,
chars
*
sizeof
(
WCHAR
));
}
else
chars
=
strlenW
(
indent
);
chars
=
l
strlenW
(
indent
);
ret
+=
chars
;
}
}
...
...
@@ -812,14 +811,14 @@ static BOOL CRYPT_GetNextKeyW(LPCWSTR str, struct X500TokenW *token,
{
BOOL
ret
=
TRUE
;
while
(
*
str
&&
is
spaceW
(
*
str
))
while
(
*
str
&&
is
wspace
(
*
str
))
str
++
;
if
(
*
str
)
{
token
->
start
=
str
;
while
(
*
str
&&
*
str
!=
'='
&&
!
is
spaceW
(
*
str
))
while
(
*
str
&&
*
str
!=
'='
&&
!
is
wspace
(
*
str
))
str
++
;
if
(
*
str
&&
(
*
str
==
'='
||
is
spaceW
(
*
str
)))
if
(
*
str
&&
(
*
str
==
'='
||
is
wspace
(
*
str
)))
token
->
end
=
str
;
else
{
...
...
@@ -845,7 +844,7 @@ static BOOL CRYPT_GetNextValueW(LPCWSTR str, DWORD dwFlags, LPCWSTR separators,
ppszError
);
*
separator_used
=
0
;
while
(
*
str
&&
is
spaceW
(
*
str
))
while
(
*
str
&&
is
wspace
(
*
str
))
str
++
;
if
(
*
str
)
{
...
...
@@ -1059,7 +1058,7 @@ BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
else
{
str
=
token
.
end
;
while
(
is
spaceW
(
*
str
))
while
(
is
wspace
(
*
str
))
str
++
;
if
(
*
str
!=
'='
)
{
...
...
@@ -1260,10 +1259,10 @@ DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType,
if
(
entry
)
{
if
(
!
pszNameString
)
ret
=
strlenW
(
entry
->
u
.
pwszRfc822Name
)
+
1
;
ret
=
l
strlenW
(
entry
->
u
.
pwszRfc822Name
)
+
1
;
else
if
(
cchNameString
)
{
ret
=
min
(
strlenW
(
entry
->
u
.
pwszRfc822Name
),
cchNameString
-
1
);
ret
=
min
(
l
strlenW
(
entry
->
u
.
pwszRfc822Name
),
cchNameString
-
1
);
memcpy
(
pszNameString
,
entry
->
u
.
pwszRfc822Name
,
ret
*
sizeof
(
WCHAR
));
pszNameString
[
ret
++
]
=
0
;
...
...
@@ -1347,10 +1346,10 @@ DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType,
if
(
entry
)
{
if
(
!
pszNameString
)
ret
=
strlenW
(
entry
->
u
.
pwszRfc822Name
)
+
1
;
ret
=
l
strlenW
(
entry
->
u
.
pwszRfc822Name
)
+
1
;
else
if
(
cchNameString
)
{
ret
=
min
(
strlenW
(
entry
->
u
.
pwszRfc822Name
),
ret
=
min
(
l
strlenW
(
entry
->
u
.
pwszRfc822Name
),
cchNameString
-
1
);
memcpy
(
pszNameString
,
entry
->
u
.
pwszRfc822Name
,
ret
*
sizeof
(
WCHAR
));
...
...
@@ -1384,10 +1383,10 @@ DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType,
if
(
entry
)
{
if
(
!
pszNameString
)
ret
=
strlenW
(
entry
->
u
.
pwszDNSName
)
+
1
;
ret
=
l
strlenW
(
entry
->
u
.
pwszDNSName
)
+
1
;
else
if
(
cchNameString
)
{
ret
=
min
(
strlenW
(
entry
->
u
.
pwszDNSName
),
cchNameString
-
1
);
ret
=
min
(
l
strlenW
(
entry
->
u
.
pwszDNSName
),
cchNameString
-
1
);
memcpy
(
pszNameString
,
entry
->
u
.
pwszDNSName
,
ret
*
sizeof
(
WCHAR
));
pszNameString
[
ret
++
]
=
0
;
}
...
...
@@ -1408,10 +1407,10 @@ DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType,
if
(
entry
)
{
if
(
!
pszNameString
)
ret
=
strlenW
(
entry
->
u
.
pwszURL
)
+
1
;
ret
=
l
strlenW
(
entry
->
u
.
pwszURL
)
+
1
;
else
if
(
cchNameString
)
{
ret
=
min
(
strlenW
(
entry
->
u
.
pwszURL
),
cchNameString
-
1
);
ret
=
min
(
l
strlenW
(
entry
->
u
.
pwszURL
),
cchNameString
-
1
);
memcpy
(
pszNameString
,
entry
->
u
.
pwszURL
,
ret
*
sizeof
(
WCHAR
));
pszNameString
[
ret
++
]
=
0
;
}
...
...
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