Commit 4df042b5 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Compare CRL's authority key identifier against the certificate's…

crypt32: Compare CRL's authority key identifier against the certificate's subject key identifier property, which also decodes the certificate's extension if necessary.
parent 1becda46
......@@ -167,14 +167,21 @@ static BOOL compare_crl_issued_by(PCCRL_CONTEXT pCrlContext, DWORD dwType,
}
else if (info->KeyId.cbData)
{
if ((ext = CertFindExtension(
szOID_SUBJECT_KEY_IDENTIFIER,
issuer->pCertInfo->cExtension,
issuer->pCertInfo->rgExtension)))
DWORD size;
ret = CertGetCertificateContextProperty(issuer,
CERT_KEY_IDENTIFIER_PROP_ID, NULL, &size);
if (ret && size == info->KeyId.cbData)
{
if (info->KeyId.cbData == ext->Value.cbData)
ret = !memcmp(info->KeyId.pbData,
ext->Value.pbData, info->KeyId.cbData);
LPBYTE buf = CryptMemAlloc(size);
if (buf)
{
CertGetCertificateContextProperty(issuer,
CERT_KEY_IDENTIFIER_PROP_ID, buf, &size);
ret = !memcmp(buf, info->KeyId.pbData, size);
CryptMemFree(buf);
}
else
ret = FALSE;
}
......
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