indutny / asn1.js

ASN.1 Decoder/Encoder/DSL
MIT License
181 stars 64 forks source link

Increase limit for long form definite length decoding #78

Closed felix closed 7 years ago

felix commented 7 years ago

(Was PR #74 but it didn't seem to reopen)

I cannot find any references to a limit of 3 bytes to encode the length. Java's Bouncy Castle seems to set the limit to 4 bytes seemingly due to the maximum size of an integer.

3 bytes limits us to only 16 megabytes (which we are reaching) so I have updated the patch to limit it to 4 bytes which is perhaps better than removing the restriction altogether.