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-model
dependency ofasn1rs-macros
(3986ce9) - Fix
asn1rs-macros
dependency 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
syn
version to 1.0.109 (96df6b2, 5b8c49f) - Collect Backtrace on insufficient source / destination buffer (4a2358e)
- Update
bytes
to v1.0 (6765543) - Update
postgres
to 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
bytes
instead ofbit_vec
in protobuf for ASN.1BIT STRING
(6af109b) - Rewrite
ProtobufReader
to 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
Error
type with boxed innerErrorKind
(7f3e11a, 2471539) - Add
#[doc(hidden)]
to internal constraint types generated via macro, disable with featuregenerate-internal-docs
(20767e7) - Derive
Default
for enums (b189ef6) - Make the
CHANGELOG.md
adhere more closely to the Keep a Changelog template.
Deprecated
Removed
Fixed
- Fix
Scope::exhausted
forScope::ExtensibleSequences
(6c9f334) - Fix call to
BitVec::ensure_vec_large_enough
and add pub accessor (a4cec0e) - Fix extensible fields in
SEQUENCE
andSET
not treat as optional fields (75f2882) - Fix
read_length_determinant
for fragmented sizes (0083f3b) - Fix
write_length_determinant
the 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
PacketRead
impl 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
syn
version to 1.0.109 (96df6b2, 5b8c49f) - Collect Backtrace on insufficient source / destination buffer (4a2358e)
- Update
bytes
to v1.0 (6765543) - Update
postgres
to 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
bytes
instead ofbit_vec
in protobuf for ASN.1BIT STRING
(6af109b) - Rewrite
ProtobufReader
to 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
Error
type with boxed innerErrorKind
(7f3e11a, 2471539) - Add
#[doc(hidden)]
to internal constraint types generated via macro, disable with featuregenerate-internal-docs
(20767e7) - Derive
Default
for enums (b189ef6) - Make the
CHANGELOG.md
adhere more closely to the Keep a Changelog template.
Deprecated
Removed
Fixed
- Fix
Scope::exhausted
forScope::ExtensibleSequences
(6c9f334) - Fix call to
BitVec::ensure_vec_large_enough
and add pub accessor (a4cec0e) - Fix extensible fields in
SEQUENCE
andSET
not treat as optional fields (75f2882) - Fix
read_length_determinant
for fragmented sizes (0083f3b) - Fix
write_length_determinant
the 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
PacketRead
impl 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)
SIZE
without a range value. - Fix
ProtobufWriter
on slices - Fix clippy v1.51 remarks.
- Fix
rust_variant_name
andrust_struct_or_enum_name
for two consecutively upper case letters. - Fix
rust_constant_name
not inserting _ around numbers.
Added
- Lots of regression tests for utility functions.
- Regression tests for
ProtobufWriter
on slices. - Basic support for
DEFAULT
(forINTEGER
, *String
,BOOLEAN
,ENUMERATED
and some tuple/transparent types) - Parsing (and ignoring) of
WITH COMPONENTS
constraints - Resolving symbols across multiple module descriptions.
- Support ASN
NULL
type
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_type
instead 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
SEQUENCE
definitions (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
CHOICE
andENUMERATED
types Reader
,Writer
traits 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
INTEGER
constants - Support for extensible
SEQUENCE
s - Support for extensible
INTEGER
s - Support for
BIT STRING
, as well as theSIZE
constraint, constants, and the extensible flag - Support for
IA5String
, as well as theSIZE
constraint, and the extensible flag - Support for
SIZE
constraints forOCTET STRING
s - Support for
SIZE
constraints forUTF8String
s - Support for
SIZE
constraints forSEQUENCE OF
s - Support for
SET
s andSET OF
s* - Support for extensible
SET
s - Support for
SIZE
constraints forSET OF
s TagResolver
to properly resolve Tags of ASN.1 typessyn::common::Constraint
which hasconst TAG: Tag
and 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
UperSerializer
which 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
FROM
directives and module definitions - The module
crate::io::uper
is 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
OPTIONAL
type is now represented asoptional
instead ofoption
in#[asn(..)]
- The protobuf serializer is now optional and can be enabled with the
protobuf
feature flag - Deprecated
Protobuf
trait which is replaced byProtobufReader
andProtobufWriter
that use the commonReadable
andWritable
traits
asn1rs v0.2.0-alpha3
0.2.0-alpha3 (Oct 14, 2020)
Fixes
- Missing CI checks on non-default features
Added
- Support for
SET
s andSET OF
s* - Support for extensible
SET
s - Support for
SIZE
constraints forSET OF
s TagResolver
to properly resolve Tags of ASN.1 typessyn::common::Constraint
which hasconst TAG: Tag
and implementation for all generated constraint types
* For SET OF
only BASIC-PER encoding is supported currently, see #20
Changes
- The ASN.1
OPTIONAL
type is now represented asoptional
instead ofoption
in#[asn(..)]
- The protobuf serializer is now optional and can be enabled with the
protobuf
feature 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
INTEGER
constants - Support for extensible
SEQUENCE
s - Support for extensible
INTEGER
s - Support for
BIT STRING
, as well as theSIZE
constraint, constants, and the extensible flag - Support for
IA5String
, as well as theSIZE
constraint, and the extensible flag - Support for
SIZE
constraints forOCTET STRING
s - Support for
SIZE
constraints forUTF8String
s - Support for
SIZE
constraints forSEQUENCE OF
s - ASN.1 Support Overview to README
Changes
- Parse/Accept ObjectIdentifier in
FROM
directives and module definitions - The whole module
crate::io::uper
is 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
CHOICE
andENUMERATED
types Reader
,Writer
traits 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
UperSerializer
which 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());
}