When slicing a string, you get a panic if you do so at any point
other than at a character boundary. This happened in the
implementation of UTCTime parsing.
This bug was introduced in bc156c36d7,
and appears to affect only version 0.6.0.
I've tried using the clippy::string_slice lint to confirm that there
are not any other string slices in this code.
Fixes bug #27. Found via fuzzing.
This also adds a check in the synthesis of arbitary items of unknown type,
to ensure that we don't accidentally create objects with a known type. I'm
actually not 100% sure how the old tests were passing so reliably, which
is worrying.
This removes the manual implementation of Display + Error for
ASN1EncodeErr and uses the derive macro from `thiserror` to add
std Error and Display implementations for ANS1EncodeErr and
ASN1DecodeErr.
See https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-license-file-fields :
> If a package is using a nonstandard license, then the license-file field may be specified in lieu of the license
> field.
`simple_asn1` however uses a standard license (ISC, as per LICENSE).
Note that this is also a somewhat commonly used way by many projects
(see for example Cargo or serde).
Using the machine-readable SPX specifier instead of a text file helps
automatic tooling like [cargo-lichking](https://github.com/Nemo157/cargo-lichking) to check licenses of projects and
dependencies.
The default datatypes always have Universal as their class. If we
encounter another class while parsing, it is a tagged block.
I am not sure how (and if at all) we can distinguish explicitly and
implicitly tagged data. For now they should be parsed as unknown (or
explicit if they are a valid ASN.1 block).