Skip to content

Commit

Permalink
cert: quote RFC 5280 RE: lax serial numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpu committed Mar 13, 2023
1 parent 9802622 commit 71a699e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ pub(crate) fn lenient_certificate_serial_number(input: &mut untrusted::Reader) -
// * "The serial number MUST be a positive integer [...]"
//
// However, we don't enforce these constraints, as there are widely-deployed trust anchors
// and many X.509 implementations in common use that violate these constraints.
// and many X.509 implementations in common use that violate these constraints. This is called
// out by the same section of RFC 5280 as cited above:
// Note: Non-conforming CAs may issue certificates with serial numbers
// that are negative or zero. Certificate users SHOULD be prepared to
// gracefully handle such certificates.
der::expect_tag_and_get_value(input, der::Tag::Integer).map(|_| ())
}

Expand Down

0 comments on commit 71a699e

Please sign in to comment.