Length of buffer does not match length of ASN.1 sequence. #2

Closed
by Ghost opened 4 years ago · 9 comments
Ghost commented 4 years ago

We’re using this lib to get infos about LE certificates. This has worked fine so far.

Now I have a certificate, for which I get Error: Length of buffer does not match length of ASN.1 sequence.

Added some logging in asn1-parser.js:

  console.log('len', len); // 2551
  console.log('asn1.lengthSize', asn1.lengthSize); // 2
  console.log('asn1.length', asn1.length); // 1373

When I disable the check if (len !== 2 + asn1.lengthSize + asn1.length), the certificate is still properly decoded.

Any idea what’s going on here? I could share the certificate privately if that helps!

We’re using this lib to get infos about LE certificates. This has worked fine so far. Now I have a certificate, for which I get `Error: Length of buffer does not match length of ASN.1 sequence.` Added some logging in `asn1-parser.js`: ``` console.log('len', len); // 2551 console.log('asn1.lengthSize', asn1.lengthSize); // 2 console.log('asn1.length', asn1.length); // 1373 ``` When I disable the check `if (len !== 2 + asn1.lengthSize + asn1.length)`, the certificate is still properly decoded. Any idea what’s going on here? I could share the certificate privately if that helps!
Owner

Yes, please do. aj@therootcompany.com

Yes, please do. aj@therootcompany.com

Done.

Done.
Owner

I never got it, not even in my spam.

Perhaps put it in a zip file and send it to coolaj86@gmail.com instead.

I never got it, not even in my spam. Perhaps put it in a zip file and send it to coolaj86@gmail.com instead.

Done.

Done.

Did my email arrive?

Did my email arrive?

Hello coolaj86,

I use NodeRed to manage my certificates, everything was working perfectly and now it doesn't work anymore.
I have an error message, see below.
I see here that another person had this problem.
Could you help me solve this one. I am attaching the only messages I receive.
Inside this ?
Many Thanks for your help.

/Jean-Luc

Hello coolaj86, I use NodeRed to manage my certificates, everything was working perfectly and now it doesn't work anymore. I have an error message, see below. I see here that another person had this problem. Could you help me solve this one. I am attaching the only messages I receive. [Inside this ?](https://git.coolaj86.com/coolaj86/cert-info.js/src/branch/master/lib/asn1-parser.js#L114) Many Thanks for your help. /Jean-Luc

Solved.

We were accidentally passing the entire chain instead of just the cert. This worked in some (most?) cases, in some not. Fixed by just passing the cert.

Solved. We were accidentally passing the entire chain instead of just the cert. This worked in some (most?) cases, in some not. Fixed by just passing the cert.
Ghost closed this issue 4 years ago

Hello, I've noticed the patch but it still doesn't work.
Did you forget to update the repository? It seems to be a bit outdated.
Thanks for your help.

/JLM

Hello, I've noticed the patch but it still doesn't work. Did you forget to update the repository? It seems to be a bit outdated. Thanks for your help. /JLM

@JLM May well use https://www.npmjs.com/package/certpem. It's from the same guy. :)

@JLM May well use https://www.npmjs.com/package/certpem. It's from the same guy. :)
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.