<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">The OpenSSL new release / HEAD updates removed the following comment-out statement<o:p></o:p></p>
<p class="MsoNormal">in PKCS7_verify() routine, which will return error for one call if both embedded-content and<o:p></o:p></p>
<p class="MsoNormal">detached data were provided. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:red">#if 0       --> Removed<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:red">    /*<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:red">     * NB: this test commented out because some versions of Netscape<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:red">     * illegally include zero length content when signing data.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:red">     */<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">    /* Check for data and content: two sets of data */<o:p></o:p></p>
<p class="MsoNormal">    if (!PKCS7_get_detached(p7) && indata) {<o:p></o:p></p>
<p class="MsoNormal">        PKCS7err(PKCS7_F_PKCS7_VERIFY, PKCS7_R_CONTENT_AND_DATA_PRESENT);<o:p></o:p></p>
<p class="MsoNormal">        return 0;<o:p></o:p></p>
<p class="MsoNormal">    }<o:p></o:p></p>
<p class="MsoNormal"><span style="color:red">#endif<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This update will break some existing Authenticode verification solutions which leveraged the<o:p></o:p></p>
<p class="MsoNormal">Pkcs7_verify() interface, such as UEFI secure boot, and other open-source utilities (e.g. osslsigncode).
<o:p></o:p></p>
<p class="MsoNormal">The root cause is the Authenticode is one extended PKCS7 format, and its verification process<o:p></o:p></p>
<p class="MsoNormal">is different (the embedded data is one extended structure (SpcIndirectDataContent), and will<o:p></o:p></p>
<p class="MsoNormal">not be used directly for signature verification) . The old comment-out in PKCS7_verify just helped<o:p></o:p></p>
<p class="MsoNormal">to support the Authenticode verification with embedded p7data and user-supplied inData
<o:p></o:p></p>
<p class="MsoNormal">(some extra checking will be handled outside). <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">It’s better to introduce one new macro or new PKCS7 flag to re-enable this capability. E.g.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">#if !defined(<span style="color:red">OPENSSL_ALLOW_PKCS7_CONTENT_AND_DATA_PRESENT</span>)<o:p></o:p></p>
<p class="MsoNormal">….<o:p></o:p></p>
<p class="MsoNormal">Or <o:p></o:p></p>
<p class="MsoNormal">If (!(flags & <span style="color:red">PKCS7_NO_CHECK_BOTH_DATASET</span>))<o:p></o:p></p>
<p class="MsoNormal">…<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">If two data sets (embedded and detached data) were present, the input data will be the default<o:p></o:p></p>
<p class="MsoNormal">Input for validation (just as the current logic.), so there should be no risk.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best Regards & Thanks,<o:p></o:p></p>
<p class="MsoNormal">LONG, Qin<o:p></o:p></p>
</div>
</body>
</html>