<div dir="ltr"><div dir="ltr"><div>Hello,</div><div><br></div><div>I am struggling with
 using OpenSSL 1.1.1 to verify a PKCS #7/CMS structure. Verification 
succeeds when I use OpenSSL 1.0.2, but 1.1.0 and 1.1.1 fails with "bad 
signature". I initially had this problem when using the OpenSSL library 
but I see that the problem also applies to the OpenSSL CLI.</div><div><br></div><div>I
 am at loss and need some help with this issue. Please see the commands I
 used below. Thank you for any assistance you can provide!</div><div><br></div><div>Notes:</div><div><ul><li>"<span style="font-family:monospace,monospace">-noverify</span>" was used because the certificates expired.</li><li>Verification succeeds when specifying "<span style="font-family:monospace,monospace">-nosigs</span>".</li><li>"<span style="font-family:monospace,monospace">openssl cms -verify [...]</span>" behaves the same way.<br></li><li>Since the files I am working with (<span style="font-family:monospace,monospace">test.der</span> and <span style="font-family:monospace,monospace">test-data.bin</span>) are part of a private project, I am not ready to share these in public.</li><li>I
 do not know exactly how the message structure was created but I guess 
either with some OpenSSL 1.0.2, Java with or without BouncyCastle.<br></li></ul><div>Commands used:<br></div></div><div><br></div><div><div class="gmail-m_7091756494279206148gmail-de1"><span style="font-family:monospace,monospace"># Environment: macOS 10.14.3 / Homebrew</span></div>
<div class="gmail-m_7091756494279206148gmail-de1"><span style="font-family:monospace,monospace"> </span></div>
<div class="gmail-m_7091756494279206148gmail-de1"><span style="font-family:monospace,monospace">$ /usr/local/opt/openssl/bin/openssl version</span></div>
<div class="gmail-m_7091756494279206148gmail-de1"><span style="font-family:monospace,monospace">OpenSSL 1.0.2r  26 Feb 2019</span></div>
<div class="gmail-m_7091756494279206148gmail-de2"><span style="font-family:monospace,monospace"> </span></div>
<div class="gmail-m_7091756494279206148gmail-de1"><span style="font-family:monospace,monospace">$ /usr/local/opt/openssl/bin/openssl smime -verify -inform der -in test.der -content test-data.bin -noverify</span></div>
<div class="gmail-m_7091756494279206148gmail-de1"><span style="font-family:monospace,monospace">Verification successful</span></div>
<div class="gmail-m_7091756494279206148gmail-de1"><span style="font-family:monospace,monospace"> </span></div>
<div class="gmail-m_7091756494279206148gmail-de1"><span style="font-family:monospace,monospace">$ /usr/local/opt/openssl\@1.1/bin/openssl version</span></div>
<div class="gmail-m_7091756494279206148gmail-de2"><span style="font-family:monospace,monospace">OpenSSL 1.1.1b  26 Feb 2019</span></div>
<div class="gmail-m_7091756494279206148gmail-de1"><span style="font-family:monospace,monospace"> </span></div>
<div class="gmail-m_7091756494279206148gmail-de1"><span style="font-family:monospace,monospace">$ /usr/local/opt/openssl\@1.1/bin/openssl smime -verify -inform der -in test.der -content test-data.bin -noverify</span></div>
<div class="gmail-m_7091756494279206148gmail-de1"><span style="font-family:monospace,monospace">Verification failure</span></div>
<div class="gmail-m_7091756494279206148gmail-de1"><span style="font-family:monospace,monospace">4563408320:error:04091068:rsa routines:int_rsa_verify:bad signature:crypto/rsa/rsa_sign.c:220:</span></div>
<div class="gmail-m_7091756494279206148gmail-de2"><span style="font-family:monospace,monospace">4563408320:error:21071069:PKCS7 routines:PKCS7_signatureVerify:signature failure:crypto/pkcs7/pk7_doit.c:1037:</span></div><span style="font-family:monospace,monospace">
4563408320:error:21075069:PKCS7 routines:PKCS7_verify:signature failure:crypto/pkcs7/pk7_smime.c:353:</span></div></div></div>