From d20d4929141bc7a8dc763428f5322c84753c6e67 Mon Sep 17 00:00:00 2001 From: Ge van Geldorp Date: Tue, 15 Sep 2009 20:58:56 +0200 Subject: [PATCH] crypt32/tests: Fix cert test on Win7. --- dlls/crypt32/tests/cert.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/crypt32/tests/cert.c b/dlls/crypt32/tests/cert.c index 415f9c78dd..a989346884 100644 --- a/dlls/crypt32/tests/cert.c +++ b/dlls/crypt32/tests/cert.c @@ -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)