If I make a simple message: BINARY DATA ---cut here 8><--- (note lines end in LF, not CRLF) and sign it as so: openssl smime -sign -binary -in zz-in -out zz-out \ -signer as2.crt -inkey as2.key (note I asked for -binary) Then it is impossible to verify the message: openssl smime -verify -binary -in zz-out -noverify \ -certfile as2.crt -inform smime | cat -vet Verification failure 21148:error:21071065:PKCS7 routines:PKCS7_signatureVerify:digest failure:pk7_doit.c:948: 21148:error:21075069:PKCS7 routines:PKCS7_verify:signature failure:pk7_smime.c:312: Content-Type: application/octet-stream^M$ Content-Transfer-Encoding: 8bit^M$ ^M$ BINARY DATA^M$ ^M$ It seems that the -verify code doesn't know how to do -binary. If I sign without -binary and verify with or without -binary then the verification works, but my binary data is corrupted by replacing all LF's with CRLF.
OpenSSL tickets: http://rt.openssl.org/Ticket/Display.html?id=828 and http://rt.openssl.org/Ticket/Display.html?id=1261 seem relevant.
I'm seeing the same issue (with current OpenSSL versions), but these RT links are offline. Do you maybe have new ticket links?
https://groups.google.com/g/mailing.openssl.dev/c/FOX9Ss2aaJw/m/AfS76a44lXAJ https://groups.google.com/g/mailing.openssl.dev/c/LF1RYgvRUQE/m/oSJXkswhDQAJ https://groups.google.com/g/mailing.openssl.dev/c/9pB2Iqhttb4/m/W67FfElyVQUJ https://groups.google.com/g/mailing.openssl.dev/c/m37jiHpC7NA/m/MGwdXzdOkSwJ https://groups.google.com/g/mailing.openssl.dev/c/-zQ_jTdjinc/m/K9ipQoLEX88J https://groups.google.com/g/mailing.openssl.dev/c/cXB0VXJxjlc/m/1Uls-YCYDAAJ I restored some of the mails since the RT tracker is gone. Would you mind forward this to openssl upstream on github? Sebastian
[...]
If understood correctly, they point to a patch which does more: support a "Content-Transfer-Encoding: binary|base64" header (and add a new -transferencoding param).
For the original issue ("openssl smime -verify -binary" has issues with non-CRLF line endings), I've created https://github.com/openssl/openssl/issues/29492.
Many thanks again!
Greetings,
Ulrich