Releases: kellerkindt/asn1rs
asn1rs v0.3.1
Version 0.3.1 (2023-07-27)
Basically v0.3.0 but this time with correct dependencies on the internal crates!
Fixed
- Fix
asn1rs-modeldependency ofasn1rs-macros(3986ce9) - Fix
asn1rs-macrosdependency ofasn1rs(5d4f4ec) - Fix
asn1rs-*version dependency (9825de9)
Version 0.3.0 (2023-07-27)
Added
- More tests (aa6e4f1 4568b1f ee74d2b)
- Impl PartialEq for Error (11a8312)
- Feature
descriptive-deserialize-errors(7f3e11a) - Ignore multiline comments (f6a6e86, gh-78, thanks @Nicceboy)
Changed
- Update
synversion to 1.0.109 (96df6b2, 5b8c49f) - Collect Backtrace on insufficient source / destination buffer (4a2358e)
- Update
bytesto v1.0 (6765543) - Update
postgresto v0.19.1 (63131d0) - Try to generate the protobuf package based on the OID before using the path (624a697, 1c460aa)
- Prefix protobuf enum variants with their type name to pevent collisions (c sibling rule) (93214ac)
- Use
bytesinstead ofbit_vecin protobuf for ASN.1BIT STRING(6af109b) - Rewrite
ProtobufReaderto properly handle out-of-order and missing tags (681ff2b) - Ignore non-.rs files for
proc_macro_coverage_hack(c925df6, 1319241) - Limit (P-)SQL Type names to not exceed 63 characters (d662e56, c7b7401, 2d69ca1, gh-75)
- Split
Errortype with boxed innerErrorKind(7f3e11a, 2471539) - Add
#[doc(hidden)]to internal constraint types generated via macro, disable with featuregenerate-internal-docs(20767e7) - Derive
Defaultfor enums (b189ef6) - Make the
CHANGELOG.mdadhere more closely to the Keep a Changelog template.
Deprecated
Removed
Fixed
- Fix
Scope::exhaustedforScope::ExtensibleSequences(6c9f334) - Fix call to
BitVec::ensure_vec_large_enoughand add pub accessor (a4cec0e) - Fix extensible fields in
SEQUENCEandSETnot treat as optional fields (75f2882) - Fix
read_length_determinantfor fragmented sizes (0083f3b) - Fix
write_length_determinantthe size 16kib (5061379) - Fix fragmented write_octetstring and add return value to
write_length_determinant(30dfd73) - Fix usage of
rustdoc::broken_intra_doc_links(c4f55dc, a4579cc) - Fix name duplication for inline choice types (e8aa191, gh-75)
- Prevent two panics (thanks fuzzer) in
PacketReadimpl forBitRead(e3f5323)
Security
asn1rs v0.3.0
Version 0.3.0 (2023-07-27)
Added
- More tests (aa6e4f1 4568b1f ee74d2b)
- Impl PartialEq for Error (11a8312)
- Feature
descriptive-deserialize-errors(7f3e11a) - Ignore multiline comments (f6a6e86, gh-78, thanks @Nicceboy)
Changed
- Update
synversion to 1.0.109 (96df6b2, 5b8c49f) - Collect Backtrace on insufficient source / destination buffer (4a2358e)
- Update
bytesto v1.0 (6765543) - Update
postgresto v0.19.1 (63131d0) - Try to generate the protobuf package based on the OID before using the path (624a697, 1c460aa)
- Prefix protobuf enum variants with their type name to pevent collisions (c sibling rule) (93214ac)
- Use
bytesinstead ofbit_vecin protobuf for ASN.1BIT STRING(6af109b) - Rewrite
ProtobufReaderto properly handle out-of-order and missing tags (681ff2b) - Ignore non-.rs files for
proc_macro_coverage_hack(c925df6, 1319241) - Limit (P-)SQL Type names to not exceed 63 characters (d662e56, c7b7401, 2d69ca1, gh-75)
- Split
Errortype with boxed innerErrorKind(7f3e11a, 2471539) - Add
#[doc(hidden)]to internal constraint types generated via macro, disable with featuregenerate-internal-docs(20767e7) - Derive
Defaultfor enums (b189ef6) - Make the
CHANGELOG.mdadhere more closely to the Keep a Changelog template.
Deprecated
Removed
Fixed
- Fix
Scope::exhaustedforScope::ExtensibleSequences(6c9f334) - Fix call to
BitVec::ensure_vec_large_enoughand add pub accessor (a4cec0e) - Fix extensible fields in
SEQUENCEandSETnot treat as optional fields (75f2882) - Fix
read_length_determinantfor fragmented sizes (0083f3b) - Fix
write_length_determinantthe size 16kib (5061379) - Fix fragmented write_octetstring and add return value to
write_length_determinant(30dfd73) - Fix usage of
rustdoc::broken_intra_doc_links(c4f55dc, a4579cc) - Fix name duplication for inline choice types (e8aa191, gh-75)
- Prevent two panics (thanks fuzzer) in
PacketReadimpl forBitRead(e3f5323)
Security
asn1rs v0.2.2
Version 0.2.2 (2021-05-03)
This release includes a lot of refactoring and new features. With these changes, it is now possible to use the following ASN.1 standard:
- 🎉
itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg1(1) en(302637) denm(1) version(2)(DENM)
Fixes
- Properly parse (extensible)
SIZEwithout a range value. - Fix
ProtobufWriteron slices - Fix clippy v1.51 remarks.
- Fix
rust_variant_nameandrust_struct_or_enum_namefor two consecutively upper case letters. - Fix
rust_constant_namenot inserting _ around numbers.
Added
- Lots of regression tests for utility functions.
- Regression tests for
ProtobufWriteron slices. - Basic support for
DEFAULT(forINTEGER, *String,BOOLEAN,ENUMERATEDand some tuple/transparent types) - Parsing (and ignoring) of
WITH COMPONENTSconstraints - Resolving symbols across multiple module descriptions.
- Support ASN
NULLtype
Changes
- Generate constants besides structs. This has the advantage that constants are clearly visible.
- Performance improvement while converting the Model to Rust: Do not allocating structs that are thrown away anyway (call
RustType::as_inner_typeinstead of::clone&RustType::into_inner_type).
Removed
- Legacy protobuf and uper codegen
asn1rs v0.2.1
Version 0.2.1 (2021-03-22)
This release refactors Model<Asn> which is now represented as Model<Asn<Unresolved>> and Model<Asn<Resolved>>.
This change allows Value-References in SIZE and RANGE constraints (see gh-50 gh-49) without a failable to_rust() converter.
Fixes
- No longer choke on empty
SEQUENCEdefinitions (see gh-44)
Added
Changes
- BREAKING:
Model::try_from(Tokenizer)now returnsModel<Asn<Unresolved>>. To convert to rust (Model::<Asn<Resolved>>::to_rust(&self) -> Model<Rust>) the fallible functionModel::<Asn<Unresolved>>::try_resolve(&self) -> Model<Asn<Resolved>>must be called first.
let model_rust = Model::try_from(asn_tokens)
.expect("Failed to parse tokens")
.try_resolve() // <--------------+--- new
.expect("Failed to resolve at least one value reference") // <---+
.to_rust();asn1rs v0.2.0
Version 0.2.0 (2021-02-03)
This release includes a lot of refactoring and new features.
With these changes, it is now possible to use the following two ASN.1 standards:
- 🎉
itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg1(1) ts(102894) cdd(2) version(1)(ITS-Container) - 🎉
itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg1(1) en(302637) cam(2) version(1)(CAM-PDU-Descriptions)
The serialization and deserialization process was completely revamped to replace the code generation that uses string concatenation and instead utilize (smaller) proc-macros and types for it.
The previous - now called legacy codegen - is still available, but deprecated and hidden behind the legacy-uper-codegen and legacy-protobuf-codegen feature.
It will be removed in 0.3.0.
Feel free to visit the tests to learn about the new usage. You might want to start with the showcase.
Fixes
- lots of smaller and niche parsing errors
- Implement the canonical order for tags (ITU-T X.680 | ISO/IEC 8824-1, 8.6)
- Missing CI checks on non-default features
Added
- support for ASN-extensible
CHOICEandENUMERATEDtypes Reader,Writertraits to (de)serialize based on the visitor pattern, asn attribute annotation, see showcase and proc_macro_attribute. This will allow further ASN encodings to be implemented without further code generation (to be clear, this not on the roadmap for now, but PRs are welcome).- Support for
INTEGERconstants - Support for extensible
SEQUENCEs - Support for extensible
INTEGERs - Support for
BIT STRING, as well as theSIZEconstraint, constants, and the extensible flag - Support for
IA5String, as well as theSIZEconstraint, and the extensible flag - Support for
SIZEconstraints forOCTET STRINGs - Support for
SIZEconstraints forUTF8Strings - Support for
SIZEconstraints forSEQUENCE OFs - Support for
SETs andSET OFs* - Support for extensible
SETs - Support for
SIZEconstraints forSET OFs TagResolverto properly resolve Tags of ASN.1 typessyn::common::Constraintwhich hasconst TAG: Tagand implementation for all generated constraint types- CI checks for specific feature combinations
* For SET OF only BASIC-PER encoding is supported currently, see #20
Changes
- Added ASN.1 Support Overview to README
- Deprecated
UperSerializerwhich generates a lot of complex code for (uper-)serialization. Instead general purpose and less complex code that is based on the visitor pattern will be generated. See showcase and commits linked to #11. This also allows to write ASN serializable structures without writing ASN itself (see proc_macro_attribute):
#[asn(sequence)]
#[derive(Debug, PartialOrd, PartialEq)]
pub struct Pizza {
#[asn(integer(1..4))]
size: u8,
#[asn(complex(Topping))]
topping: Topping,
}
#[test]
fn pizza_test_uper_1() {
let mut uper = UperWriter::default();
let pizza = Pizza {
size: 2,
topping: Topping::NotPineapple,
};
uper.write(&pizza).unwrap();
// https://asn1.io/asn1playground/
assert_eq!(&[0x40], uper.byte_content());
assert_eq!(4, uper.bit_len());
let mut uper = uper.into_reader();
assert_eq!(pizza, uper.read::<Pizza>().unwrap());
assert_eq!(0, uper.bits_remaining());
}- Parse/Accept ObjectIdentifier in
FROMdirectives and module definitions - The module
crate::io::uperis now deprecated - Reimplemented all low level uPER functions - this time strictly according to specification and using names mentioned there, see
crate::io::per - Better prepare for alternative encoding rules (especially aligned PER, although this is no specific goal)
- Help the compiler in figuring out where const evaluations are possible (see
const_*!macros) - Lots of
#[inline]hinting - The ASN.1
OPTIONALtype is now represented asoptionalinstead ofoptionin#[asn(..)] - The protobuf serializer is now optional and can be enabled with the
protobuffeature flag - Deprecated
Protobuftrait which is replaced byProtobufReaderandProtobufWriterthat use the commonReadableandWritabletraits
asn1rs v0.2.0-alpha3
0.2.0-alpha3 (Oct 14, 2020)
Fixes
- Missing CI checks on non-default features
Added
- Support for
SETs andSET OFs* - Support for extensible
SETs - Support for
SIZEconstraints forSET OFs TagResolverto properly resolve Tags of ASN.1 typessyn::common::Constraintwhich hasconst TAG: Tagand implementation for all generated constraint types
* For SET OF only BASIC-PER encoding is supported currently, see #20
Changes
- The ASN.1
OPTIONALtype is now represented asoptionalinstead ofoptionin#[asn(..)] - The protobuf serializer is now optional and can be enabled with the
protobuffeature flag
asn1rs v0.2.0-alpha2
0.2.0-alpha2 (Sep 03, 2020)
This release includes a lot of refactoring and new features.
With these changes, it is now possible to use the following two ASN.1 standards:
- 🎉
itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg1(1) ts(102894) cdd(2) version(1)(ITS-Container) - 🎉
itu-t(0) identified-organization(4) etsi(0) itsDomain(5) wg1(1) en(302637) cam(2) version(1)(CAM-PDU-Descriptions)
Fixes
- Implement the canonical order for tags (ITU-T X.680 | ISO/IEC 8824-1, 8.6)
Added
- Support for
INTEGERconstants - Support for extensible
SEQUENCEs - Support for extensible
INTEGERs - Support for
BIT STRING, as well as theSIZEconstraint, constants, and the extensible flag - Support for
IA5String, as well as theSIZEconstraint, and the extensible flag - Support for
SIZEconstraints forOCTET STRINGs - Support for
SIZEconstraints forUTF8Strings - Support for
SIZEconstraints forSEQUENCE OFs - ASN.1 Support Overview to README
Changes
- Parse/Accept ObjectIdentifier in
FROMdirectives and module definitions - The whole module
crate::io::uperis now deprecated - Reimplemented all low level uPER functions - this time strictly according to specification and using names mentioned there, see
crate::io::per - Better prepare for alternative encoding rules (especially aligned PER, although this is no specific goal)
- Help the compiler in figuring out where const evaluations are possible (see
const_*!macros) - Lots of
#[inline]hinting
asn1rs v0.2.0-alpha1
0.2.0-alpha1 (May 13, 2020)
Fixes
- lots of smaller and niche parsing errors
Added
- support for ASN-extensible
CHOICEandENUMERATEDtypes Reader,Writertraits to (de)serialize based on the visitor pattern, asn attribute annotation, see showcase and proc_macro_attribute. This will allow further ASN encodings to be implemented without further code generation (to be clear, this not on the roadmap for now, but PRs are welcome).
Changes
- deprecated
UperSerializerwhich generates a lot of complex code for (uper-)serialization. Instead general purpose and less complex code that is based on the visitor pattern will be generated. See showcase and commits linked to #11. This also allows to write ASN serializable structures without writing ASN itself (see proc_macro_attribute):
#[asn(sequence)]
#[derive(Debug, PartialOrd, PartialEq)]
pub struct Pizza {
#[asn(integer(1..4))]
size: u8,
#[asn(complex(Topping))]
topping: Topping,
}
#[test]
fn pizza_test_uper_1() {
let mut uper = UperWriter::default();
let pizza = Pizza {
size: 2,
topping: Topping::NotPineapple,
};
uper.write(&pizza).unwrap();
// https://asn1.io/asn1playground/
assert_eq!(&[0x40], uper.byte_content());
assert_eq!(4, uper.bit_len());
let mut uper = uper.into_reader();
assert_eq!(pizza, uper.read::<Pizza>().unwrap());
assert_eq!(0, uper.bits_remaining());
}