Uh oh!
There was an error while loading. Please reload this page.
Add custom error types to the Decode and DecodeValue traits. - #1055
Conversation
tarcieri
commented
May 8, 2023
Just to set expectations: it will probably be a few months before we're ready to start making breaking changes again |
Uh oh!
There was an error while loading. Please reload this page.
turbocool3r
commented
May 8, 2023
That's ok, I'll leave this PR in place until it can be accepted. |
It's possible to make breaking changes now. However, I've opened #1328 which provides a less invasive alternative: it allows That said, I think this approach is still interesting, and closer to e.g. what |
@turbocool3r if you can get this PR green we can consider it over #1328. |
turbocool3r
commented
Jan 22, 2024
Ok, I'll try to do this by Wednesday |
1ff2bf5 to
5638fc3Compareturbocool3r
commented
Jan 23, 2024
It seems this won't be completely green because there are some dependencies on external crates like There also was an issue with the |
tarcieri
commented
Jan 23, 2024
Err, how so? |
turbocool3r
commented
Jan 23, 2024
tarcieri
commented
Jan 23, 2024
Aah, in |
5638fc3 to
58468d3Compareturbocool3r
commented
Jan 23, 2024
It would be nice. I think we need to first get this as it goes to see the complete list of crates that need to be modified. |
turbocool3r
commented
Jan 23, 2024
Yes, it seems it's only ecdsa, not signature. |
turbocool3r
commented
Feb 13, 2024
Hey, how about that pull request? I could probably do that myself to save some time. |
tarcieri
commented
Feb 13, 2024
Sorry, I've been meaning to get to it and I'd love to land this, but if you'd like to go for it that works too. It's going to be oddly circular so you need to make a PR to https://github.com/rustcrypto/formats which uses a |
turbocool3r
commented
Feb 14, 2024
Did you mean the https://github.com/RustCrypto/signatures repo? By this branch do you mean my fork or some other branch? |
tarcieri
commented
Feb 14, 2024
Err sorry, yes https://github.com/RustCrypto/signatures You'll need to point to your branch on your fork for both this repo when updating signatures and again in a circular manner in your fork of |
58468d3 to
97bf668CompareGoes in pair with [this](RustCrypto/formats#1055) PR to `formats`.
97bf668 to
d477874Compareturbocool3r
commented
Feb 14, 2024
Seems all green now, the |
tarcieri
commented
Feb 14, 2024
Thanks, will review and try to get this merged ASAP |
turbocool3r
commented
Feb 14, 2024
Thanks! |
Uh oh!
There was an error while loading. Please reload this page.
d477874 to
b48d95dCompareGoes in pair with [this](RustCrypto/formats#1055) PR to `formats`.
Goes with this `formats` PR: RustCrypto/formats#1055
This signature was missed in RustCrypto#1055
This signature was missed in #1055
Goes with this `formats` PR: RustCrypto/formats#1055
## Added - Custom error types support to the `Decode` and `DecodeValue` traits (#1055) - `EncodingRules` enum (#1321) - `Decode::from_ber` (#1389) - Documentation for field-level `tag_mode` attribute (#1401) - `Hash` implementation for `AlgorithmIdentifier` (#1414) - `SequenceRef::as_bytes` and `AsRef<[u8]>` impl (#1454) - `Reader::peek_into` (#1478) - `GeneralString` variant to `Tag` (#1512) - Conversions from `OctetString(Ref)` to `Vec`/`Bytes` (#1540) - Custom error types in derive macros (#1560) - Support for tags beyond 30 (#1651) - Const `::new` to `Length`, `BytesRef`, and `AnyRef` (#1713) - Const `GeneralizedTime::from_date_time` (#1718) - `Decode::from_der_partial` (#1725) - Conversions between `BitStringRef`/`OctetStringRef` and `[u8; N]` (#1731) - Add class bits consts for Application and Private tag support (#1721) - conversions between `heapless:Vec<u8>` and `OctetStringRef` (#1735) - `IsConstructed` trait, impl'ed on any `FixedTag` (#1744) - Implement `Hash` for `SetOf` (#1764) - Implement `Uint`/`Int` conversions from native types (#1762) - Support for `APPLICATION`, `CONTEXT-SPECIFIC` and `PRIVATE` tags (#1819, #1825, #1944) - Support `Cow<[u8]>` in `derive(Sequence)` (#1850) - `diagnostic::on_unimplemented` attributes (#1876) - `Reader::read_value`, auto-nest `DecodeValue` (#1877, #1895, #1897, #1901) - Indefinite length support for BER (#1884, #1885, #1894, #1900, #1902, #1910) - Constructed OctetString support (#1899, #1922) - string conversions, predicate methods for EncodingRules (#1903, #1953) - `Any::header` (#1935) - `Tag::RelativeOid` (#1942) - `ber` feature (#1948, #1950) - Hash derive for `StringOwned` and `Ia5String` (#1973) - Implement `DecodeValue/EncodeValue/Tagged` for `Cow` (#2093) - Add doc examples for `EncodeValue`, `Encode`, `DecodeValue`, `Decode`, `Error`, `ErrorKind`, `Tagged`, `FixedTag`, `IsConstructed`, `Tag`, `Length`, `Header` (#2075, #2071, #2070, #2064, #2058, #2052, #2053, #2051) - `SequenceRef::new` (#2224) ## Changed - Return `Tag::Integer.length_error()` on empty ints (#1400) - Allow all blanket impls on `?Sized` types (#1451) - Refactor `Tag::peek` (#1479) - Refactor `Header::peek` (#1480) - Use `core::error::Error` (#1553) - Use 2024 edition, bump MSRV to 1.85 (#1670) - Bump `const-oid` to v0.10 (#1676) - Reject zero lengths reads (#1716) - Deprecate `TagNumber::new` (#1727) - Use strict context-specific skipping condition (equal tag numbers only) (#1740) - Const `Any::to_ref`, `BytesOwned::to_ref` (#1797) - Return `ErrorKind::Noncanonical` in `EXPLICIT` when primitive (#1818) - Use `read_nested` to check length of `IMPLICIT` types (#1739) - Simplify `From<&UintRef<'a>>` for `Uint` (#1840) - Make `ObjectIdentifier<MAX_SIZE>` impls generic (#1851) - Extract `reader::position::Position` (#1880) - Make `Reader` cloneable (#1883) - Simplify `Header::peek` and `Tag::peek` (#1886) - Improve constructed bit handling (#1919) - Use fat pointer in `OctetStringRef`, consolidate bytes/string modules, improve internal ref types (#1920, #1921, #1998, #2040) - Change constructor `Header::new`, add `Header::with_length`, tests for constructed octet string (#1931, #1930) - Simplify `der_cmp` for `Length` (#1997) - Rename variable encoder -> writer and improve example (#2078) - Have `PemReader` decode to `Cow::Owned` (#2094) - Only sort `SET OF` types with `EncodingRules::Der` (#2219) - `SetOf` and `SequenceOf` now require `heapless` feature (#2220, #2229) ## Fixed - Append in `Encode::encode_to_vec` (#1760) - Derive optional OCTET/BIT STRING on `Option<&[u8]>` (#1737) - X.680 tag order: compare class and number first (#1790) - BMPString compatibility in derive macros (#1793) - `Tag::peek_optional` for 6-byte and 7+ byte tags (#1804) - `Header::peek` for 11-byte tag-lengths (#1828) - Panic in `value_cmp`: add `Iterator::size_hint` (#1830) - Error position tracking improvements (#1889, #2080, #2079) - Bound `Decode(Value)::Error` on `core::error::Error` (#2137) - Have `SetOf(Vec)::insert` check for duplicates (#2217) ## Removed - `TagNumber::N0..N30` consts (#1724) - 256MiB limit on `Length` (#1726) - Generic `<T>` from `Reader::finish` (#1833) - Deprecated `SetOf(Vec)::add` methods (#2232) - `SequenceRef` lifetime (#2224)
## Added - Custom error types support to the Decode and DecodeValue traits (#1055) - PrivateKeyInfoRef / PrivateKeyInfoOwned type aliases (#1483) - Implement core::error::Error trait for Error (#2302) - Implement DecodePrivateKey/EncodePrivateKey traits for PrivateKeyInfoOwned (#2306) - KeyError enum (#2305) - ctutils feature (#2308) - getrandom feature (#2311) ## Changed - Eagerly decode PEM labels for better error messages (#1163) - Use pbes2::Parameters::generate_recommended (#1430, #2296) - Make PrivateKeyInfo generic around its backing storage (#1483) - Bump rand_core to 0.9 (#1658) - Use 2024 edition; bump MSRV to 1.85 (#1670) - Bump rand_core to v0.10 (#2198) - Error::KeyMalformed now wraps an inner KeyError for providing more detail (#2305) - Use TryCryptoRng instead of CryptoRng (#2309) ## Removed - subtle feature (#2308)
Adds support for specifying custom error types for the
Encode,Decode,EncodeValue,DecodeValue,DerOrdandValueOrdtraits (see #1053).