CertGetPublicKeyLength() test failures on Win7

Juan Lang juan.lang at gmail.com
Tue Sep 15 11:10:45 CDT 2009


Hi Ge,

> I see 3 test failures related to CertGetPublicKeyLength() on Win7, crypt32/tests/cert.c lines 3146/3160/3165. All 3 failures are the same, CertGetPublicKeyLength() returns 0 with last error 0x80090004 (NTE_BAD_LEN). After looking at it for a while, I'm inclined to change the condition to ok(ret == 56 || (ok == 0 && GetLastError() == NTE_BAD_LEN), ...). Do you agree that's the correct fix or do I need to dig deeper?

Hm, that's interesting.  I'm certainly curious why that is.  I'd check
whether Win7 can decode the public key.  From our implementation of
CertGetPublicKeyLength():

        BOOL ret = CryptDecodeObjectEx(dwCertEncodingType,
         RSA_CSP_PUBLICKEYBLOB, pPublicKey->PublicKey.pbData,
         pPublicKey->PublicKey.cbData, CRYPT_DECODE_ALLOC_FLAG, NULL, &buf,
         &size);

I expect this is also failing on Win7?
--Juan



More information about the wine-devel mailing list