crypt32: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
bd59aa6d66
commit
03bf236961
|
@ -6,6 +6,8 @@ DELAYIMPORTS = cryptnet
|
|||
EXTRALIBS = $(SECURITY_LIBS)
|
||||
EXTRAINCL = $(GNUTLS_CFLAGS)
|
||||
|
||||
EXTRADLLFLAGS = -mno-cygwin
|
||||
|
||||
C_SRCS = \
|
||||
base64.c \
|
||||
cert.c \
|
||||
|
|
|
@ -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)) * lstrlenW(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);
|
||||
lstrcpyW(ptr, sep);
|
||||
ptr += lstrlenW(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);
|
||||
lstrcpyW(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) + lstrlenW(sep);
|
||||
if (trailer)
|
||||
charsNeeded += strlenW(trailer) + strlenW(sep);
|
||||
charsNeeded += lstrlenW(trailer) + lstrlenW(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);
|
||||
lstrcpyW(ptr, header);
|
||||
ptr += lstrlenW(ptr);
|
||||
lstrcpyW(ptr, sep);
|
||||
ptr += lstrlenW(sep);
|
||||
}
|
||||
encodeBase64W(pbBinary, cbBinary, sep, ptr, &size);
|
||||
ptr += size - 1;
|
||||
if (trailer)
|
||||
{
|
||||
strcpyW(ptr, trailer);
|
||||
ptr += strlenW(ptr);
|
||||
strcpyW(ptr, sep);
|
||||
lstrcpyW(ptr, trailer);
|
||||
ptr += lstrlenW(ptr);
|
||||
lstrcpyW(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) + lstrlenW(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 + lstrlenW(header);
|
||||
if (!(dataBegins = wcsstr(dataBegins, CERT_DELIMITER_W)))
|
||||
{
|
||||
return ERROR_INVALID_DATA;
|
||||
}
|
||||
dataBegins += strlenW(CERT_DELIMITER_W);
|
||||
dataBegins += lstrlenW(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 = lstrlenW(pszString);
|
||||
ret = decoder(pszString, cchString, pbBinary, pcbBinary, pdwSkip, pdwFlags);
|
||||
if (ret)
|
||||
SetLastError(ret);
|
||||
|
|
|
@ -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((lstrlenW(containerW) + 1) * sizeof(WCHAR));
|
||||
if (keyProvInfo->pwszContainerName)
|
||||
{
|
||||
strcpyW(keyProvInfo->pwszContainerName, containerW);
|
||||
lstrcpyW(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 = lstrlenW(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)),
|
||||
|
|
|
@ -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 + lstrlenW(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 = tolowerW(*allowed_ptr) == tolowerW(*server_ptr);
|
||||
matches = towlower(*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 = lstrlenW(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 + lstrlenW(ptr);
|
||||
len = end - ptr;
|
||||
if (len >= 255)
|
||||
{
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 = lstrlenW(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 = lstrlenW(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 = lstrlenW(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 isalnumW(wc) || isspaceW(wc) || wc == '\'' || wc == '(' ||
|
||||
return iswalnum(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 = lstrlenW(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 = lstrlenW(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 = lstrlenW(str);
|
||||
else
|
||||
strLen = 0;
|
||||
CRYPT_EncodeLen(strLen * 4, NULL, &lenBytes);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 += sprintfW(ptr, fmt, pbEncoded[i]);
|
||||
ptr += swprintf(ptr, 4, fmt, pbEncoded[i]);
|
||||
else
|
||||
ptr += sprintfW(ptr, endFmt, pbEncoded[i]);
|
||||
ptr += swprintf(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 += lstrlenW(commaSpace) * sizeof(WCHAR);
|
||||
localFirst = FALSE;
|
||||
bytesNeeded += strlenW(map[i].str) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(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);
|
||||
lstrcpyW(str, commaSpace);
|
||||
str += lstrlenW(commaSpace);
|
||||
}
|
||||
localFirst = FALSE;
|
||||
strcpyW(str, map[i].str);
|
||||
str += strlenW(map[i].str);
|
||||
lstrcpyW(str, map[i].str);
|
||||
str += lstrlenW(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 += lstrlenW(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);
|
||||
lstrcpyW(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 = lstrlenW(crlf) * sizeof(WCHAR);
|
||||
}
|
||||
else
|
||||
{
|
||||
sep = commaSpace;
|
||||
sepLen = strlenW(commaSpace) * sizeof(WCHAR);
|
||||
sepLen = lstrlenW(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 += lstrlenW(subjectTypeHeader) * sizeof(WCHAR);
|
||||
if (info->fCA)
|
||||
subjectType = subjectTypeCA;
|
||||
else
|
||||
subjectType = subjectTypeEndCert;
|
||||
bytesNeeded += strlenW(subjectType) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(subjectType) * sizeof(WCHAR);
|
||||
bytesNeeded += sepLen;
|
||||
bytesNeeded += strlenW(pathLengthHeader) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(pathLengthHeader) * sizeof(WCHAR);
|
||||
if (info->fPathLenConstraint)
|
||||
sprintfW(pathLength, pathFmt, info->dwPathLenConstraint);
|
||||
swprintf(pathLength, ARRAY_SIZE(pathLength), pathFmt, info->dwPathLenConstraint);
|
||||
else
|
||||
LoadStringW(hInstance, IDS_PATH_LENGTH_NONE, pathLength, ARRAY_SIZE(pathLength));
|
||||
bytesNeeded += strlenW(pathLength) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(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);
|
||||
lstrcpyW(str, subjectTypeHeader);
|
||||
str += lstrlenW(subjectTypeHeader);
|
||||
lstrcpyW(str, subjectType);
|
||||
str += lstrlenW(subjectType);
|
||||
lstrcpyW(str, sep);
|
||||
str += sepLen / sizeof(WCHAR);
|
||||
strcpyW(str, pathLengthHeader);
|
||||
str += strlenW(pathLengthHeader);
|
||||
strcpyW(str, pathLength);
|
||||
lstrcpyW(str, pathLengthHeader);
|
||||
str += lstrlenW(pathLengthHeader);
|
||||
lstrcpyW(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 += lstrlenW(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);
|
||||
lstrcpyW(str, buf);
|
||||
str += lstrlenW(str);
|
||||
bytesNeeded -= lstrlenW(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 * lstrlenW(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 += lstrlenW(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 += lstrlenW(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 += lstrlenW(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 += lstrlenW(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);
|
||||
sprintfW(ipAddrBuf, ipAddrFmt,
|
||||
bytesNeeded += lstrlenW(mask) * sizeof(WCHAR);
|
||||
swprintf(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 += lstrlenW(ipAddrBuf) * sizeof(WCHAR);
|
||||
/* indent again, for the mask line */
|
||||
bytesNeeded += indentLevel * strlenW(indent) * sizeof(WCHAR);
|
||||
sprintfW(maskBuf, ipAddrFmt,
|
||||
bytesNeeded += indentLevel * lstrlenW(indent) * sizeof(WCHAR);
|
||||
swprintf(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 += lstrlenW(maskBuf) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(crlf) * sizeof(WCHAR);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintfW(ipAddrBuf, ipAddrWithMaskFmt,
|
||||
swprintf(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 += (lstrlenW(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 += lstrlenW(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);
|
||||
lstrcpyW(str, indent);
|
||||
str += lstrlenW(indent);
|
||||
}
|
||||
}
|
||||
strcpyW(str, buf);
|
||||
str += strlenW(str);
|
||||
lstrcpyW(str, buf);
|
||||
str += lstrlenW(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);
|
||||
lstrcpyW(str, entry->u.pwszURL);
|
||||
break;
|
||||
case CERT_ALT_NAME_DIRECTORY_NAME:
|
||||
if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE)
|
||||
{
|
||||
strcpyW(str, colonCrlf);
|
||||
str += strlenW(colonCrlf);
|
||||
lstrcpyW(str, colonCrlf);
|
||||
str += lstrlenW(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);
|
||||
lstrcpyW(str, ipAddrBuf);
|
||||
str += lstrlenW(ipAddrBuf);
|
||||
lstrcpyW(str, crlf);
|
||||
str += lstrlenW(crlf);
|
||||
if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE)
|
||||
{
|
||||
for (i = 0; i < indentLevel; i++)
|
||||
{
|
||||
strcpyW(str, indent);
|
||||
str += strlenW(indent);
|
||||
lstrcpyW(str, indent);
|
||||
str += lstrlenW(indent);
|
||||
}
|
||||
}
|
||||
strcpyW(str, mask);
|
||||
str += strlenW(mask);
|
||||
strcpyW(str, maskBuf);
|
||||
lstrcpyW(str, mask);
|
||||
str += lstrlenW(mask);
|
||||
lstrcpyW(str, maskBuf);
|
||||
}
|
||||
else
|
||||
strcpyW(str, ipAddrBuf);
|
||||
lstrcpyW(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 = lstrlenW(crlf) * sizeof(WCHAR);
|
||||
}
|
||||
else
|
||||
{
|
||||
sep = commaSpace;
|
||||
sepLen = strlenW(commaSpace) * sizeof(WCHAR);
|
||||
sepLen = lstrlenW(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);
|
||||
lstrcpyW(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 += lstrlenW(buf) * sizeof(WCHAR);
|
||||
if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE)
|
||||
{
|
||||
sep = colonCrlf;
|
||||
sepLen = strlenW(colonCrlf) * sizeof(WCHAR);
|
||||
sepLen = lstrlenW(colonCrlf) * sizeof(WCHAR);
|
||||
}
|
||||
else
|
||||
{
|
||||
sep = colonSep;
|
||||
sepLen = strlenW(colonSep) * sizeof(WCHAR);
|
||||
sepLen = lstrlenW(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);
|
||||
lstrcpyW(str, buf);
|
||||
bytesNeeded -= lstrlenW(str) * sizeof(WCHAR);
|
||||
str += lstrlenW(str);
|
||||
lstrcpyW(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 = lstrlenW(crlf) * sizeof(WCHAR);
|
||||
}
|
||||
else
|
||||
{
|
||||
sep = commaSpace;
|
||||
sepLen = strlenW(commaSpace) * sizeof(WCHAR);
|
||||
sepLen = lstrlenW(commaSpace) * sizeof(WCHAR);
|
||||
}
|
||||
|
||||
if (info->KeyId.cbData)
|
||||
|
@ -1613,7 +1612,7 @@ static BOOL WINAPI CRYPT_FormatAuthorityKeyId2(DWORD dwCertEncodingType,
|
|||
{
|
||||
if (needSeparator)
|
||||
{
|
||||
strcpyW(str, sep);
|
||||
lstrcpyW(str, sep);
|
||||
str += sepLen / sizeof(WCHAR);
|
||||
}
|
||||
needSeparator = TRUE;
|
||||
|
@ -1630,7 +1629,7 @@ static BOOL WINAPI CRYPT_FormatAuthorityKeyId2(DWORD dwCertEncodingType,
|
|||
{
|
||||
if (needSeparator)
|
||||
{
|
||||
strcpyW(str, sep);
|
||||
lstrcpyW(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 += lstrlenW(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);
|
||||
lstrcpyW(pbFormat, infoNotAvailable);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1730,41 +1729,41 @@ static BOOL WINAPI CRYPT_FormatAuthorityInfoAccess(DWORD dwCertEncodingType,
|
|||
{
|
||||
/* Heading */
|
||||
bytesNeeded += sizeof(WCHAR); /* left bracket */
|
||||
sprintfW(accessDescrNum, numFmt, i + 1);
|
||||
bytesNeeded += strlenW(accessDescrNum) * sizeof(WCHAR);
|
||||
swprintf(accessDescrNum, ARRAY_SIZE(accessDescrNum), numFmt, i + 1);
|
||||
bytesNeeded += lstrlenW(accessDescrNum) * sizeof(WCHAR);
|
||||
bytesNeeded += sizeof(WCHAR); /* right bracket */
|
||||
bytesNeeded += strlenW(aia) * sizeof(WCHAR);
|
||||
bytesNeeded += strlenW(headingSep) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(aia) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(headingSep) * sizeof(WCHAR);
|
||||
/* Access method */
|
||||
bytesNeeded += strlenW(accessMethod) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(accessMethod) * sizeof(WCHAR);
|
||||
if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE)
|
||||
bytesNeeded += strlenW(indent) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(indent) * sizeof(WCHAR);
|
||||
if (!strcmp(info->rgAccDescr[i].pszAccessMethod,
|
||||
szOID_PKIX_OCSP))
|
||||
bytesNeeded += strlenW(ocsp) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(ocsp) * sizeof(WCHAR);
|
||||
else if (!strcmp(info->rgAccDescr[i].pszAccessMethod,
|
||||
szOID_PKIX_CA_ISSUERS))
|
||||
bytesNeeded += strlenW(caIssuers) * sizeof(caIssuers);
|
||||
bytesNeeded += lstrlenW(caIssuers) * sizeof(caIssuers);
|
||||
else
|
||||
bytesNeeded += strlenW(unknown) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(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 += lstrlenW(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 += lstrlenW(indent) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(accessLocation) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(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 += lstrlenW(accessMethodSep) * sizeof(WCHAR);
|
||||
}
|
||||
if (ret)
|
||||
{
|
||||
|
@ -1787,37 +1786,37 @@ static BOOL WINAPI CRYPT_FormatAuthorityInfoAccess(DWORD dwCertEncodingType,
|
|||
LPCSTR oidPtr;
|
||||
|
||||
*str++ = '[';
|
||||
sprintfW(accessDescrNum, numFmt, i + 1);
|
||||
strcpyW(str, accessDescrNum);
|
||||
str += strlenW(accessDescrNum);
|
||||
swprintf(accessDescrNum, ARRAY_SIZE(accessDescrNum), numFmt, i + 1);
|
||||
lstrcpyW(str, accessDescrNum);
|
||||
str += lstrlenW(accessDescrNum);
|
||||
*str++ = ']';
|
||||
strcpyW(str, aia);
|
||||
str += strlenW(aia);
|
||||
strcpyW(str, headingSep);
|
||||
str += strlenW(headingSep);
|
||||
lstrcpyW(str, aia);
|
||||
str += lstrlenW(aia);
|
||||
lstrcpyW(str, headingSep);
|
||||
str += lstrlenW(headingSep);
|
||||
if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE)
|
||||
{
|
||||
strcpyW(str, indent);
|
||||
str += strlenW(indent);
|
||||
lstrcpyW(str, indent);
|
||||
str += lstrlenW(indent);
|
||||
}
|
||||
strcpyW(str, accessMethod);
|
||||
str += strlenW(accessMethod);
|
||||
lstrcpyW(str, accessMethod);
|
||||
str += lstrlenW(accessMethod);
|
||||
if (!strcmp(info->rgAccDescr[i].pszAccessMethod,
|
||||
szOID_PKIX_OCSP))
|
||||
{
|
||||
strcpyW(str, ocsp);
|
||||
str += strlenW(ocsp);
|
||||
lstrcpyW(str, ocsp);
|
||||
str += lstrlenW(ocsp);
|
||||
}
|
||||
else if (!strcmp(info->rgAccDescr[i].pszAccessMethod,
|
||||
szOID_PKIX_CA_ISSUERS))
|
||||
{
|
||||
strcpyW(str, caIssuers);
|
||||
str += strlenW(caIssuers);
|
||||
lstrcpyW(str, caIssuers);
|
||||
str += lstrlenW(caIssuers);
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpyW(str, unknown);
|
||||
str += strlenW(unknown);
|
||||
lstrcpyW(str, unknown);
|
||||
str += lstrlenW(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);
|
||||
lstrcpyW(str, accessMethodSep);
|
||||
str += lstrlenW(accessMethodSep);
|
||||
if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE)
|
||||
{
|
||||
strcpyW(str, indent);
|
||||
str += strlenW(indent);
|
||||
lstrcpyW(str, indent);
|
||||
str += lstrlenW(indent);
|
||||
}
|
||||
strcpyW(str, accessLocation);
|
||||
str += strlenW(accessLocation);
|
||||
strcpyW(str, locationSep);
|
||||
str += strlenW(locationSep);
|
||||
lstrcpyW(str, accessLocation);
|
||||
str += lstrlenW(accessLocation);
|
||||
lstrcpyW(str, locationSep);
|
||||
str += lstrlenW(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);
|
||||
lstrcpyW(str, accessMethodSep);
|
||||
str += lstrlenW(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 += lstrlenW(reason_map[i].reason) * sizeof(WCHAR);
|
||||
if (numReasons++)
|
||||
bytesNeeded += strlenW(sep) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(sep) * sizeof(WCHAR);
|
||||
}
|
||||
}
|
||||
sprintfW(bits, bitsFmt, reasonFlags->pbData[0]);
|
||||
bytesNeeded += strlenW(bits);
|
||||
swprintf(bits, ARRAY_SIZE(bits), bitsFmt, reasonFlags->pbData[0]);
|
||||
bytesNeeded += lstrlenW(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);
|
||||
lstrcpyW(str, reason_map[i].reason);
|
||||
str += lstrlenW(reason_map[i].reason);
|
||||
if (i < ARRAY_SIZE(reason_map) - 1 && numReasons)
|
||||
{
|
||||
strcpyW(str, sep);
|
||||
str += strlenW(sep);
|
||||
lstrcpyW(str, sep);
|
||||
str += lstrlenW(sep);
|
||||
}
|
||||
}
|
||||
}
|
||||
strcpyW(str, bits);
|
||||
lstrcpyW(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 += lstrlenW(distPointName) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(nameSep) * sizeof(WCHAR);
|
||||
if (distPoint->DistPointName.dwDistPointNameChoice ==
|
||||
CRL_DIST_POINT_FULL_NAME)
|
||||
bytesNeeded += strlenW(fullName) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(fullName) * sizeof(WCHAR);
|
||||
else
|
||||
bytesNeeded += strlenW(rdnName) * sizeof(WCHAR);
|
||||
bytesNeeded += strlenW(nameSep) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(rdnName) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(nameSep) * sizeof(WCHAR);
|
||||
if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE)
|
||||
bytesNeeded += 2 * strlenW(indent) * sizeof(WCHAR);
|
||||
bytesNeeded += 2 * lstrlenW(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 += lstrlenW(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 += lstrlenW(issuer) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(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 */
|
||||
sprintfW(distPointNum, numFmt, i + 1);
|
||||
bytesNeeded += strlenW(distPointNum) * sizeof(WCHAR);
|
||||
swprintf(distPointNum, ARRAY_SIZE(distPointNum), numFmt, i + 1);
|
||||
bytesNeeded += lstrlenW(distPointNum) * sizeof(WCHAR);
|
||||
bytesNeeded += sizeof(WCHAR); /* right bracket */
|
||||
bytesNeeded += strlenW(crlDistPoint) * sizeof(WCHAR);
|
||||
bytesNeeded += strlenW(headingSep) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(crlDistPoint) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(headingSep) * sizeof(WCHAR);
|
||||
if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE)
|
||||
bytesNeeded += strlenW(indent) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(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 += lstrlenW(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);
|
||||
lstrcpyW(pbFormat, infoNotAvailable);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2098,48 +2097,48 @@ static BOOL WINAPI CRYPT_FormatCRLDistPoints(DWORD dwCertEncodingType,
|
|||
CRL_DIST_POINT *distPoint = &info->rgDistPoint[i];
|
||||
|
||||
*str++ = '[';
|
||||
sprintfW(distPointNum, numFmt, i + 1);
|
||||
strcpyW(str, distPointNum);
|
||||
str += strlenW(distPointNum);
|
||||
swprintf(distPointNum, ARRAY_SIZE(distPointNum), numFmt, i + 1);
|
||||
lstrcpyW(str, distPointNum);
|
||||
str += lstrlenW(distPointNum);
|
||||
*str++ = ']';
|
||||
strcpyW(str, crlDistPoint);
|
||||
str += strlenW(crlDistPoint);
|
||||
strcpyW(str, headingSep);
|
||||
str += strlenW(headingSep);
|
||||
lstrcpyW(str, crlDistPoint);
|
||||
str += lstrlenW(crlDistPoint);
|
||||
lstrcpyW(str, headingSep);
|
||||
str += lstrlenW(headingSep);
|
||||
if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE)
|
||||
{
|
||||
strcpyW(str, indent);
|
||||
str += strlenW(indent);
|
||||
lstrcpyW(str, indent);
|
||||
str += lstrlenW(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);
|
||||
lstrcpyW(str, distPointName);
|
||||
str += lstrlenW(distPointName);
|
||||
lstrcpyW(str, nameSep);
|
||||
str += lstrlenW(nameSep);
|
||||
if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE)
|
||||
{
|
||||
strcpyW(str, indent);
|
||||
str += strlenW(indent);
|
||||
strcpyW(str, indent);
|
||||
str += strlenW(indent);
|
||||
lstrcpyW(str, indent);
|
||||
str += lstrlenW(indent);
|
||||
lstrcpyW(str, indent);
|
||||
str += lstrlenW(indent);
|
||||
}
|
||||
if (distPoint->DistPointName.dwDistPointNameChoice ==
|
||||
CRL_DIST_POINT_FULL_NAME)
|
||||
{
|
||||
strcpyW(str, fullName);
|
||||
str += strlenW(fullName);
|
||||
lstrcpyW(str, fullName);
|
||||
str += lstrlenW(fullName);
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpyW(str, rdnName);
|
||||
str += strlenW(rdnName);
|
||||
lstrcpyW(str, rdnName);
|
||||
str += lstrlenW(rdnName);
|
||||
}
|
||||
strcpyW(str, nameSep);
|
||||
str += strlenW(nameSep);
|
||||
lstrcpyW(str, nameSep);
|
||||
str += lstrlenW(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);
|
||||
lstrcpyW(str, reason);
|
||||
str += lstrlenW(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);
|
||||
lstrcpyW(str, issuer);
|
||||
str += lstrlenW(issuer);
|
||||
lstrcpyW(str, nameSep);
|
||||
str += lstrlenW(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 = lstrlenW(crlf) * sizeof(WCHAR);
|
||||
}
|
||||
else
|
||||
{
|
||||
sep = commaSpace;
|
||||
sepLen = strlenW(commaSpace) * sizeof(WCHAR);
|
||||
sepLen = lstrlenW(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 += lstrlenW(info->pwszName) * sizeof(WCHAR);
|
||||
else
|
||||
bytesNeeded += strlenW(unknown) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(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);
|
||||
lstrcpyW(str, info->pwszName);
|
||||
str += lstrlenW(info->pwszName);
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpyW(str, unknown);
|
||||
str += strlenW(unknown);
|
||||
lstrcpyW(str, unknown);
|
||||
str += lstrlenW(unknown);
|
||||
}
|
||||
*str++ = ' ';
|
||||
*str++ = '(';
|
||||
|
@ -2269,7 +2268,7 @@ static BOOL WINAPI CRYPT_FormatEnhancedKeyUsage(DWORD dwCertEncodingType,
|
|||
*str = 0;
|
||||
if (i < usage->cUsageIdentifier - 1)
|
||||
{
|
||||
strcpyW(str, sep);
|
||||
lstrcpyW(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 += lstrlenW(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);
|
||||
lstrcpyW(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 = lstrlenW(crlf) * sizeof(WCHAR);
|
||||
}
|
||||
else
|
||||
{
|
||||
sep = commaSpace;
|
||||
sepLen = strlenW(commaSpace) * sizeof(WCHAR);
|
||||
sepLen = lstrlenW(commaSpace) * sizeof(WCHAR);
|
||||
}
|
||||
bytesNeeded += strlenW(financialCriteria) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(financialCriteria) * sizeof(WCHAR);
|
||||
if (criteria.fFinancialInfoAvailable)
|
||||
{
|
||||
bytesNeeded += strlenW(available) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(available) * sizeof(WCHAR);
|
||||
bytesNeeded += sepLen;
|
||||
bytesNeeded += strlenW(meetsCriteria) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(meetsCriteria) * sizeof(WCHAR);
|
||||
if (criteria.fMeetsCriteria)
|
||||
bytesNeeded += strlenW(yes) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(yes) * sizeof(WCHAR);
|
||||
else
|
||||
bytesNeeded += strlenW(no) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(no) * sizeof(WCHAR);
|
||||
}
|
||||
else
|
||||
bytesNeeded += strlenW(notAvailable) * sizeof(WCHAR);
|
||||
bytesNeeded += lstrlenW(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);
|
||||
lstrcpyW(str, financialCriteria);
|
||||
str += lstrlenW(financialCriteria);
|
||||
if (criteria.fFinancialInfoAvailable)
|
||||
{
|
||||
strcpyW(str, available);
|
||||
str += strlenW(available);
|
||||
strcpyW(str, sep);
|
||||
lstrcpyW(str, available);
|
||||
str += lstrlenW(available);
|
||||
lstrcpyW(str, sep);
|
||||
str += sepLen / sizeof(WCHAR);
|
||||
strcpyW(str, meetsCriteria);
|
||||
str += strlenW(meetsCriteria);
|
||||
lstrcpyW(str, meetsCriteria);
|
||||
str += lstrlenW(meetsCriteria);
|
||||
if (criteria.fMeetsCriteria)
|
||||
strcpyW(str, yes);
|
||||
lstrcpyW(str, yes);
|
||||
else
|
||||
strcpyW(str, no);
|
||||
lstrcpyW(str, no);
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpyW(str, notAvailable);
|
||||
lstrcpyW(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);
|
||||
lstrcpyW(str, (LPWSTR)value->Value.pbData);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 );
|
||||
lstrcpyW( prov_info->pwszContainerName, container );
|
||||
|
||||
ptr += len_container;
|
||||
prov_info->pwszProvName = ptr;
|
||||
strcpyW( prov_info->pwszProvName, name );
|
||||
lstrcpyW( prov_info->pwszProvName, name );
|
||||
|
||||
size = sizeof(prov_info->dwProvType);
|
||||
CryptGetProvParam( prov, PP_PROVTYPE, (BYTE *)&prov_info->dwProvType, &size, 0 );
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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 && isspaceW(((LPCWSTR)pValue->pbData)[0]))
|
||||
if (pValue->cbData && iswspace(((LPCWSTR)pValue->pbData)[0]))
|
||||
needsQuotes = TRUE;
|
||||
if (pValue->cbData &&
|
||||
isspaceW(((LPCWSTR)pValue->pbData)[pValue->cbData / sizeof(WCHAR)-1]))
|
||||
iswspace(((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(lstrlenW(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(lstrlenW(indent), csz - ret - 1);
|
||||
memcpy(psz + ret, indent, chars * sizeof(WCHAR));
|
||||
}
|
||||
else
|
||||
chars = strlenW(indent);
|
||||
chars = lstrlenW(indent);
|
||||
ret += chars;
|
||||
}
|
||||
}
|
||||
|
@ -812,14 +811,14 @@ static BOOL CRYPT_GetNextKeyW(LPCWSTR str, struct X500TokenW *token,
|
|||
{
|
||||
BOOL ret = TRUE;
|
||||
|
||||
while (*str && isspaceW(*str))
|
||||
while (*str && iswspace(*str))
|
||||
str++;
|
||||
if (*str)
|
||||
{
|
||||
token->start = str;
|
||||
while (*str && *str != '=' && !isspaceW(*str))
|
||||
while (*str && *str != '=' && !iswspace(*str))
|
||||
str++;
|
||||
if (*str && (*str == '=' || isspaceW(*str)))
|
||||
if (*str && (*str == '=' || iswspace(*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 && isspaceW(*str))
|
||||
while (*str && iswspace(*str))
|
||||
str++;
|
||||
if (*str)
|
||||
{
|
||||
|
@ -1059,7 +1058,7 @@ BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
|
|||
else
|
||||
{
|
||||
str = token.end;
|
||||
while (isspaceW(*str))
|
||||
while (iswspace(*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 = lstrlenW(entry->u.pwszRfc822Name) + 1;
|
||||
else if (cchNameString)
|
||||
{
|
||||
ret = min(strlenW(entry->u.pwszRfc822Name), cchNameString - 1);
|
||||
ret = min(lstrlenW(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 = lstrlenW(entry->u.pwszRfc822Name) + 1;
|
||||
else if (cchNameString)
|
||||
{
|
||||
ret = min(strlenW(entry->u.pwszRfc822Name),
|
||||
ret = min(lstrlenW(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 = lstrlenW(entry->u.pwszDNSName) + 1;
|
||||
else if (cchNameString)
|
||||
{
|
||||
ret = min(strlenW(entry->u.pwszDNSName), cchNameString - 1);
|
||||
ret = min(lstrlenW(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 = lstrlenW(entry->u.pwszURL) + 1;
|
||||
else if (cchNameString)
|
||||
{
|
||||
ret = min(strlenW(entry->u.pwszURL), cchNameString - 1);
|
||||
ret = min(lstrlenW(entry->u.pwszURL), cchNameString - 1);
|
||||
memcpy(pszNameString, entry->u.pwszURL, ret * sizeof(WCHAR));
|
||||
pszNameString[ret++] = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue