We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ObjectIdentifier::decode_value
1 parent 5755d9b commit 19aa61bCopy full SHA for 19aa61b
der/src/asn1/oid.rs
@@ -16,11 +16,14 @@ impl<'a, const MAX_SIZE: usize> DecodeValue<'a> for ObjectIdentifier<MAX_SIZE> {
16
let mut buf = [0u8; MAX_SIZE];
17
let slice = buf
18
.get_mut(..header.length().try_into()?)
19
- .ok_or_else(|| Self::TAG.length_error())?;
+ .ok_or_else(|| reader.error(Self::TAG.length_error()))?;
20
21
let actual_len = reader.read_into(slice)?.len();
22
debug_assert_eq!(actual_len, header.length().try_into()?);
23
- Ok(ObjectIdentifierRef::from_bytes(slice)?.try_into()?)
+
24
+ ObjectIdentifierRef::from_bytes(slice)
25
+ .and_then(TryInto::try_into)
26
+ .map_err(|oid_err| reader.error(Error::from(oid_err).kind()))
27
}
28
29
0 commit comments