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