Commit 52d6077f authored by Alexandre Julliard's avatar Alexandre Julliard

crypt32/tests: Don't use sizeof in ok() to avoid printf format warnings.

parent 68e4cf4a
...@@ -71,8 +71,7 @@ static void testCryptHashCert(void) ...@@ -71,8 +71,7 @@ static void testCryptHashCert(void)
ret = CryptHashCertificate(0, 0, 0, toHash, sizeof(toHash), NULL, ret = CryptHashCertificate(0, 0, 0, toHash, sizeof(toHash), NULL,
&hashLen); &hashLen);
ok(ret, "CryptHashCertificate failed: %08lx\n", GetLastError()); ok(ret, "CryptHashCertificate failed: %08lx\n", GetLastError());
ok(hashLen == sizeof(hash), ok(hashLen == sizeof(hash), "Got unexpected size of hash %ld\n", hashLen);
"Got unexpected size of hash %ld, expected %d\n", hashLen, sizeof(hash));
/* Test with empty buffer */ /* Test with empty buffer */
ret = CryptHashCertificate(0, 0, 0, NULL, 0, hash, &hashLen); ret = CryptHashCertificate(0, 0, 0, NULL, 0, hash, &hashLen);
ok(ret, "CryptHashCertificate failed: %08lx\n", GetLastError()); ok(ret, "CryptHashCertificate failed: %08lx\n", GetLastError());
...@@ -89,7 +88,7 @@ static const WCHAR cspNameW[] = { 'W','i','n','e','C','r','y','p','t','T','e', ...@@ -89,7 +88,7 @@ static const WCHAR cspNameW[] = { 'W','i','n','e','C','r','y','p','t','T','e',
'm','p',0 }; 'm','p',0 };
static void verifySig(HCRYPTPROV csp, const BYTE *toSign, size_t toSignLen, static void verifySig(HCRYPTPROV csp, const BYTE *toSign, size_t toSignLen,
const BYTE *sig, size_t sigLen) const BYTE *sig, unsigned int sigLen)
{ {
HCRYPTHASH hash; HCRYPTHASH hash;
BOOL ret = CryptCreateHash(csp, CALG_SHA1, 0, 0, &hash); BOOL ret = CryptCreateHash(csp, CALG_SHA1, 0, 0, &hash);
...@@ -451,8 +450,7 @@ static void testKeyUsage(void) ...@@ -451,8 +450,7 @@ static void testKeyUsage(void)
*/ */
ok(GetLastError() == CRYPT_E_NOT_FOUND, ok(GetLastError() == CRYPT_E_NOT_FOUND,
"Expected CRYPT_E_NOT_FOUND, got %08lx\n", GetLastError()); "Expected CRYPT_E_NOT_FOUND, got %08lx\n", GetLastError());
ok(size == sizeof(CERT_ENHKEY_USAGE), "Expected size %d, got %ld\n", ok(size == sizeof(CERT_ENHKEY_USAGE), "Wrong size %ld\n", size);
sizeof(CERT_ENHKEY_USAGE), size);
ret = CertGetEnhancedKeyUsage(context, 0, pUsage, &size); ret = CertGetEnhancedKeyUsage(context, 0, pUsage, &size);
ok(ret, "CertGetEnhancedKeyUsage failed: %08lx\n", GetLastError()); ok(ret, "CertGetEnhancedKeyUsage failed: %08lx\n", GetLastError());
ok(pUsage->cUsageIdentifier == 0, "Expected 0 usages, got %ld\n", ok(pUsage->cUsageIdentifier == 0, "Expected 0 usages, got %ld\n",
......
...@@ -242,8 +242,7 @@ static void test_decodeInt(DWORD dwEncoding) ...@@ -242,8 +242,7 @@ static void test_decodeInt(DWORD dwEncoding)
(BYTE *)ints[i].encoded, ints[i].encoded[1] + 2, (BYTE *)ints[i].encoded, ints[i].encoded[1] + 2,
CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize);
ok(ret, "CryptDecodeObjectEx failed: %ld\n", GetLastError()); ok(ret, "CryptDecodeObjectEx failed: %ld\n", GetLastError());
ok(bufSize == sizeof(int), "Expected size %d, got %ld\n", sizeof(int), ok(bufSize == sizeof(int), "Wrong size %ld\n", bufSize);
bufSize);
ok(buf != NULL, "Expected allocated buffer\n"); ok(buf != NULL, "Expected allocated buffer\n");
if (buf) if (buf)
{ {
...@@ -263,9 +262,7 @@ static void test_decodeInt(DWORD dwEncoding) ...@@ -263,9 +262,7 @@ static void test_decodeInt(DWORD dwEncoding)
(BYTE *)bigInts[i].encoded, bigInts[i].encoded[1] + 2, (BYTE *)bigInts[i].encoded, bigInts[i].encoded[1] + 2,
CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize);
ok(ret, "CryptDecodeObjectEx failed: %ld\n", GetLastError()); ok(ret, "CryptDecodeObjectEx failed: %ld\n", GetLastError());
ok(bufSize >= sizeof(CRYPT_INTEGER_BLOB), ok(bufSize >= sizeof(CRYPT_INTEGER_BLOB), "Wrong size %ld\n", bufSize);
"Expected size at least %d, got %ld\n", sizeof(CRYPT_INTEGER_BLOB),
bufSize);
ok(buf != NULL, "Expected allocated buffer\n"); ok(buf != NULL, "Expected allocated buffer\n");
if (buf) if (buf)
{ {
...@@ -290,9 +287,7 @@ static void test_decodeInt(DWORD dwEncoding) ...@@ -290,9 +287,7 @@ static void test_decodeInt(DWORD dwEncoding)
(BYTE *)bigUInts[i].encoded, bigUInts[i].encoded[1] + 2, (BYTE *)bigUInts[i].encoded, bigUInts[i].encoded[1] + 2,
CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize);
ok(ret, "CryptDecodeObjectEx failed: %ld\n", GetLastError()); ok(ret, "CryptDecodeObjectEx failed: %ld\n", GetLastError());
ok(bufSize >= sizeof(CRYPT_INTEGER_BLOB), ok(bufSize >= sizeof(CRYPT_INTEGER_BLOB), "Wrong size %ld\n", bufSize);
"Expected size at least %d, got %ld\n", sizeof(CRYPT_INTEGER_BLOB),
bufSize);
ok(buf != NULL, "Expected allocated buffer\n"); ok(buf != NULL, "Expected allocated buffer\n");
if (buf) if (buf)
{ {
...@@ -402,8 +397,7 @@ static void test_decodeEnumerated(DWORD dwEncoding) ...@@ -402,8 +397,7 @@ static void test_decodeEnumerated(DWORD dwEncoding)
(BYTE *)&val, &bufSize); (BYTE *)&val, &bufSize);
ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
ok(bufSize == sizeof(int), ok(bufSize == sizeof(int),
"Got unexpected size %ld for enumerated (expected %d)\n", "Got unexpected size %ld for enumerated\n", bufSize);
bufSize, sizeof(int));
ok(val == enums[j].val, "Unexpected value %d, expected %d\n", ok(val == enums[j].val, "Unexpected value %d, expected %d\n",
val, enums[j].val); val, enums[j].val);
} }
...@@ -765,8 +759,7 @@ static void test_encodeName(DWORD dwEncoding) ...@@ -765,8 +759,7 @@ static void test_encodeName(DWORD dwEncoding)
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret) if (ret)
{ {
ok(size == sizeof(encodedRDNAttrs), "Expected size %d, got %ld\n", ok(size == sizeof(encodedRDNAttrs), "Wrong size %ld\n", size);
sizeof(encodedRDNAttrs), size);
ok(!memcmp(buf, encodedRDNAttrs, size), "Unexpected value\n"); ok(!memcmp(buf, encodedRDNAttrs, size), "Unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -851,8 +844,7 @@ static void test_decodeName(DWORD dwEncoding) ...@@ -851,8 +844,7 @@ static void test_decodeName(DWORD dwEncoding)
*/ */
if (buf) if (buf)
{ {
ok(bufSize == sizeof(CERT_NAME_INFO), ok(bufSize == sizeof(CERT_NAME_INFO), "Wrong bufSize %ld\n", bufSize);
"Expected bufSize %d, got %ld\n", sizeof(CERT_NAME_INFO), bufSize);
ok(((CERT_NAME_INFO *)buf)->cRDN == 0, ok(((CERT_NAME_INFO *)buf)->cRDN == 0,
"Expected 0 RDNs in empty info, got %ld\n", "Expected 0 RDNs in empty info, got %ld\n",
((CERT_NAME_INFO *)buf)->cRDN); ((CERT_NAME_INFO *)buf)->cRDN);
...@@ -1022,8 +1014,7 @@ static void test_encodeAltName(DWORD dwEncoding) ...@@ -1022,8 +1014,7 @@ static void test_encodeAltName(DWORD dwEncoding)
CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size);
if (buf) if (buf)
{ {
ok(size == sizeof(emptySequence), "Expected size %d, got %ld\n", ok(size == sizeof(emptySequence), "Wrong size %ld\n", size);
sizeof(emptySequence), size);
ok(!memcmp(buf, emptySequence, size), "Unexpected value\n"); ok(!memcmp(buf, emptySequence, size), "Unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -1040,8 +1031,7 @@ static void test_encodeAltName(DWORD dwEncoding) ...@@ -1040,8 +1031,7 @@ static void test_encodeAltName(DWORD dwEncoding)
CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size);
if (buf) if (buf)
{ {
ok(size == sizeof(emptyURL), "Expected size %d, got %ld\n", ok(size == sizeof(emptyURL), "Wrong size %ld\n", size);
sizeof(emptyURL), size);
ok(!memcmp(buf, emptyURL, size), "Unexpected value\n"); ok(!memcmp(buf, emptyURL, size), "Unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -1051,8 +1041,7 @@ static void test_encodeAltName(DWORD dwEncoding) ...@@ -1051,8 +1041,7 @@ static void test_encodeAltName(DWORD dwEncoding)
CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size);
if (buf) if (buf)
{ {
ok(size == sizeof(encodedURL), "Expected size %d, got %ld\n", ok(size == sizeof(encodedURL), "Wrong size %ld\n", size);
sizeof(encodedURL), size);
ok(!memcmp(buf, encodedURL, size), "Unexpected value\n"); ok(!memcmp(buf, encodedURL, size), "Unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -1083,8 +1072,7 @@ static void test_encodeAltName(DWORD dwEncoding) ...@@ -1083,8 +1072,7 @@ static void test_encodeAltName(DWORD dwEncoding)
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (buf) if (buf)
{ {
ok(size == sizeof(encodedDnsName), "Expected size %d, got %ld\n", ok(size == sizeof(encodedDnsName), "Wrong size %ld\n", size);
sizeof(encodedDnsName), size);
ok(!memcmp(buf, encodedDnsName, size), "Unexpected value\n"); ok(!memcmp(buf, encodedDnsName, size), "Unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -1096,8 +1084,7 @@ static void test_encodeAltName(DWORD dwEncoding) ...@@ -1096,8 +1084,7 @@ static void test_encodeAltName(DWORD dwEncoding)
CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size);
if (buf) if (buf)
{ {
ok(size == sizeof(encodedIPAddr), "Expected size %d, got %ld\n", ok(size == sizeof(encodedIPAddr), "Wrong size %ld\n", size);
sizeof(encodedIPAddr), size);
ok(!memcmp(buf, encodedIPAddr, size), "Unexpected value\n"); ok(!memcmp(buf, encodedIPAddr, size), "Unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -1276,7 +1263,7 @@ static void test_decodeOctets(DWORD dwEncoding) ...@@ -1276,7 +1263,7 @@ static void test_decodeOctets(DWORD dwEncoding)
ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
ok(bufSize >= sizeof(CRYPT_DATA_BLOB) + octets[i].encoded[1], ok(bufSize >= sizeof(CRYPT_DATA_BLOB) + octets[i].encoded[1],
"Expected size >= %d, got %ld\n", "Expected size >= %d, got %ld\n",
sizeof(CRYPT_DATA_BLOB) + octets[i].encoded[1], bufSize); (int)sizeof(CRYPT_DATA_BLOB) + octets[i].encoded[1], bufSize);
ok(buf != NULL, "Expected allocated buffer\n"); ok(buf != NULL, "Expected allocated buffer\n");
if (buf) if (buf)
{ {
...@@ -1391,12 +1378,10 @@ static void test_decodeBits(DWORD dwEncoding) ...@@ -1391,12 +1378,10 @@ static void test_decodeBits(DWORD dwEncoding)
CRYPT_BIT_BLOB *blob; CRYPT_BIT_BLOB *blob;
ok(bufSize >= sizeof(CRYPT_BIT_BLOB) + sizeof(berDecoded), ok(bufSize >= sizeof(CRYPT_BIT_BLOB) + sizeof(berDecoded),
"Got unexpected size %ld, expected >= %d\n", bufSize, "Got unexpected size %ld\n", bufSize);
sizeof(CRYPT_BIT_BLOB) + berDecoded);
blob = (CRYPT_BIT_BLOB *)buf; blob = (CRYPT_BIT_BLOB *)buf;
ok(blob->cbData == sizeof(berDecoded), ok(blob->cbData == sizeof(berDecoded),
"Got unexpected length %ld, expected %d\n", blob->cbData, "Got unexpected length %ld\n", blob->cbData);
sizeof(berDecoded));
if (blob->cbData) if (blob->cbData)
ok(*blob->pbData == berDecoded, "Unexpected value\n"); ok(*blob->pbData == berDecoded, "Unexpected value\n");
LocalFree(buf); LocalFree(buf);
...@@ -1472,8 +1457,7 @@ static void test_encodeBasicConstraints(DWORD dwEncoding) ...@@ -1472,8 +1457,7 @@ static void test_encodeBasicConstraints(DWORD dwEncoding)
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (buf) if (buf)
{ {
ok(bufSize == sizeof(emptyConstraint), "Expected %d bytes, got %ld\n", ok(bufSize == sizeof(emptyConstraint), "Wrong size %ld\n", bufSize);
sizeof(emptyConstraint), bufSize);
ok(!memcmp(buf, emptyConstraint, sizeof(emptyConstraint)), ok(!memcmp(buf, emptyConstraint, sizeof(emptyConstraint)),
"Unexpected value\n"); "Unexpected value\n");
LocalFree(buf); LocalFree(buf);
...@@ -1488,9 +1472,7 @@ static void test_encodeBasicConstraints(DWORD dwEncoding) ...@@ -1488,9 +1472,7 @@ static void test_encodeBasicConstraints(DWORD dwEncoding)
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (buf) if (buf)
{ {
ok(bufSize == sizeof(constraintWithDomainName), ok(bufSize == sizeof(constraintWithDomainName), "Wrong size %ld\n", bufSize);
"Expected %d bytes, got %ld\n", sizeof(constraintWithDomainName),
bufSize);
ok(!memcmp(buf, constraintWithDomainName, ok(!memcmp(buf, constraintWithDomainName,
sizeof(constraintWithDomainName)), "Unexpected value\n"); sizeof(constraintWithDomainName)), "Unexpected value\n");
LocalFree(buf); LocalFree(buf);
...@@ -1585,8 +1567,8 @@ static void test_decodeBasicConstraints(DWORD dwEncoding) ...@@ -1585,8 +1567,8 @@ static void test_decodeBasicConstraints(DWORD dwEncoding)
if (info->cSubtreesConstraint && info->rgSubtreesConstraint) if (info->cSubtreesConstraint && info->rgSubtreesConstraint)
{ {
ok(info->rgSubtreesConstraint[0].cbData == ok(info->rgSubtreesConstraint[0].cbData ==
sizeof(encodedDomainName), "Expected %d bytes, got %ld\n", sizeof(encodedDomainName), "Wrong size %ld\n",
sizeof(encodedDomainName), info->rgSubtreesConstraint[0].cbData); info->rgSubtreesConstraint[0].cbData);
ok(!memcmp(info->rgSubtreesConstraint[0].pbData, encodedDomainName, ok(!memcmp(info->rgSubtreesConstraint[0].pbData, encodedDomainName,
sizeof(encodedDomainName)), "Unexpected value\n"); sizeof(encodedDomainName)), "Unexpected value\n");
} }
...@@ -1753,9 +1735,7 @@ static void test_decodeRsaPublicKey(DWORD dwEncoding) ...@@ -1753,9 +1735,7 @@ static void test_decodeRsaPublicKey(DWORD dwEncoding)
ok(bufSize >= sizeof(BLOBHEADER) + sizeof(RSAPUBKEY) + ok(bufSize >= sizeof(BLOBHEADER) + sizeof(RSAPUBKEY) +
rsaPubKeys[i].decodedModulusLen, rsaPubKeys[i].decodedModulusLen,
"Expected size at least %d, got %ld\n", "Wrong size %ld\n", bufSize);
sizeof(BLOBHEADER) + sizeof(RSAPUBKEY) +
rsaPubKeys[i].decodedModulusLen, bufSize);
ok(hdr->bType == PUBLICKEYBLOB, ok(hdr->bType == PUBLICKEYBLOB,
"Expected type PUBLICKEYBLOB (%d), got %d\n", PUBLICKEYBLOB, "Expected type PUBLICKEYBLOB (%d), got %d\n", PUBLICKEYBLOB,
hdr->bType); hdr->bType);
...@@ -1769,8 +1749,7 @@ static void test_decodeRsaPublicKey(DWORD dwEncoding) ...@@ -1769,8 +1749,7 @@ static void test_decodeRsaPublicKey(DWORD dwEncoding)
ok(rsaPubKey->magic == 0x31415352, ok(rsaPubKey->magic == 0x31415352,
"Expected magic RSA1, got %08lx\n", rsaPubKey->magic); "Expected magic RSA1, got %08lx\n", rsaPubKey->magic);
ok(rsaPubKey->bitlen == rsaPubKeys[i].decodedModulusLen * 8, ok(rsaPubKey->bitlen == rsaPubKeys[i].decodedModulusLen * 8,
"Expected bit len %d, got %ld\n", "Wrong bit len %ld\n", rsaPubKey->bitlen);
rsaPubKeys[i].decodedModulusLen * 8, rsaPubKey->bitlen);
ok(rsaPubKey->pubexp == 65537, "Expected pubexp 65537, got %ld\n", ok(rsaPubKey->pubexp == 65537, "Expected pubexp 65537, got %ld\n",
rsaPubKey->pubexp); rsaPubKey->pubexp);
ok(!memcmp(buf + sizeof(BLOBHEADER) + sizeof(RSAPUBKEY), ok(!memcmp(buf + sizeof(BLOBHEADER) + sizeof(RSAPUBKEY),
...@@ -1813,8 +1792,7 @@ static void test_encodeSequenceOfAny(DWORD dwEncoding) ...@@ -1813,8 +1792,7 @@ static void test_encodeSequenceOfAny(DWORD dwEncoding)
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (buf) if (buf)
{ {
ok(bufSize == sizeof(intSequence), "Expected %d bytes, got %ld\n", ok(bufSize == sizeof(intSequence), "Wrong size %ld\n", bufSize);
sizeof(intSequence), bufSize);
ok(!memcmp(buf, intSequence, intSequence[1] + 2), "Unexpected value\n"); ok(!memcmp(buf, intSequence, intSequence[1] + 2), "Unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -1828,8 +1806,7 @@ static void test_encodeSequenceOfAny(DWORD dwEncoding) ...@@ -1828,8 +1806,7 @@ static void test_encodeSequenceOfAny(DWORD dwEncoding)
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (buf) if (buf)
{ {
ok(bufSize == sizeof(mixedSequence), "Expected %d bytes, got %ld\n", ok(bufSize == sizeof(mixedSequence), "Wrong size %ld\n", bufSize);
sizeof(mixedSequence), bufSize);
ok(!memcmp(buf, mixedSequence, mixedSequence[1] + 2), ok(!memcmp(buf, mixedSequence, mixedSequence[1] + 2),
"Unexpected value\n"); "Unexpected value\n");
LocalFree(buf); LocalFree(buf);
...@@ -1851,8 +1828,7 @@ static void test_decodeSequenceOfAny(DWORD dwEncoding) ...@@ -1851,8 +1828,7 @@ static void test_decodeSequenceOfAny(DWORD dwEncoding)
DWORD i; DWORD i;
ok(seq->cValue == sizeof(ints) / sizeof(ints[0]), ok(seq->cValue == sizeof(ints) / sizeof(ints[0]),
"Expected %d elements, got %ld\n", sizeof(ints) / sizeof(ints[0]), "Wrong elements %ld\n", seq->cValue);
seq->cValue);
for (i = 0; i < min(seq->cValue, sizeof(ints) / sizeof(ints[0])); i++) for (i = 0; i < min(seq->cValue, sizeof(ints) / sizeof(ints[0])); i++)
{ {
ok(seq->rgValue[i].cbData == ints[i].encoded[1] + 2, ok(seq->rgValue[i].cbData == ints[i].encoded[1] + 2,
...@@ -1872,8 +1848,7 @@ static void test_decodeSequenceOfAny(DWORD dwEncoding) ...@@ -1872,8 +1848,7 @@ static void test_decodeSequenceOfAny(DWORD dwEncoding)
CRYPT_SEQUENCE_OF_ANY *seq = (CRYPT_SEQUENCE_OF_ANY *)buf; CRYPT_SEQUENCE_OF_ANY *seq = (CRYPT_SEQUENCE_OF_ANY *)buf;
ok(seq->cValue == sizeof(ints) / sizeof(ints[0]), ok(seq->cValue == sizeof(ints) / sizeof(ints[0]),
"Expected %d elements, got %ld\n", sizeof(ints) / sizeof(ints[0]), "Wrong elements %ld\n", seq->cValue);
seq->cValue);
/* Just check the first element since it's all that changed */ /* Just check the first element since it's all that changed */
ok(seq->rgValue[0].cbData == times[0].encodedTime[1] + 2, ok(seq->rgValue[0].cbData == times[0].encodedTime[1] + 2,
"Expected %d bytes, got %ld\n", times[0].encodedTime[1] + 2, "Expected %d bytes, got %ld\n", times[0].encodedTime[1] + 2,
...@@ -2202,8 +2177,7 @@ static void test_encodeCertToBeSigned(DWORD dwEncoding) ...@@ -2202,8 +2177,7 @@ static void test_encodeCertToBeSigned(DWORD dwEncoding)
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (buf) if (buf)
{ {
ok(size == sizeof(v2Cert), "Expected size %d, got %ld\n", ok(size == sizeof(v2Cert), "Wrong size %ld\n", size);
sizeof(v2Cert), size);
ok(!memcmp(buf, v2Cert, size), "Got unexpected value\n"); ok(!memcmp(buf, v2Cert, size), "Got unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -2214,8 +2188,7 @@ static void test_encodeCertToBeSigned(DWORD dwEncoding) ...@@ -2214,8 +2188,7 @@ static void test_encodeCertToBeSigned(DWORD dwEncoding)
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (buf) if (buf)
{ {
ok(size == sizeof(v3Cert), "Expected size %d, got %ld\n", ok(size == sizeof(v3Cert), "Wrong size %ld\n", size);
sizeof(v3Cert), size);
ok(!memcmp(buf, v3Cert, size), "Got unexpected value\n"); ok(!memcmp(buf, v3Cert, size), "Got unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -2230,8 +2203,7 @@ static void test_encodeCertToBeSigned(DWORD dwEncoding) ...@@ -2230,8 +2203,7 @@ static void test_encodeCertToBeSigned(DWORD dwEncoding)
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (buf) if (buf)
{ {
ok(size == sizeof(v1CertWithConstraints), "Expected size %d, got %ld\n", ok(size == sizeof(v1CertWithConstraints), "Wrong size %ld\n", size);
sizeof(v1CertWithConstraints), size);
ok(!memcmp(buf, v1CertWithConstraints, size), "Got unexpected value\n"); ok(!memcmp(buf, v1CertWithConstraints, size), "Got unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -2242,8 +2214,7 @@ static void test_encodeCertToBeSigned(DWORD dwEncoding) ...@@ -2242,8 +2214,7 @@ static void test_encodeCertToBeSigned(DWORD dwEncoding)
CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size);
if (buf) if (buf)
{ {
ok(size == sizeof(v1CertWithSerial), "Expected size %d, got %ld\n", ok(size == sizeof(v1CertWithSerial), "Wrong size %ld\n", size);
sizeof(v1CertWithSerial), size);
ok(!memcmp(buf, v1CertWithSerial, size), "Got unexpected value\n"); ok(!memcmp(buf, v1CertWithSerial, size), "Got unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -2256,8 +2227,7 @@ static void test_encodeCertToBeSigned(DWORD dwEncoding) ...@@ -2256,8 +2227,7 @@ static void test_encodeCertToBeSigned(DWORD dwEncoding)
CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size);
if (buf) if (buf)
{ {
ok(size == sizeof(bigCert), "Expected size %d, got %ld\n", ok(size == sizeof(bigCert), "Wrong size %ld\n", size);
sizeof(bigCert), size);
ok(!memcmp(buf, bigCert, size), "Got unexpected value\n"); ok(!memcmp(buf, bigCert, size), "Got unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -2303,21 +2273,18 @@ static void test_decodeCertToBeSigned(DWORD dwEncoding) ...@@ -2303,21 +2273,18 @@ static void test_decodeCertToBeSigned(DWORD dwEncoding)
{ {
CERT_INFO *info = (CERT_INFO *)buf; CERT_INFO *info = (CERT_INFO *)buf;
ok(size >= sizeof(CERT_INFO), "Expected size at least %d, got %ld\n", ok(size >= sizeof(CERT_INFO), "Wrong size %ld\n", size);
sizeof(CERT_INFO), size);
ok(info->SerialNumber.cbData == 1, ok(info->SerialNumber.cbData == 1,
"Expected serial number size 1, got %ld\n", info->SerialNumber.cbData); "Expected serial number size 1, got %ld\n", info->SerialNumber.cbData);
ok(*info->SerialNumber.pbData == *serialNum, ok(*info->SerialNumber.pbData == *serialNum,
"Expected serial number %d, got %d\n", *serialNum, "Expected serial number %d, got %d\n", *serialNum,
*info->SerialNumber.pbData); *info->SerialNumber.pbData);
ok(info->Issuer.cbData == sizeof(encodedCommonName), ok(info->Issuer.cbData == sizeof(encodedCommonName),
"Expected issuer of %d bytes, got %ld\n", sizeof(encodedCommonName), "Wrong size %ld\n", info->Issuer.cbData);
info->Issuer.cbData);
ok(!memcmp(info->Issuer.pbData, encodedCommonName, info->Issuer.cbData), ok(!memcmp(info->Issuer.pbData, encodedCommonName, info->Issuer.cbData),
"Unexpected issuer\n"); "Unexpected issuer\n");
ok(info->Subject.cbData == sizeof(encodedCommonName), ok(info->Subject.cbData == sizeof(encodedCommonName),
"Expected subject of %d bytes, got %ld\n", sizeof(encodedCommonName), "Wrong size %ld\n", info->Subject.cbData);
info->Subject.cbData);
ok(!memcmp(info->Subject.pbData, encodedCommonName, ok(!memcmp(info->Subject.pbData, encodedCommonName,
info->Subject.cbData), "Unexpected subject\n"); info->Subject.cbData), "Unexpected subject\n");
LocalFree(buf); LocalFree(buf);
...@@ -2358,8 +2325,7 @@ static void test_encodeCert(DWORD dwEncoding) ...@@ -2358,8 +2325,7 @@ static void test_encodeCert(DWORD dwEncoding)
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (buf) if (buf)
{ {
ok(bufSize == sizeof(signedBigCert), "Expected size %d, got %ld\n", ok(bufSize == sizeof(signedBigCert), "Wrong size %ld\n", bufSize);
sizeof(signedBigCert), bufSize);
ok(!memcmp(buf, signedBigCert, bufSize), "Unexpected cert\n"); ok(!memcmp(buf, signedBigCert, bufSize), "Unexpected cert\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -2379,13 +2345,11 @@ static void test_decodeCert(DWORD dwEncoding) ...@@ -2379,13 +2345,11 @@ static void test_decodeCert(DWORD dwEncoding)
CERT_SIGNED_CONTENT_INFO *info = (CERT_SIGNED_CONTENT_INFO *)buf; CERT_SIGNED_CONTENT_INFO *info = (CERT_SIGNED_CONTENT_INFO *)buf;
ok(info->ToBeSigned.cbData == sizeof(bigCert), ok(info->ToBeSigned.cbData == sizeof(bigCert),
"Expected cert to be %d bytes, got %ld\n", sizeof(bigCert), "Wrong cert size %ld\n", info->ToBeSigned.cbData);
info->ToBeSigned.cbData);
ok(!memcmp(info->ToBeSigned.pbData, bigCert, info->ToBeSigned.cbData), ok(!memcmp(info->ToBeSigned.pbData, bigCert, info->ToBeSigned.cbData),
"Unexpected cert\n"); "Unexpected cert\n");
ok(info->Signature.cbData == sizeof(hash), ok(info->Signature.cbData == sizeof(hash),
"Expected signature size %d, got %ld\n", sizeof(hash), "Wrong signature size %ld\n", info->Signature.cbData);
info->Signature.cbData);
ok(!memcmp(info->Signature.pbData, hash, info->Signature.cbData), ok(!memcmp(info->Signature.pbData, hash, info->Signature.cbData),
"Unexpected signature\n"); "Unexpected signature\n");
LocalFree(buf); LocalFree(buf);
...@@ -2430,8 +2394,7 @@ static void test_encodeCRLDistPoints(DWORD dwEncoding) ...@@ -2430,8 +2394,7 @@ static void test_encodeCRLDistPoints(DWORD dwEncoding)
CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size);
if (buf) if (buf)
{ {
ok(size == sizeof(emptyDistPoint), "Expected size %d, got %ld\n", ok(size == sizeof(emptyDistPoint), "Wrong size %ld\n", size);
sizeof(emptyDistPoint), size);
ok(!memcmp(buf, emptyDistPoint, size), "Unexpected value\n"); ok(!memcmp(buf, emptyDistPoint, size), "Unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -2455,8 +2418,7 @@ static void test_encodeCRLDistPoints(DWORD dwEncoding) ...@@ -2455,8 +2418,7 @@ static void test_encodeCRLDistPoints(DWORD dwEncoding)
CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size);
if (buf) if (buf)
{ {
ok(size == sizeof(distPointWithUrl), "Expected size %d, got %ld\n", ok(size == sizeof(distPointWithUrl), "Wrong size %ld\n", size);
sizeof(distPointWithUrl), size);
ok(!memcmp(buf, distPointWithUrl, size), "Unexpected value\n"); ok(!memcmp(buf, distPointWithUrl, size), "Unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -2468,8 +2430,7 @@ static void test_encodeCRLDistPoints(DWORD dwEncoding) ...@@ -2468,8 +2430,7 @@ static void test_encodeCRLDistPoints(DWORD dwEncoding)
CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size);
if (buf) if (buf)
{ {
ok(size == sizeof(distPointWithReason), "Expected size %d, got %ld\n", ok(size == sizeof(distPointWithReason), "Wrong size %ld\n", size);
sizeof(distPointWithReason), size);
ok(!memcmp(buf, distPointWithReason, size), "Unexpected value\n"); ok(!memcmp(buf, distPointWithReason, size), "Unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -2481,8 +2442,7 @@ static void test_encodeCRLDistPoints(DWORD dwEncoding) ...@@ -2481,8 +2442,7 @@ static void test_encodeCRLDistPoints(DWORD dwEncoding)
CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size);
if (buf) if (buf)
{ {
ok(size == sizeof(distPointWithIssuer), "Expected size %d, got %ld\n", ok(size == sizeof(distPointWithIssuer), "Wrong size %ld\n", size);
sizeof(distPointWithIssuer), size);
ok(!memcmp(buf, distPointWithIssuer, size), "Unexpected value\n"); ok(!memcmp(buf, distPointWithIssuer, size), "Unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -2493,8 +2453,7 @@ static void test_encodeCRLDistPoints(DWORD dwEncoding) ...@@ -2493,8 +2453,7 @@ static void test_encodeCRLDistPoints(DWORD dwEncoding)
if (buf) if (buf)
{ {
ok(size == sizeof(distPointWithUrlAndIssuer), ok(size == sizeof(distPointWithUrlAndIssuer),
"Expected size %d, got %ld\n", sizeof(distPointWithUrlAndIssuer), "Wrong size %ld\n", size);
size);
ok(!memcmp(buf, distPointWithUrlAndIssuer, size), "Unexpected value\n"); ok(!memcmp(buf, distPointWithUrlAndIssuer, size), "Unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -2516,8 +2475,7 @@ static void test_decodeCRLDistPoints(DWORD dwEncoding) ...@@ -2516,8 +2475,7 @@ static void test_decodeCRLDistPoints(DWORD dwEncoding)
{ {
info = (PCRL_DIST_POINTS_INFO)buf; info = (PCRL_DIST_POINTS_INFO)buf;
ok(size >= sizeof(CRL_DIST_POINTS_INFO) + sizeof(CRL_DIST_POINT), ok(size >= sizeof(CRL_DIST_POINTS_INFO) + sizeof(CRL_DIST_POINT),
"Expected size at least %d, got %ld\n", "Wrong size %ld\n", size);
sizeof(CRL_DIST_POINTS_INFO) + sizeof(CRL_DIST_POINT), size);
ok(info->cDistPoint == 1, "Expected 1 dist points, got %ld\n", ok(info->cDistPoint == 1, "Expected 1 dist points, got %ld\n",
info->cDistPoint); info->cDistPoint);
point = info->rgDistPoint; point = info->rgDistPoint;
...@@ -2535,8 +2493,7 @@ static void test_decodeCRLDistPoints(DWORD dwEncoding) ...@@ -2535,8 +2493,7 @@ static void test_decodeCRLDistPoints(DWORD dwEncoding)
{ {
info = (PCRL_DIST_POINTS_INFO)buf; info = (PCRL_DIST_POINTS_INFO)buf;
ok(size >= sizeof(CRL_DIST_POINTS_INFO) + sizeof(CRL_DIST_POINT), ok(size >= sizeof(CRL_DIST_POINTS_INFO) + sizeof(CRL_DIST_POINT),
"Expected size at least %d, got %ld\n", "Wrong size %ld\n", size);
sizeof(CRL_DIST_POINTS_INFO) + sizeof(CRL_DIST_POINT), size);
ok(info->cDistPoint == 1, "Expected 1 dist points, got %ld\n", ok(info->cDistPoint == 1, "Expected 1 dist points, got %ld\n",
info->cDistPoint); info->cDistPoint);
point = info->rgDistPoint; point = info->rgDistPoint;
...@@ -2562,8 +2519,7 @@ static void test_decodeCRLDistPoints(DWORD dwEncoding) ...@@ -2562,8 +2519,7 @@ static void test_decodeCRLDistPoints(DWORD dwEncoding)
{ {
info = (PCRL_DIST_POINTS_INFO)buf; info = (PCRL_DIST_POINTS_INFO)buf;
ok(size >= sizeof(CRL_DIST_POINTS_INFO) + sizeof(CRL_DIST_POINT), ok(size >= sizeof(CRL_DIST_POINTS_INFO) + sizeof(CRL_DIST_POINT),
"Expected size at least %d, got %ld\n", "Wrong size %ld\n", size);
sizeof(CRL_DIST_POINTS_INFO) + sizeof(CRL_DIST_POINT), size);
ok(info->cDistPoint == 1, "Expected 1 dist points, got %ld\n", ok(info->cDistPoint == 1, "Expected 1 dist points, got %ld\n",
info->cDistPoint); info->cDistPoint);
point = info->rgDistPoint; point = info->rgDistPoint;
...@@ -2585,8 +2541,7 @@ static void test_decodeCRLDistPoints(DWORD dwEncoding) ...@@ -2585,8 +2541,7 @@ static void test_decodeCRLDistPoints(DWORD dwEncoding)
{ {
info = (PCRL_DIST_POINTS_INFO)buf; info = (PCRL_DIST_POINTS_INFO)buf;
ok(size >= sizeof(CRL_DIST_POINTS_INFO) + sizeof(CRL_DIST_POINT), ok(size >= sizeof(CRL_DIST_POINTS_INFO) + sizeof(CRL_DIST_POINT),
"Expected size at least %d, got %ld\n", "Wrong size %ld\n", size);
sizeof(CRL_DIST_POINTS_INFO) + sizeof(CRL_DIST_POINT), size);
ok(info->cDistPoint == 1, "Expected 1 dist points, got %ld\n", ok(info->cDistPoint == 1, "Expected 1 dist points, got %ld\n",
info->cDistPoint); info->cDistPoint);
point = info->rgDistPoint; point = info->rgDistPoint;
...@@ -2667,8 +2622,7 @@ static void test_encodeCRLToBeSigned(DWORD dwEncoding) ...@@ -2667,8 +2622,7 @@ static void test_encodeCRLToBeSigned(DWORD dwEncoding)
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (buf) if (buf)
{ {
ok(size == sizeof(v1CRL), "Expected size %d, got %ld\n", ok(size == sizeof(v1CRL), "Wrong size %ld\n", size);
sizeof(v1CRL), size);
ok(!memcmp(buf, v1CRL, size), "Got unexpected value\n"); ok(!memcmp(buf, v1CRL, size), "Got unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -2693,8 +2647,7 @@ static void test_encodeCRLToBeSigned(DWORD dwEncoding) ...@@ -2693,8 +2647,7 @@ static void test_encodeCRLToBeSigned(DWORD dwEncoding)
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (buf) if (buf)
{ {
ok(size == sizeof(v1CRLWithIssuer), "Expected size %d, got %ld\n", ok(size == sizeof(v1CRLWithIssuer), "Wrong size %ld\n", size);
sizeof(v1CRLWithIssuer), size);
ok(!memcmp(buf, v1CRLWithIssuer, size), "Got unexpected value\n"); ok(!memcmp(buf, v1CRLWithIssuer, size), "Got unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -2711,8 +2664,7 @@ static void test_encodeCRLToBeSigned(DWORD dwEncoding) ...@@ -2711,8 +2664,7 @@ static void test_encodeCRLToBeSigned(DWORD dwEncoding)
if (buf) if (buf)
{ {
ok(size == sizeof(v1CRLWithIssuerAndEmptyEntry), ok(size == sizeof(v1CRLWithIssuerAndEmptyEntry),
"Expected size %d, got %ld\n", sizeof(v1CRLWithIssuerAndEmptyEntry), "Wrong size %ld\n", size);
size);
ok(!memcmp(buf, v1CRLWithIssuerAndEmptyEntry, size), ok(!memcmp(buf, v1CRLWithIssuerAndEmptyEntry, size),
"Got unexpected value\n"); "Got unexpected value\n");
LocalFree(buf); LocalFree(buf);
...@@ -2725,7 +2677,7 @@ static void test_encodeCRLToBeSigned(DWORD dwEncoding) ...@@ -2725,7 +2677,7 @@ static void test_encodeCRLToBeSigned(DWORD dwEncoding)
if (buf) if (buf)
{ {
ok(size == sizeof(v1CRLWithIssuerAndEntry), ok(size == sizeof(v1CRLWithIssuerAndEntry),
"Expected size %d, got %ld\n", sizeof(v1CRLWithIssuerAndEntry), size); "Wrong size %ld\n", size);
ok(!memcmp(buf, v1CRLWithIssuerAndEntry, size), ok(!memcmp(buf, v1CRLWithIssuerAndEntry, size),
"Got unexpected value\n"); "Got unexpected value\n");
LocalFree(buf); LocalFree(buf);
...@@ -2738,8 +2690,7 @@ static void test_encodeCRLToBeSigned(DWORD dwEncoding) ...@@ -2738,8 +2690,7 @@ static void test_encodeCRLToBeSigned(DWORD dwEncoding)
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (buf) if (buf)
{ {
ok(size == sizeof(v1CRLWithExt), "Expected size %d, got %ld\n", ok(size == sizeof(v1CRLWithExt), "Wrong size %ld\n", size);
sizeof(v1CRLWithExt), size);
ok(!memcmp(buf, v1CRLWithExt, size), "Got unexpected value\n"); ok(!memcmp(buf, v1CRLWithExt, size), "Got unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -2751,8 +2702,7 @@ static void test_encodeCRLToBeSigned(DWORD dwEncoding) ...@@ -2751,8 +2702,7 @@ static void test_encodeCRLToBeSigned(DWORD dwEncoding)
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (buf) if (buf)
{ {
ok(size == sizeof(v2CRLWithExt), "Expected size %d, got %ld\n", ok(size == sizeof(v2CRLWithExt), "Wrong size %ld\n", size);
sizeof(v2CRLWithExt), size);
ok(!memcmp(buf, v2CRLWithExt, size), "Got unexpected value\n"); ok(!memcmp(buf, v2CRLWithExt, size), "Got unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -2818,13 +2768,11 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding) ...@@ -2818,13 +2768,11 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding)
{ {
CRL_INFO *info = (CRL_INFO *)buf; CRL_INFO *info = (CRL_INFO *)buf;
ok(size >= sizeof(CRL_INFO), "Expected size at least %d, got %ld\n", ok(size >= sizeof(CRL_INFO), "Wrong size %ld\n", size);
sizeof(CRL_INFO), size);
ok(info->cCRLEntry == 0, "Expected 0 CRL entries, got %ld\n", ok(info->cCRLEntry == 0, "Expected 0 CRL entries, got %ld\n",
info->cCRLEntry); info->cCRLEntry);
ok(info->Issuer.cbData == sizeof(encodedCommonName), ok(info->Issuer.cbData == sizeof(encodedCommonName),
"Expected issuer of %d bytes, got %ld\n", sizeof(encodedCommonName), "Wrong issuer size %ld\n", info->Issuer.cbData);
info->Issuer.cbData);
ok(!memcmp(info->Issuer.pbData, encodedCommonName, info->Issuer.cbData), ok(!memcmp(info->Issuer.pbData, encodedCommonName, info->Issuer.cbData),
"Unexpected issuer\n"); "Unexpected issuer\n");
LocalFree(buf); LocalFree(buf);
...@@ -2845,8 +2793,7 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding) ...@@ -2845,8 +2793,7 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding)
CRL_INFO *info = (CRL_INFO *)buf; CRL_INFO *info = (CRL_INFO *)buf;
CRL_ENTRY *entry; CRL_ENTRY *entry;
ok(size >= sizeof(CRL_INFO), "Expected size at least %d, got %ld\n", ok(size >= sizeof(CRL_INFO), "Wrong size %ld\n", size);
sizeof(CRL_INFO), size);
ok(info->cCRLEntry == 1, "Expected 1 CRL entries, got %ld\n", ok(info->cCRLEntry == 1, "Expected 1 CRL entries, got %ld\n",
info->cCRLEntry); info->cCRLEntry);
ok(info->rgCRLEntry != NULL, "Expected a valid CRL entry array\n"); ok(info->rgCRLEntry != NULL, "Expected a valid CRL entry array\n");
...@@ -2858,8 +2805,7 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding) ...@@ -2858,8 +2805,7 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding)
"Expected serial number %d, got %d\n", *serialNum, "Expected serial number %d, got %d\n", *serialNum,
*entry->SerialNumber.pbData); *entry->SerialNumber.pbData);
ok(info->Issuer.cbData == sizeof(encodedCommonName), ok(info->Issuer.cbData == sizeof(encodedCommonName),
"Expected issuer of %d bytes, got %ld\n", sizeof(encodedCommonName), "Wrong issuer size %ld\n", info->Issuer.cbData);
info->Issuer.cbData);
ok(!memcmp(info->Issuer.pbData, encodedCommonName, info->Issuer.cbData), ok(!memcmp(info->Issuer.pbData, encodedCommonName, info->Issuer.cbData),
"Unexpected issuer\n"); "Unexpected issuer\n");
} }
...@@ -2873,8 +2819,7 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding) ...@@ -2873,8 +2819,7 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding)
CRL_INFO *info = (CRL_INFO *)buf; CRL_INFO *info = (CRL_INFO *)buf;
CRL_ENTRY *entry; CRL_ENTRY *entry;
ok(size >= sizeof(CRL_INFO), "Expected size at least %d, got %ld\n", ok(size >= sizeof(CRL_INFO), "Wrong size %ld\n", size);
sizeof(CRL_INFO), size);
ok(info->cCRLEntry == 3, "Expected 3 CRL entries, got %ld\n", ok(info->cCRLEntry == 3, "Expected 3 CRL entries, got %ld\n",
info->cCRLEntry); info->cCRLEntry);
ok(info->rgCRLEntry != NULL, "Expected a valid CRL entry array\n"); ok(info->rgCRLEntry != NULL, "Expected a valid CRL entry array\n");
...@@ -2892,8 +2837,7 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding) ...@@ -2892,8 +2837,7 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding)
CRL_INFO *info = (CRL_INFO *)buf; CRL_INFO *info = (CRL_INFO *)buf;
CRL_ENTRY *entry; CRL_ENTRY *entry;
ok(size >= sizeof(CRL_INFO), "Expected size at least %d, got %ld\n", ok(size >= sizeof(CRL_INFO), "Wrong size %ld\n", size);
sizeof(CRL_INFO), size);
ok(info->cCRLEntry == 1, "Expected 1 CRL entries, got %ld\n", ok(info->cCRLEntry == 1, "Expected 1 CRL entries, got %ld\n",
info->cCRLEntry); info->cCRLEntry);
ok(info->rgCRLEntry != NULL, "Expected a valid CRL entry array\n"); ok(info->rgCRLEntry != NULL, "Expected a valid CRL entry array\n");
...@@ -2905,8 +2849,7 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding) ...@@ -2905,8 +2849,7 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding)
"Expected serial number %d, got %d\n", *serialNum, "Expected serial number %d, got %d\n", *serialNum,
*entry->SerialNumber.pbData); *entry->SerialNumber.pbData);
ok(info->Issuer.cbData == sizeof(encodedCommonName), ok(info->Issuer.cbData == sizeof(encodedCommonName),
"Expected issuer of %d bytes, got %ld\n", sizeof(encodedCommonName), "Wrong issuer size %ld\n", info->Issuer.cbData);
info->Issuer.cbData);
ok(!memcmp(info->Issuer.pbData, encodedCommonName, info->Issuer.cbData), ok(!memcmp(info->Issuer.pbData, encodedCommonName, info->Issuer.cbData),
"Unexpected issuer\n"); "Unexpected issuer\n");
/* Oddly, the extensions don't seem to be decoded. Is this just an MS /* Oddly, the extensions don't seem to be decoded. Is this just an MS
...@@ -2923,8 +2866,7 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding) ...@@ -2923,8 +2866,7 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding)
CRL_INFO *info = (CRL_INFO *)buf; CRL_INFO *info = (CRL_INFO *)buf;
CRL_ENTRY *entry; CRL_ENTRY *entry;
ok(size >= sizeof(CRL_INFO), "Expected size at least %d, got %ld\n", ok(size >= sizeof(CRL_INFO), "Wrong size %ld\n", size);
sizeof(CRL_INFO), size);
ok(info->cCRLEntry == 1, "Expected 1 CRL entries, got %ld\n", ok(info->cCRLEntry == 1, "Expected 1 CRL entries, got %ld\n",
info->cCRLEntry); info->cCRLEntry);
ok(info->rgCRLEntry != NULL, "Expected a valid CRL entry array\n"); ok(info->rgCRLEntry != NULL, "Expected a valid CRL entry array\n");
...@@ -2936,8 +2878,7 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding) ...@@ -2936,8 +2878,7 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding)
"Expected serial number %d, got %d\n", *serialNum, "Expected serial number %d, got %d\n", *serialNum,
*entry->SerialNumber.pbData); *entry->SerialNumber.pbData);
ok(info->Issuer.cbData == sizeof(encodedCommonName), ok(info->Issuer.cbData == sizeof(encodedCommonName),
"Expected issuer of %d bytes, got %ld\n", sizeof(encodedCommonName), "Wrong issuer size %ld\n", info->Issuer.cbData);
info->Issuer.cbData);
ok(!memcmp(info->Issuer.pbData, encodedCommonName, info->Issuer.cbData), ok(!memcmp(info->Issuer.pbData, encodedCommonName, info->Issuer.cbData),
"Unexpected issuer\n"); "Unexpected issuer\n");
/* Oddly, the extensions don't seem to be decoded. Is this just an MS /* Oddly, the extensions don't seem to be decoded. Is this just an MS
...@@ -2970,8 +2911,7 @@ static void test_encodeEnhancedKeyUsage(DWORD dwEncoding) ...@@ -2970,8 +2911,7 @@ static void test_encodeEnhancedKeyUsage(DWORD dwEncoding)
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (buf) if (buf)
{ {
ok(size == sizeof(emptySequence), "Expected size %d, got %ld\n", ok(size == sizeof(emptySequence), "Wrong size %ld\n", size);
sizeof(emptySequence), size);
ok(!memcmp(buf, emptySequence, size), "Got unexpected value\n"); ok(!memcmp(buf, emptySequence, size), "Got unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -2983,8 +2923,7 @@ static void test_encodeEnhancedKeyUsage(DWORD dwEncoding) ...@@ -2983,8 +2923,7 @@ static void test_encodeEnhancedKeyUsage(DWORD dwEncoding)
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError()); ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (buf) if (buf)
{ {
ok(size == sizeof(encodedUsage), "Expected size %d, got %ld\n", ok(size == sizeof(encodedUsage), "Wrong size %ld\n", size);
sizeof(encodedUsage), size);
ok(!memcmp(buf, encodedUsage, size), "Got unexpected value\n"); ok(!memcmp(buf, encodedUsage, size), "Got unexpected value\n");
LocalFree(buf); LocalFree(buf);
} }
...@@ -3005,8 +2944,7 @@ static void test_decodeEnhancedKeyUsage(DWORD dwEncoding) ...@@ -3005,8 +2944,7 @@ static void test_decodeEnhancedKeyUsage(DWORD dwEncoding)
CERT_ENHKEY_USAGE *usage = (CERT_ENHKEY_USAGE *)buf; CERT_ENHKEY_USAGE *usage = (CERT_ENHKEY_USAGE *)buf;
ok(size >= sizeof(CERT_ENHKEY_USAGE), ok(size >= sizeof(CERT_ENHKEY_USAGE),
"Expected size at least %d, got %ld\n", sizeof(CERT_ENHKEY_USAGE), "Wrong size %ld\n", size);
size);
ok(usage->cUsageIdentifier == 0, "Expected 0 CRL entries, got %ld\n", ok(usage->cUsageIdentifier == 0, "Expected 0 CRL entries, got %ld\n",
usage->cUsageIdentifier); usage->cUsageIdentifier);
LocalFree(buf); LocalFree(buf);
...@@ -3021,12 +2959,9 @@ static void test_decodeEnhancedKeyUsage(DWORD dwEncoding) ...@@ -3021,12 +2959,9 @@ static void test_decodeEnhancedKeyUsage(DWORD dwEncoding)
DWORD i; DWORD i;
ok(size >= sizeof(CERT_ENHKEY_USAGE), ok(size >= sizeof(CERT_ENHKEY_USAGE),
"Expected size at least %d, got %ld\n", sizeof(CERT_ENHKEY_USAGE), "Wrong size %ld\n", size);
size);
ok(usage->cUsageIdentifier == sizeof(keyUsages) / sizeof(keyUsages[0]), ok(usage->cUsageIdentifier == sizeof(keyUsages) / sizeof(keyUsages[0]),
"Expected %d CRL entries, got %ld\n", "Wrong CRL entries count %ld\n", usage->cUsageIdentifier);
sizeof(keyUsages) / sizeof(keyUsages[0]),
usage->cUsageIdentifier);
for (i = 0; i < usage->cUsageIdentifier; i++) for (i = 0; i < usage->cUsageIdentifier; i++)
ok(!strcmp(usage->rgpszUsageIdentifier[i], keyUsages[i]), ok(!strcmp(usage->rgpszUsageIdentifier[i], keyUsages[i]),
"Expected OID %s, got %s\n", keyUsages[i], "Expected OID %s, got %s\n", keyUsages[i],
......
...@@ -331,8 +331,7 @@ static void testDupCert(void) ...@@ -331,8 +331,7 @@ static void testDupCert(void)
if (context) if (context)
{ {
ok(context->cbCertEncoded == sizeof(bigCert), ok(context->cbCertEncoded == sizeof(bigCert),
"Expected cert of %d bytes, got %ld\n", sizeof(bigCert), "Wrong cert size %ld\n", context->cbCertEncoded);
context->cbCertEncoded);
ok(!memcmp(context->pbCertEncoded, bigCert, sizeof(bigCert)), ok(!memcmp(context->pbCertEncoded, bigCert, sizeof(bigCert)),
"Unexpected encoded cert in context\n"); "Unexpected encoded cert in context\n");
ok(context->hCertStore == store, "Unexpected store\n"); ok(context->hCertStore == store, "Unexpected store\n");
...@@ -685,8 +684,7 @@ static void testMemStore(void) ...@@ -685,8 +684,7 @@ static void testMemStore(void)
if (context) if (context)
{ {
ok(context->cbCertEncoded == sizeof(signedBigCert), ok(context->cbCertEncoded == sizeof(signedBigCert),
"Expected cert of %d bytes, got %ld\n", sizeof(signedBigCert), "Wrong cert size %ld\n", context->cbCertEncoded);
context->cbCertEncoded);
ok(!memcmp(context->pbCertEncoded, signedBigCert, ok(!memcmp(context->pbCertEncoded, signedBigCert,
sizeof(signedBigCert)), "Unexpected encoded cert in context\n"); sizeof(signedBigCert)), "Unexpected encoded cert in context\n");
/* remove it, the rest of the tests will work on an unsigned cert */ /* remove it, the rest of the tests will work on an unsigned cert */
...@@ -712,8 +710,7 @@ static void testMemStore(void) ...@@ -712,8 +710,7 @@ static void testMemStore(void)
BYTE *buf; BYTE *buf;
ok(context->cbCertEncoded == sizeof(bigCert), ok(context->cbCertEncoded == sizeof(bigCert),
"Expected cert of %d bytes, got %ld\n", sizeof(bigCert), "Wrong cert size %ld\n", context->cbCertEncoded);
context->cbCertEncoded);
ok(!memcmp(context->pbCertEncoded, bigCert, sizeof(bigCert)), ok(!memcmp(context->pbCertEncoded, bigCert, sizeof(bigCert)),
"Unexpected encoded cert in context\n"); "Unexpected encoded cert in context\n");
ok(context->hCertStore == store1, "Unexpected store\n"); ok(context->hCertStore == store1, "Unexpected store\n");
...@@ -732,8 +729,7 @@ static void testMemStore(void) ...@@ -732,8 +729,7 @@ static void testMemStore(void)
if (buf) if (buf)
{ {
ret = CertSerializeCertificateStoreElement(context, 0, buf, &size); ret = CertSerializeCertificateStoreElement(context, 0, buf, &size);
ok(size == sizeof(serializedCert), "Expected size %d, got %ld\n", ok(size == sizeof(serializedCert), "Wrong size %ld\n", size);
sizeof(serializedCert), size);
ok(!memcmp(serializedCert, buf, size), ok(!memcmp(serializedCert, buf, size),
"Unexpected serialized cert\n"); "Unexpected serialized cert\n");
HeapFree(GetProcessHeap(), 0, buf); HeapFree(GetProcessHeap(), 0, buf);
...@@ -800,8 +796,7 @@ static void testMemStore(void) ...@@ -800,8 +796,7 @@ static void testMemStore(void)
if (context) if (context)
{ {
ok(context->cbCertEncoded == sizeof(bigCert), ok(context->cbCertEncoded == sizeof(bigCert),
"Expected cert of %d bytes, got %ld\n", sizeof(bigCert), "Wrong cert size %ld\n", context->cbCertEncoded);
context->cbCertEncoded);
ok(!memcmp(context->pbCertEncoded, bigCert, sizeof(bigCert)), ok(!memcmp(context->pbCertEncoded, bigCert, sizeof(bigCert)),
"Unexpected encoded cert in context\n"); "Unexpected encoded cert in context\n");
ok(context->hCertStore == store1, "Unexpected store\n"); ok(context->hCertStore == store1, "Unexpected store\n");
...@@ -897,8 +892,7 @@ static void testCollectionStore(void) ...@@ -897,8 +892,7 @@ static void testCollectionStore(void)
{ {
ok(context->hCertStore == collection, "Unexpected store\n"); ok(context->hCertStore == collection, "Unexpected store\n");
ok(context->cbCertEncoded == sizeof(bigCert), ok(context->cbCertEncoded == sizeof(bigCert),
"Expected size %d, got %ld\n", sizeof(bigCert), "Wrong size %ld\n", context->cbCertEncoded);
context->cbCertEncoded);
ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded), ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded),
"Unexpected cert\n"); "Unexpected cert\n");
context = CertEnumCertificatesInStore(collection, context); context = CertEnumCertificatesInStore(collection, context);
...@@ -907,8 +901,7 @@ static void testCollectionStore(void) ...@@ -907,8 +901,7 @@ static void testCollectionStore(void)
{ {
ok(context->hCertStore == collection, "Unexpected store\n"); ok(context->hCertStore == collection, "Unexpected store\n");
ok(context->cbCertEncoded == sizeof(bigCert2), ok(context->cbCertEncoded == sizeof(bigCert2),
"Expected size %d, got %ld\n", sizeof(bigCert2), "Wrong size %ld\n", context->cbCertEncoded);
context->cbCertEncoded);
ok(!memcmp(context->pbCertEncoded, bigCert2, ok(!memcmp(context->pbCertEncoded, bigCert2,
context->cbCertEncoded), "Unexpected cert\n"); context->cbCertEncoded), "Unexpected cert\n");
context = CertEnumCertificatesInStore(collection, context); context = CertEnumCertificatesInStore(collection, context);
...@@ -923,8 +916,7 @@ static void testCollectionStore(void) ...@@ -923,8 +916,7 @@ static void testCollectionStore(void)
{ {
ok(context->hCertStore == collection, "Unexpected store\n"); ok(context->hCertStore == collection, "Unexpected store\n");
ok(context->cbCertEncoded == sizeof(bigCert), ok(context->cbCertEncoded == sizeof(bigCert),
"Expected size %d, got %ld\n", sizeof(bigCert), "Wrong size %ld\n", context->cbCertEncoded);
context->cbCertEncoded);
ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded), ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded),
"Unexpected cert\n"); "Unexpected cert\n");
context = CertEnumCertificatesInStore(collection, context); context = CertEnumCertificatesInStore(collection, context);
...@@ -933,8 +925,7 @@ static void testCollectionStore(void) ...@@ -933,8 +925,7 @@ static void testCollectionStore(void)
{ {
ok(context->hCertStore == collection, "Unexpected store\n"); ok(context->hCertStore == collection, "Unexpected store\n");
ok(context->cbCertEncoded == sizeof(bigCert2), ok(context->cbCertEncoded == sizeof(bigCert2),
"Expected size %d, got %ld\n", sizeof(bigCert2), "Wrong size %ld\n", context->cbCertEncoded);
context->cbCertEncoded);
ok(!memcmp(context->pbCertEncoded, bigCert2, ok(!memcmp(context->pbCertEncoded, bigCert2,
context->cbCertEncoded), "Unexpected cert\n"); context->cbCertEncoded), "Unexpected cert\n");
context = CertEnumCertificatesInStore(collection, context); context = CertEnumCertificatesInStore(collection, context);
...@@ -955,8 +946,7 @@ static void testCollectionStore(void) ...@@ -955,8 +946,7 @@ static void testCollectionStore(void)
{ {
ok(context->hCertStore == collection2, "Unexpected store\n"); ok(context->hCertStore == collection2, "Unexpected store\n");
ok(context->cbCertEncoded == sizeof(bigCert), ok(context->cbCertEncoded == sizeof(bigCert),
"Expected size %d, got %ld\n", sizeof(bigCert), "Wrong size %ld\n", context->cbCertEncoded);
context->cbCertEncoded);
ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded), ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded),
"Unexpected cert\n"); "Unexpected cert\n");
context = CertEnumCertificatesInStore(collection2, context); context = CertEnumCertificatesInStore(collection2, context);
...@@ -965,8 +955,7 @@ static void testCollectionStore(void) ...@@ -965,8 +955,7 @@ static void testCollectionStore(void)
{ {
ok(context->hCertStore == collection2, "Unexpected store\n"); ok(context->hCertStore == collection2, "Unexpected store\n");
ok(context->cbCertEncoded == sizeof(bigCert2), ok(context->cbCertEncoded == sizeof(bigCert2),
"Expected size %d, got %ld\n", sizeof(bigCert2), "Wrong size %ld\n", context->cbCertEncoded);
context->cbCertEncoded);
ok(!memcmp(context->pbCertEncoded, bigCert2, ok(!memcmp(context->pbCertEncoded, bigCert2,
context->cbCertEncoded), "Unexpected cert\n"); context->cbCertEncoded), "Unexpected cert\n");
context = CertEnumCertificatesInStore(collection2, context); context = CertEnumCertificatesInStore(collection2, context);
...@@ -1021,8 +1010,7 @@ static void testCollectionStore(void) ...@@ -1021,8 +1010,7 @@ static void testCollectionStore(void)
{ {
ok(context->hCertStore == collection, "Unexpected store\n"); ok(context->hCertStore == collection, "Unexpected store\n");
ok(context->cbCertEncoded == sizeof(bigCert), ok(context->cbCertEncoded == sizeof(bigCert),
"Expected size %d, got %ld\n", sizeof(bigCert), "Wrong size %ld\n", context->cbCertEncoded);
context->cbCertEncoded);
ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded), ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded),
"Unexpected cert\n"); "Unexpected cert\n");
context = CertEnumCertificatesInStore(collection, context); context = CertEnumCertificatesInStore(collection, context);
...@@ -1031,8 +1019,7 @@ static void testCollectionStore(void) ...@@ -1031,8 +1019,7 @@ static void testCollectionStore(void)
{ {
ok(context->hCertStore == collection, "Unexpected store\n"); ok(context->hCertStore == collection, "Unexpected store\n");
ok(context->cbCertEncoded == sizeof(bigCert), ok(context->cbCertEncoded == sizeof(bigCert),
"Expected size %d, got %ld\n", sizeof(bigCert), "Wrong size %ld\n", context->cbCertEncoded);
context->cbCertEncoded);
ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded), ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded),
"Unexpected cert\n"); "Unexpected cert\n");
context = CertEnumCertificatesInStore(collection, context); context = CertEnumCertificatesInStore(collection, context);
...@@ -1072,8 +1059,7 @@ static void testCollectionStore(void) ...@@ -1072,8 +1059,7 @@ static void testCollectionStore(void)
{ {
ok(context->hCertStore == collection, "Unexpected store\n"); ok(context->hCertStore == collection, "Unexpected store\n");
ok(context->cbCertEncoded == sizeof(bigCert), ok(context->cbCertEncoded == sizeof(bigCert),
"Expected size %d, got %ld\n", sizeof(bigCert), "Wrong size %ld\n", context->cbCertEncoded);
context->cbCertEncoded);
ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded), ok(!memcmp(context->pbCertEncoded, bigCert, context->cbCertEncoded),
"Unexpected cert\n"); "Unexpected cert\n");
} }
...@@ -1223,8 +1209,7 @@ static void testRegStore(void) ...@@ -1223,8 +1209,7 @@ static void testRegStore(void)
if (hdr) if (hdr)
{ {
ok(hdr->cb == sizeof(bigCert2), ok(hdr->cb == sizeof(bigCert2),
"Unexpected size %ld of cert property, expected %d\n", "Wrong size %ld of cert property\n", hdr->cb);
hdr->cb, sizeof(bigCert2));
ok(!memcmp((BYTE *)hdr + sizeof(*hdr), bigCert2, ok(!memcmp((BYTE *)hdr + sizeof(*hdr), bigCert2,
hdr->cb), "Unexpected cert in cert property\n"); hdr->cb), "Unexpected cert in cert property\n");
} }
...@@ -1233,8 +1218,7 @@ static void testRegStore(void) ...@@ -1233,8 +1218,7 @@ static void testRegStore(void)
if (hdr) if (hdr)
{ {
ok(hdr->cb == sizeof(hash), ok(hdr->cb == sizeof(hash),
"Unexpected size %ld of hash property, expected %d\n", "Wrong size %ld of hash property\n", hdr->cb);
hdr->cb, sizeof(hash));
ok(!memcmp((BYTE *)hdr + sizeof(*hdr), hash, ok(!memcmp((BYTE *)hdr + sizeof(*hdr), hash,
hdr->cb), "Unexpected hash in cert property\n"); hdr->cb), "Unexpected hash in cert property\n");
} }
......
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