forge icon indicating copy to clipboard operation
forge copied to clipboard

Match OpenSSL output for enveloped data

Open roysjosh opened this issue 10 years ago • 4 comments

Do not include IMPLICIT ASN.1 elements in the output

roysjosh avatar Jun 15 '15 15:06 roysjosh

Ping. Do you need any more info?

roysjosh avatar Jun 14 '18 19:06 roysjosh

Sorry for the delay! I'm guessing no one has taken the time to figure out if this change is ok and won't break other code. Is there some spec text related to this? Are there tests that could be written?

davidlehn avatar Jun 14 '18 20:06 davidlehn

https://tools.ietf.org/html/rfc2315#section-10.1

ASN.1 IMPLICIT tags don't include the tag of the child element. See http://luca.ntop.org/Teaching/Appunti/asn1.html or google asn.1 implicit tagged object.

This is another good example: https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-X.690-200811-S!!PDF-E&type=items

Also compare to OpenSSL's smime output.

Tests could probably be written. I can add a few if that would help. There's a comment in lib/pkcs7asn1.js about the output differing and accepting both types so I didn't mess with the capturing bits at all. I think you should continue to be lenient on parsing but switch to the more correct output since there does seem to be some interpretation differences.

roysjosh avatar Jun 14 '18 20:06 roysjosh

I should mention that the motivation for this change is that the JSS library used by Red Hat's Dogtag certificate server only accepts the encoding lacking the implicit element's child tag.

roysjosh avatar Jun 15 '18 13:06 roysjosh