Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
x509-parser = "0.18"

[patch.crates-io]
rcgen = { git = "https://github.com/sfackler/rcgen.git", branch = "explicit-dn" }

[profile.bench]
opt-level = 3
debug = false
Expand Down
15 changes: 15 additions & 0 deletions src/der.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,15 @@ pub(crate) enum Tag {
OctetString = 0x04,
OID = 0x06,
Enum = 0x0A,
UTF8String = 0x0C,
Sequence = CONSTRUCTED | 0x10, // 0x30
Set = CONSTRUCTED | 0x11, // 0x31
PrintableString = 0x13,
IA5String = 0x16,
UTCTime = 0x17,
GeneralizedTime = 0x18,
UniversalString = 0x1C,
BMPString = 0x1E,

#[expect(clippy::identity_op)]
ContextSpecificConstructed0 = CONTEXT_SPECIFIC | CONSTRUCTED | 0,
Expand Down Expand Up @@ -95,6 +101,15 @@ impl From<Tag> for u8 {
} // XXX: narrowing conversion.
}

impl Tag {
/// Equivalent to `u8::from(self)` but usable in `const` context, since
/// `From` is not const.
#[expect(clippy::as_conversions)]
pub(crate) const fn as_u8(self) -> u8 {
self as u8
}
}

#[inline(always)]
pub(crate) fn expect_tag_and_get_value_limited<'a>(
input: &mut untrusted::Reader<'a>,
Expand Down
Loading
Loading