dishmaker
dishmaker
After PR: - https://github.com/RustCrypto/formats/pull/1889 most cases now return error position, but few untreated errors remain, for example: https://github.com/RustCrypto/formats/blob/3ee0028ef967b0831df6fc6338e2620ea03efd43/der/src/asn1/generalized_time.rs#L112 https://github.com/RustCrypto/formats/blob/858f3af9df8398cb456ebe05b41f82e0335e66d8/der/src/asn1/integer/uint.rs#L330 https://github.com/RustCrypto/formats/blob/858f3af9df8398cb456ebe05b41f82e0335e66d8/der/src/asn1/oid.rs#L19
Resolves #1835 I made sure it does not add any runtime overhead, even when using the `"clarify"` feature. This PR is initial support. In future I'd like to add `Sequence`...
`AnyRef`, that allocates as `Any` with `alloc` feature
This PR moves `read_nested` out of `pub(crate) fn read_value`. Such trait function allows us to disable `read_nested` selectively for some primitive types, like `OctetStringRef`.
Depends on #1980 ```rust #[derive(Sequence)] pub struct OidAndImplicitSequence, } ```
Partially fixes - #1745 Derive macro support in future PR.
Note: I think it would be better for `SliceReader::read_nested` to return errors with relative ``` ErrorKind::Incomplete { expected_len: 3, actual_len: 2 }, ``` instead of absolute: ``` ErrorKind::Incomplete { expected_len:...
https://github.com/RustCrypto/formats/blob/bd840638835fcf66c4ffc3baed6d7c3b727c4ef3/der/src/decode.rs#L26-L28 I think associated `Error` would be useful inside `Reader` trait. [^1] ## Motivation To prove usefulness, suppose we want to return annotated errors with `.field` stacktrace. Example of such...
Sometimes, when encoding big DER structures, `value_len` gets called many times. In order to limit amount of recursive calls, this wrapper caches the computed length, until the value gets encoded.
I have a pretty well-written `#[cfg(feature = "clarify")]` - gated writer that pretty-prints DER. Proposal: To add `Encode::to_hex_clarify`, that annotates tags and types. Example of PKCS#15: ```xml 30 3E 30...