beanit / asn1bean

ASN1bean (formerly known as jASN1) is a Java ASN.1 BER and DER encoding/decoding library
https://www.beanit.com/asn1/
Apache License 2.0
110 stars 45 forks source link

Fix decoding of zero length BerAny type at end of file #38

Closed sc-automation closed 3 years ago

sc-automation commented 3 years ago

Util.readFully must be suppressed for the case that we have a zero length value, as it yields "java.io.EOFException: Unexpected end of input stream." when at eof.

sfeuerhahn commented 3 years ago

Thanks for pointing out this problem. I fixed this by changing Util.readFully to handle a length of zero correctly. I believe this should be done anyways.