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

已關閉
建立於 2020-04-24 12:12:58 +00:00 由 Ghost · 9 comment

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!
擁有者

Yes, please do. aj@therootcompany.com

Yes, please do. aj@therootcompany.com
作者

Done.

Done.
擁有者

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 關閉了這個問題 2020-06-02 15:17:09 +00:00
作者

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. :)
登入 才能加入這對話。
未選擇標籤
2 參與者
通知
截止日期
未設定截止日期。
先決條件

未設定先決條件。

參考: coolaj86/cert-info.js#2
No description provided.