Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on empty sequence in ASN1 #213

Open
tienducle opened this issue Jan 11, 2015 · 1 comment
Open

Error on empty sequence in ASN1 #213

tienducle opened this issue Jan 11, 2015 · 1 comment

Comments

@tienducle
Copy link

Hi,

I have two base64 encoded SMIME files which I put into forge.pkcs7.messageFromPem()

On the original file, there is a sequence with 0 elements, and it is making Forge to throw an error (left window on picture). Then I changed the empty sequence to null and then Forge accepts the file (right window on picture).

asn1

Is it not allowed to have an empty sequence? Or is it a bug?

Thanks in advance for any help!

Edit:
Error stack:
var p7 = forge.pkcs7.messageFromPem(pem);
p7.messageFromPem
p7.messageFromAsn1
msg.fromAsn1
_recipientInfosFromAsn1
_recipientInfoFromAsn1
var error = new Error('Cannot read PKCS#7 message. ' + 'ASN.1 object is not an PKCS#7 EnvelopedData.');

@dlongley
Copy link
Member

Hi @Cyb3rfr3ak -- super busy at the moment, but I will get to looking into this when I can. I'll have to look at the spec to see if there can be an empty sequence in that position or not -- and if so, change the forge code to accept it, if not, it's an invalid file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants