crypt32: Sign-compare warnings fix.
This commit is contained in:
parent
ab3bf16e1d
commit
610dbbdae5
|
@ -900,7 +900,7 @@ static BOOL CRYPT_AsnEncodeStringCoerce(const CERT_NAME_VALUE *value,
|
||||||
LPCSTR str = (LPCSTR)value->Value.pbData;
|
LPCSTR str = (LPCSTR)value->Value.pbData;
|
||||||
DWORD bytesNeeded, lenBytes, encodedLen;
|
DWORD bytesNeeded, lenBytes, encodedLen;
|
||||||
|
|
||||||
encodedLen = value->Value.cbData ? value->Value.cbData : lstrlenA(str);
|
encodedLen = value->Value.cbData ? value->Value.cbData : strlen(str);
|
||||||
CRYPT_EncodeLen(encodedLen, NULL, &lenBytes);
|
CRYPT_EncodeLen(encodedLen, NULL, &lenBytes);
|
||||||
bytesNeeded = 1 + lenBytes + encodedLen;
|
bytesNeeded = 1 + lenBytes + encodedLen;
|
||||||
if (!pbEncoded)
|
if (!pbEncoded)
|
||||||
|
@ -970,7 +970,7 @@ static BOOL CRYPT_AsnEncodeUTF8String(const CERT_NAME_VALUE *value,
|
||||||
DWORD bytesNeeded, lenBytes, encodedLen, strLen;
|
DWORD bytesNeeded, lenBytes, encodedLen, strLen;
|
||||||
|
|
||||||
strLen = value->Value.cbData ? value->Value.cbData / sizeof(WCHAR) :
|
strLen = value->Value.cbData ? value->Value.cbData / sizeof(WCHAR) :
|
||||||
lstrlenW(str);
|
strlenW(str);
|
||||||
encodedLen = WideCharToMultiByte(CP_UTF8, 0, str, strLen, NULL, 0, NULL,
|
encodedLen = WideCharToMultiByte(CP_UTF8, 0, str, strLen, NULL, 0, NULL,
|
||||||
NULL);
|
NULL);
|
||||||
CRYPT_EncodeLen(encodedLen, NULL, &lenBytes);
|
CRYPT_EncodeLen(encodedLen, NULL, &lenBytes);
|
||||||
|
@ -1830,7 +1830,7 @@ static BOOL CRYPT_AsnEncodeUnicodeStringCoerce(const CERT_NAME_VALUE *value,
|
||||||
DWORD bytesNeeded, lenBytes, encodedLen;
|
DWORD bytesNeeded, lenBytes, encodedLen;
|
||||||
|
|
||||||
encodedLen = value->Value.cbData ? value->Value.cbData / sizeof(WCHAR) :
|
encodedLen = value->Value.cbData ? value->Value.cbData / sizeof(WCHAR) :
|
||||||
lstrlenW(str);
|
strlenW(str);
|
||||||
CRYPT_EncodeLen(encodedLen, NULL, &lenBytes);
|
CRYPT_EncodeLen(encodedLen, NULL, &lenBytes);
|
||||||
bytesNeeded = 1 + lenBytes + encodedLen;
|
bytesNeeded = 1 + lenBytes + encodedLen;
|
||||||
if (!pbEncoded)
|
if (!pbEncoded)
|
||||||
|
@ -1871,7 +1871,7 @@ static BOOL CRYPT_AsnEncodeNumericString(const CERT_NAME_VALUE *value,
|
||||||
DWORD bytesNeeded, lenBytes, encodedLen;
|
DWORD bytesNeeded, lenBytes, encodedLen;
|
||||||
|
|
||||||
encodedLen = value->Value.cbData ? value->Value.cbData / sizeof(WCHAR) :
|
encodedLen = value->Value.cbData ? value->Value.cbData / sizeof(WCHAR) :
|
||||||
lstrlenW(str);
|
strlenW(str);
|
||||||
CRYPT_EncodeLen(encodedLen, NULL, &lenBytes);
|
CRYPT_EncodeLen(encodedLen, NULL, &lenBytes);
|
||||||
bytesNeeded = 1 + lenBytes + encodedLen;
|
bytesNeeded = 1 + lenBytes + encodedLen;
|
||||||
if (!pbEncoded)
|
if (!pbEncoded)
|
||||||
|
@ -1925,7 +1925,7 @@ static BOOL CRYPT_AsnEncodePrintableString(const CERT_NAME_VALUE *value,
|
||||||
DWORD bytesNeeded, lenBytes, encodedLen;
|
DWORD bytesNeeded, lenBytes, encodedLen;
|
||||||
|
|
||||||
encodedLen = value->Value.cbData ? value->Value.cbData / sizeof(WCHAR) :
|
encodedLen = value->Value.cbData ? value->Value.cbData / sizeof(WCHAR) :
|
||||||
lstrlenW(str);
|
strlenW(str);
|
||||||
CRYPT_EncodeLen(encodedLen, NULL, &lenBytes);
|
CRYPT_EncodeLen(encodedLen, NULL, &lenBytes);
|
||||||
bytesNeeded = 1 + lenBytes + encodedLen;
|
bytesNeeded = 1 + lenBytes + encodedLen;
|
||||||
if (!pbEncoded)
|
if (!pbEncoded)
|
||||||
|
@ -1972,7 +1972,7 @@ static BOOL CRYPT_AsnEncodeIA5String(const CERT_NAME_VALUE *value,
|
||||||
DWORD bytesNeeded, lenBytes, encodedLen;
|
DWORD bytesNeeded, lenBytes, encodedLen;
|
||||||
|
|
||||||
encodedLen = value->Value.cbData ? value->Value.cbData / sizeof(WCHAR) :
|
encodedLen = value->Value.cbData ? value->Value.cbData / sizeof(WCHAR) :
|
||||||
lstrlenW(str);
|
strlenW(str);
|
||||||
CRYPT_EncodeLen(encodedLen, NULL, &lenBytes);
|
CRYPT_EncodeLen(encodedLen, NULL, &lenBytes);
|
||||||
bytesNeeded = 1 + lenBytes + encodedLen;
|
bytesNeeded = 1 + lenBytes + encodedLen;
|
||||||
if (!pbEncoded)
|
if (!pbEncoded)
|
||||||
|
@ -2020,7 +2020,7 @@ static BOOL CRYPT_AsnEncodeUniversalString(const CERT_NAME_VALUE *value,
|
||||||
|
|
||||||
/* FIXME: doesn't handle composite characters */
|
/* FIXME: doesn't handle composite characters */
|
||||||
strLen = value->Value.cbData ? value->Value.cbData / sizeof(WCHAR) :
|
strLen = value->Value.cbData ? value->Value.cbData / sizeof(WCHAR) :
|
||||||
lstrlenW(str);
|
strlenW(str);
|
||||||
CRYPT_EncodeLen(strLen * 4, NULL, &lenBytes);
|
CRYPT_EncodeLen(strLen * 4, NULL, &lenBytes);
|
||||||
bytesNeeded = 1 + lenBytes + strLen * 4;
|
bytesNeeded = 1 + lenBytes + strLen * 4;
|
||||||
if (!pbEncoded)
|
if (!pbEncoded)
|
||||||
|
|
|
@ -995,7 +995,7 @@ BOOL WINAPI CryptUnregisterDefaultOIDFunction(DWORD dwEncodingType,
|
||||||
|
|
||||||
static void oid_init_localizednames(HINSTANCE hInstance)
|
static void oid_init_localizednames(HINSTANCE hInstance)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for(i = 0; i < sizeof(LocalizedKeys)/sizeof(LPCWSTR); i++)
|
for(i = 0; i < sizeof(LocalizedKeys)/sizeof(LPCWSTR); i++)
|
||||||
{
|
{
|
||||||
|
@ -1008,7 +1008,7 @@ static void oid_init_localizednames(HINSTANCE hInstance)
|
||||||
*/
|
*/
|
||||||
LPCWSTR WINAPI CryptFindLocalizedName(LPCWSTR pwszCryptName)
|
LPCWSTR WINAPI CryptFindLocalizedName(LPCWSTR pwszCryptName)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for(i = 0; i < sizeof(LocalizedKeys)/sizeof(LPCWSTR); i++)
|
for(i = 0; i < sizeof(LocalizedKeys)/sizeof(LPCWSTR); i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue