diff options
-rw-r--r-- | Cargo.lock | 24 | ||||
-rw-r--r-- | crates/common/certificate/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/common/certificate/src/lib.rs | 12 |
3 files changed, 23 insertions, 15 deletions
@@ -85,9 +85,9 @@ checksum = "47253b98986dafc7a3e1cf3259194f1f47ac61abb57a57f46ec09e48d004ecda" [[package]] name = "asn1-rs" -version = "0.3.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ff05a702273012438132f449575dbc804e27b2f3cbe3069aa237d26c98fa33" +checksum = "cf6690c370453db30743b373a60ba498fc0d6d83b11f4abfd87a84a075db5dd4" dependencies = [ "asn1-rs-derive", "asn1-rs-impl", @@ -101,9 +101,9 @@ dependencies = [ [[package]] name = "asn1-rs-derive" -version = "0.1.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ "proc-macro2 1.0.40", "quote 1.0.20", @@ -773,9 +773,9 @@ checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" [[package]] name = "der-parser" -version = "7.0.0" +version = "8.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe398ac75057914d7d07307bf67dc7f3f574a26783b4fc7805a20ffa9f506e82" +checksum = "42d4bc9b0db0a0df9ae64634ac5bdefb7afcb534e182275ca0beadbe486701c1" dependencies = [ "asn1-rs", "displaydoc", @@ -1854,9 +1854,9 @@ dependencies = [ [[package]] name = "oid-registry" -version = "0.4.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e20717fa0541f39bd146692035c37bedfa532b3e5071b35761082407546b2a" +checksum = "7d4bda43fd1b844cbc6e6e54b5444e2b1bc7838bce59ad205902cccbb26d6761" dependencies = [ "asn1-rs", ] @@ -3362,9 +3362,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a713421342a5a666b7577783721d3117f1b69a393df803ee17bb73b1e122a59" +checksum = "60db860322da191b40952ad9affe65ea23e7dd6a5c442c2c42865810c6ab8e6b" dependencies = [ "ansi_term", "sharded-slab", @@ -3808,9 +3808,9 @@ dependencies = [ [[package]] name = "x509-parser" -version = "0.13.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb9bace5b5589ffead1afb76e43e34cff39cd0f3ce7e170ae0c29e53b88eb1c" +checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" dependencies = [ "asn1-rs", "base64", diff --git a/crates/common/certificate/Cargo.toml b/crates/common/certificate/Cargo.toml index 4e9cb7af..bf6299b3 100644 --- a/crates/common/certificate/Cargo.toml +++ b/crates/common/certificate/Cargo.toml @@ -12,7 +12,7 @@ rcgen = { version = "0.9", features = ["pem", "zeroize"] } sha-1 = "0.10" thiserror = "1.0" time = "0.3" -x509-parser = "0.13" +x509-parser = "0.14" zeroize = "1.5" [dev-dependencies] diff --git a/crates/common/certificate/src/lib.rs b/crates/common/certificate/src/lib.rs index f7ce03f5..0c81a73d 100644 --- a/crates/common/certificate/src/lib.rs +++ b/crates/common/certificate/src/lib.rs @@ -49,12 +49,20 @@ impl PemCertificate { pub fn not_before(&self) -> Result<String, CertificateError> { let x509 = PemCertificate::extract_certificate(&self.pem)?; - Ok(x509.tbs_certificate.validity.not_before.to_rfc2822()) + x509.tbs_certificate + .validity + .not_before + .to_rfc2822() + .map_err(CertificateError::X509Error) } pub fn not_after(&self) -> Result<String, CertificateError> { let x509 = PemCertificate::extract_certificate(&self.pem)?; - Ok(x509.tbs_certificate.validity.not_after.to_rfc2822()) + x509.tbs_certificate + .validity + .not_after + .to_rfc2822() + .map_err(CertificateError::X509Error) } pub fn thumbprint(&self) -> Result<String, CertificateError> { |