crypt32/tests: Fix cert test on Win7.

This commit is contained in:
Ge van Geldorp 2009-09-15 20:58:56 +02:00 committed by Alexandre Julliard
parent 6fa09d1d22
commit d20d492914
1 changed files with 6 additions and 3 deletions

View File

@ -3143,7 +3143,8 @@ static void testGetPublicKeyLength(void)
ret, GetLastError());
SetLastError(0xdeadbeef);
ret = CertGetPublicKeyLength(X509_ASN_ENCODING, &info);
ok(ret == 56, "Expected length 56, got %d\n", ret);
ok(ret == 56 || broken(ret == 0 && GetLastError() == NTE_BAD_LEN) /* Win7 */,
"Expected length 56, got %d\n", ret);
/* An RSA key with the DH OID */
info.Algorithm.pszObjId = oid_rsa_dh;
SetLastError(0xdeadbeef);
@ -3157,12 +3158,14 @@ static void testGetPublicKeyLength(void)
info.Algorithm.pszObjId = oid_rsa_rsa;
SetLastError(0xdeadbeef);
ret = CertGetPublicKeyLength(X509_ASN_ENCODING, &info);
ok(ret == 56, "Expected length 56, got %d\n", ret);
ok(ret == 56 || broken(ret == 0 && GetLastError() == NTE_BAD_LEN) /* Win7 */,
"Expected length 56, got %d\n", ret);
/* With the RSA OID and a message encoding */
info.Algorithm.pszObjId = oid_rsa_rsa;
SetLastError(0xdeadbeef);
ret = CertGetPublicKeyLength(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, &info);
ok(ret == 56, "Expected length 56, got %d\n", ret);
ok(ret == 56 || broken(ret == 0 && GetLastError() == NTE_BAD_LEN) /* Win7 */,
"Expected length 56, got %d\n", ret);
}
START_TEST(cert)