Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression for 0x05 0x80 #32

Merged
merged 3 commits into from
Jan 28, 2020
Merged

Conversation

hannesm
Copy link
Member

@hannesm hannesm commented Jan 28, 2020

as reported by @emillon

@hannesm
Copy link
Member Author

hannesm commented Jan 28, 2020

the issue is that 0x80 expresses an indefinite length (i.e. a byte sequence with traling 0x00 0x00), but it got ignored for primitives. this was not an issue in 0.2.0, but got introduced in 9da82ac.

As reference, http://lapo.it/asn1js/#BQA results in "invalid tag with undefined length at offset 2".

- primitive, definitive length
- constructed, definitive length
- constructed, indefinitive length

a primitive with indefinitive length leads to an error
@hannesm hannesm merged commit 5978e4e into mirleft:master Jan 28, 2020
@hannesm hannesm deleted the fix-regression branch January 28, 2020 17:32
hannesm added a commit to hannesm/opam-repository that referenced this pull request Jan 28, 2020
CHANGES:

* disallow various constructs as suggested by ITU-T Rec X.690 (by @pqwy)
  * redundant OID component forms (X.690 8.20.2)
  * redundant integer forms (X.690 8.3.2)
  * empty integer (X.690 8.3.1, reported in mirleft/ocaml-asn1-combinators#23 by @emillon)
  * constructed strings in DER
* deeper implict -> explicit over choice (follow-up to v0.2.0 entry, by @pqwy)
* handle long-form length overflow (reported in mirleft/ocaml-asn1-combinators#24 by @emillon, fixed by @pqwy)
* disallow primitive with indefinite length (introduced in the bugfix above,
  reported by @emillon, fixed in mirleft/ocaml-asn1-combinators#32 by @hannesm)
* disallow nonsensical bitstring unused values (X690 8.6.2, reported in mirleft/ocaml-asn1-combinators#26
  by @NathanReb, fixed by @pqwy)
* fix non-continuous bit_string_flags (X680 22.6, reported in mirleft/ocaml-asn1-combinators#25 by @wiml,
  fixed by @pqwy)
* use Alcotest instead of oUnit for unit tests (by @pqwy)
* use dune as build system (by @pqwy, superseeds mirleft/ocaml-asn1-combinators#22)
* use bigarray-compat (mirleft/ocaml-asn1-combinators#27 by @TheLortex) and stdlib-shims (mirleft/ocaml-asn1-combinators#29 by @XVilka)
* raise lower bound to OCaml 4.05.0 (mirleft/ocaml-asn1-combinators#31 by @hannesm)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant