Commit 03bf2369 authored by Alexandre Julliard's avatar Alexandre Julliard

crypt32: Build with msvcrt.

parent bd59aa6d
......@@ -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"
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment