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

Kapalı
Ghost tarafından 2020-04-24 12:12:58 +00:00 açıldı · 9 yorum

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!
Sahibi

Yes, please do. aj@therootcompany.com

Yes, please do. aj@therootcompany.com
Yazar

Done.

Done.
Sahibi

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.
Yazar

Done.

Done.
Yazar

Did my email arrive?

Did my email arrive?
Yazar

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
Yazar

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 2020-06-02 15:17:09 +00:00 konusunu kapattı
Yazar

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
Yazar

@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. :)
Bu konuşmaya katılmak için oturum aç.
Etiket Yok
2 Katılımcı
Bildirimler
Bitiş Tarihi
Bitiş tarihi atanmadı.
Bağımlılıklar

Bağımlılık yok.

Referans: coolaj86/cert-info.js#2
Herhangi bir açıklama sağlanmadı.