Commit 497b67db authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

wintrust: Fail to load a certificate from a PE file if the certificate entry isn't a known type.

parent d69b00d6
...@@ -1028,7 +1028,18 @@ static BOOL WINTRUST_GetSignedMsgFromPEFile(SIP_SUBJECTINFO *pSubjectInfo, ...@@ -1028,7 +1028,18 @@ static BOOL WINTRUST_GetSignedMsgFromPEFile(SIP_SUBJECTINFO *pSubjectInfo,
/* app hasn't passed buffer, just get the length */ /* app hasn't passed buffer, just get the length */
ret = ImageGetCertificateHeader(pSubjectInfo->hFile, dwIndex, &cert); ret = ImageGetCertificateHeader(pSubjectInfo->hFile, dwIndex, &cert);
if (ret) if (ret)
{
switch (cert.wCertificateType)
{
case WIN_CERT_TYPE_X509:
case WIN_CERT_TYPE_PKCS_SIGNED_DATA:
*pcbSignedDataMsg = cert.dwLength; *pcbSignedDataMsg = cert.dwLength;
break;
default:
WARN("unknown certificate type %d\n", cert.wCertificateType);
ret = FALSE;
}
}
} }
else else
{ {
...@@ -1065,9 +1076,10 @@ static BOOL WINTRUST_GetSignedMsgFromPEFile(SIP_SUBJECTINFO *pSubjectInfo, ...@@ -1065,9 +1076,10 @@ static BOOL WINTRUST_GetSignedMsgFromPEFile(SIP_SUBJECTINFO *pSubjectInfo,
*pdwEncodingType = X509_ASN_ENCODING | PKCS_7_ASN_ENCODING; *pdwEncodingType = X509_ASN_ENCODING | PKCS_7_ASN_ENCODING;
break; break;
default: default:
FIXME("don't know what to do for encoding type %d\n", WARN("don't know what to do for encoding type %d\n",
pCert->wCertificateType); pCert->wCertificateType);
*pdwEncodingType = 0; *pdwEncodingType = 0;
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