From 7c171a6ccc5669fbcdb03501d9b1caf71f27132d Mon Sep 17 00:00:00 2001 From: goldlinker Date: Thu, 23 Oct 2025 16:51:52 +0800 Subject: [PATCH] chore: fix a large number of spelling issues Signed-off-by: goldlinker --- README.md | 2 +- UPGRADING.md | 2 +- src/der/parser.rs | 2 +- src/lib.rs | 2 +- tests/constructed.rs | 4 ++-- tests/der_parser.rs | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 43991cc..4af37a2 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/UPGRADING.md b/UPGRADING.md index 3df0ed2..2162e2d 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -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()` diff --git a/src/der/parser.rs b/src/der/parser.rs index 9a35b64..6160a0e 100644 --- a/src/der/parser.rs +++ b/src/der/parser.rs @@ -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 diff --git a/src/lib.rs b/src/lib.rs index 5cfcb41..0e1eedd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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: diff --git a/tests/constructed.rs b/tests/constructed.rs index b54c2cf..e521da6 100644 --- a/tests/constructed.rs +++ b/tests/constructed.rs @@ -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", )), }, }, @@ -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] diff --git a/tests/der_parser.rs b/tests/der_parser.rs index 97ba044..2332150 100644 --- a/tests/der_parser.rs +++ b/tests/der_parser.rs @@ -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))); @@ -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]