Skip to content

Commit 7827172

Browse files
authored
x509-cert: use ErrorKind::Value for overlength serial (#988)
This at least surfaces that the error has to do with an integer field, which would've been helpful with tracing it down to SerialNumber. `Overlength` has a bit of a specific meaning in the context of the `ErrorKind`, namely it's used for framing errors, which isn't what's occurring here. Perhaps the `der` documentation should help clarify this.
1 parent 91e9607 commit 7827172

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

x509-cert/src/serial_number.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl<'a> DecodeValue<'a> for SerialNumber {
8080
// since some X.509 implementations interpret the limit of 20 bytes to refer
8181
// to the pre-encoded value.
8282
if inner.len() > SerialNumber::MAX_DECODE_LEN {
83-
return Err(ErrorKind::Overlength.into());
83+
return Err(Tag::Integer.value_error());
8484
}
8585

8686
Ok(Self { inner })

0 commit comments

Comments
 (0)