Search code examples
outlookopensslsmimeverifyerror

OpenSSL cannot verify opaque signed message with no content and with an attachment


The sender has sent me an opaque signed message which has empty content except for an image as an attachment. If I try to verify this using command

$ openssl smime -verify -in testSmimeOpaqueSignedEmptyMessageWithAttachment.email -noverify -out testSmimeVerifiedOpaqueSignedMessageWithAttachment.email

It fails with error

Error reading S/MIME message
75769:error:0D0D20CC:asn1 encoding routines:SMIME_read_ASN1:no content type:/SourceCache/OpenSSL098/OpenSSL098-47.1/src/crypto/asn1/asn_mime.c:379:

But if the sender sends me a opaque signed message which has the same attachment but there is some text in the message as well, the above verify command is successful and I get the decoded message back.

Is this normal? So if I'm using openssl I cannot have sender send me an empty message?? I'm using OpenSSL 0.9.8x 10 May 2012 version.

Note that I don't need to verify certificate right now. Just the signature. And the sender outlook is set so that the message includes the sender's public certificate.


Solution

  • I figured out that my TextEdit was tampering with the message when I was saving email source from outlook into a text file. In the terminal using vi to copy paste the contents, seems to work with the verify.