Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ encode and decode ASN.1 objects in binary.
[X.690] also defines Distinguished Encoding Rules (DER), which is BER with added rules to
ensure canonical and unequivocal binary representation of objects.

The choice of which one to use is usually guided by the speficication of the data format based
The choice of which one to use is usually guided by the specification of the data format based
on BER or DER: for example, X.509 uses DER as encoding representation.

See the related modules for object definitions, functions, and example:
Expand Down
2 changes: 1 addition & 1 deletion UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Header names have changed:

Changing the names should be enough for upgrades.

To eventually ease upgrades, a new module (`der_parser::ber::compat`) has been added, to provide aliases for these types. It must be imported explicitely.
To eventually ease upgrades, a new module (`der_parser::ber::compat`) has been added, to provide aliases for these types. It must be imported explicitly.

Header fields are now private. Getters/setters have been added, and must be used to access/modify fields. Replace:
- `hdr.len` by `hdr.length()`
Expand Down
2 changes: 1 addition & 1 deletion src/der/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pub fn parse_der_integer(i: &[u8]) -> DerResult<'_> {
/// Read an bitstring value
///
/// To access the content as plain bytes, you will have to
/// interprete the resulting tuple which will contain in
/// interpret the resulting tuple which will contain in
/// its first item the number of padding bits left at
/// the end of the bit string, and in its second item
/// a `BitStringObject` structure which will, in its sole
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//! [X.690] also defines Distinguished Encoding Rules (DER), which is BER with added rules to
//! ensure canonical and unequivocal binary representation of objects.
//!
//! The choice of which one to use is usually guided by the speficication of the data format based
//! The choice of which one to use is usually guided by the specification of the data format based
//! on BER or DER: for example, X.509 uses DER as encoding representation.
//!
//! See the related modules for object definitions, functions, and example:
Expand Down
4 changes: 2 additions & 2 deletions tests/constructed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ fn struct02() {
a: Attr {
oid: Oid::from(&[2, 5, 4, 10]).unwrap(), // organizationName
val: BerObject::from_obj(BerObjectContent::IA5String(
"Internet Widgits Pty Ltd",
"Internet Widgets Pty Ltd",
)),
},
},
Expand Down Expand Up @@ -275,7 +275,7 @@ fn struct02() {
//
assert_eq!(parsed.1.l[0].a.val.as_str(), Ok("FR"));
assert_eq!(parsed.1.l[1].a.val.as_str(), Ok("Some-State"));
assert_eq!(parsed.1.l[2].a.val.as_str(), Ok("Internet Widgits Pty Ltd"));
assert_eq!(parsed.1.l[2].a.val.as_str(), Ok("Internet Widgets Pty Ltd"));
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions tests/der_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ fn test_der_seq_dn() {
])]),
DerObject::from_set(vec![DerObject::from_seq(vec![
DerObject::from_obj(BerObjectContent::OID(Oid::from(&[2, 5, 4, 10]).unwrap())), // organizationName
DerObject::from_obj(BerObjectContent::UTF8String("Internet Widgits Pty Ltd")),
DerObject::from_obj(BerObjectContent::UTF8String("Internet Widgets Pty Ltd")),
])]),
]);
assert_eq!(parse_der(&bytes), Ok((empty, expected)));
Expand All @@ -518,7 +518,7 @@ fn test_der_seq_dn_defined() {
])]),
DerObject::from_set(vec![DerObject::from_seq(vec![
DerObject::from_obj(BerObjectContent::OID(Oid::from(&[2, 5, 4, 10]).unwrap())), // organizationName
DerObject::from_obj(BerObjectContent::UTF8String("Internet Widgits Pty Ltd")),
DerObject::from_obj(BerObjectContent::UTF8String("Internet Widgets Pty Ltd")),
])]),
]);
#[inline]
Expand Down