When passed in a ber with an Infinite length content, it produces a der error on Infinite length (Error(DerConstraintFailed(IndefiniteLength))). This shouldn't have happened because ber has no constrains on length.
The problem is expected to be located here. I fixed to Header::from_ber and the problem is resolved.
P/S: The ber I tried to parse is from an Apple signature chain in any signed binary, and I assume it to be correct (checked using https://lapo.it/asn1js/). Using the rusticata/der-parserparse_ber function.
When passed in a ber with an Infinite length content, it produces a der error on Infinite length (
Error(DerConstraintFailed(IndefiniteLength))
). This shouldn't have happened because ber has no constrains on length.The problem is expected to be located here. I fixed to
Header::from_ber
and the problem is resolved.https://github.com/rusticata/asn1-rs/blob/5b2af8f80fe022687bbb3e831960fa38657974b8/src/ber/parser.rs#L37
I believe this is a typo and should be fixed.
P/S: The ber I tried to parse is from an Apple signature chain in any signed binary, and I assume it to be correct (checked using https://lapo.it/asn1js/). Using the
rusticata/der-parser
parse_ber
function.