mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 04:39:45 +00:00
crypt32: CertGetPublicKeyLength should check only cert encoding type.
pktextract calls CertGetPublicKeyLength with dwCertEncodingType of X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, MSDN explicitly allows it.
This commit is contained in:
parent
8fa3b6871f
commit
8d4d7b267d
@ -809,7 +809,7 @@ DWORD WINAPI CertGetPublicKeyLength(DWORD dwCertEncodingType,
|
||||
|
||||
TRACE("(%08x, %p)\n", dwCertEncodingType, pPublicKey);
|
||||
|
||||
if (dwCertEncodingType != X509_ASN_ENCODING)
|
||||
if (GET_CERT_ENCODING_TYPE(dwCertEncodingType) != X509_ASN_ENCODING)
|
||||
{
|
||||
SetLastError(ERROR_FILE_NOT_FOUND);
|
||||
return 0;
|
||||
|
@ -2958,6 +2958,11 @@ static void testGetPublicKeyLength(void)
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = CertGetPublicKeyLength(X509_ASN_ENCODING, &info);
|
||||
ok(ret == 56, "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);
|
||||
}
|
||||
|
||||
START_TEST(cert)
|
||||
|
Loading…
Reference in New Issue
Block a user