diff --git a/pkcs7/src/revocation_info_choices.rs b/pkcs7/src/revocation_info_choices.rs index a332313c4..232a5acbc 100644 --- a/pkcs7/src/revocation_info_choices.rs +++ b/pkcs7/src/revocation_info_choices.rs @@ -19,7 +19,7 @@ use x509_cert::crl::CertificateList; #[allow(clippy::large_enum_variant)] pub enum RevocationInfoChoice<'a> { /// The CertificateList type gives a certificate revocation list (CRL). - Crl(CertificateList<'a>), + Crl(CertificateList), /// The OtherRevocationInfoFormat alternative is provided to support any /// other revocation information format without further modifications to diff --git a/x509-cert/Cargo.toml b/x509-cert/Cargo.toml index 0edbc7f2e..c180d878d 100644 --- a/x509-cert/Cargo.toml +++ b/x509-cert/Cargo.toml @@ -26,9 +26,8 @@ hex-literal = "0.3" rstest = "0.16" [features] -alloc = ["der/alloc"] arbitrary = ["std", "dep:arbitrary", "const-oid/arbitrary", "der/arbitrary", "spki/arbitrary"] -pem = ["alloc", "der/pem"] +pem = ["der/pem"] std = ["der/std", "spki/std"] [package.metadata.docs.rs] diff --git a/x509-cert/fuzz/src/bin/certreq.rs b/x509-cert/fuzz/src/bin/certreq.rs index 5e80e833d..4c0320fe5 100644 --- a/x509-cert/fuzz/src/bin/certreq.rs +++ b/x509-cert/fuzz/src/bin/certreq.rs @@ -1,8 +1,9 @@ #![no_main] use libfuzzer_sys::fuzz_target; +use x509_cert::der::Decode; use x509_cert::request::CertReq; fuzz_target!(|input: &[u8]| { - let _ = CertReq::try_from(input); + let _ = CertReq::from_der(input); }); diff --git a/x509-cert/fuzz/src/bin/certreqinfo.rs b/x509-cert/fuzz/src/bin/certreqinfo.rs index 9bcfe50e3..1263103a6 100644 --- a/x509-cert/fuzz/src/bin/certreqinfo.rs +++ b/x509-cert/fuzz/src/bin/certreqinfo.rs @@ -1,8 +1,9 @@ #![no_main] use libfuzzer_sys::fuzz_target; +use x509_cert::der::Decode; use x509_cert::request::CertReqInfo; fuzz_target!(|input: &[u8]| { - let _ = CertReqInfo::try_from(input); + let _ = CertReqInfo::from_der(input); }); diff --git a/x509-cert/src/attr.rs b/x509-cert/src/attr.rs index 4f7eaa77d..04b851b51 100644 --- a/x509-cert/src/attr.rs +++ b/x509-cert/src/attr.rs @@ -58,14 +58,6 @@ pub struct Attribute { pub values: SetOfVec, } -impl TryFrom<&[u8]> for Attribute { - type Error = Error; - - fn try_from(bytes: &[u8]) -> Result { - Self::from_der(bytes) - } -} - /// X.501 `Attributes` as defined in [RFC 2986 Section 4]. /// /// ```text diff --git a/x509-cert/src/crl.rs b/x509-cert/src/crl.rs index a75c504cb..6916783bd 100644 --- a/x509-cert/src/crl.rs +++ b/x509-cert/src/crl.rs @@ -10,7 +10,7 @@ use alloc::vec::Vec; use der::asn1::BitString; use der::{Sequence, ValueOrd}; -use spki::AlgorithmIdentifierRef; +use spki::AlgorithmIdentifierOwned; /// `CertificateList` as defined in [RFC 5280 Section 5.1]. /// @@ -25,9 +25,9 @@ use spki::AlgorithmIdentifierRef; /// [RFC 5280 Section 5.1]: https://datatracker.ietf.org/doc/html/rfc5280#section-5.1 #[derive(Clone, Debug, Eq, PartialEq, Sequence, ValueOrd)] #[allow(missing_docs)] -pub struct CertificateList<'a> { - pub tbs_cert_list: TbsCertList<'a>, - pub signature_algorithm: AlgorithmIdentifierRef<'a>, +pub struct CertificateList { + pub tbs_cert_list: TbsCertList, + pub signature_algorithm: AlgorithmIdentifierOwned, pub signature: BitString, } @@ -74,9 +74,9 @@ pub struct RevokedCert { /// [RFC 5280 Section 5.1]: https://datatracker.ietf.org/doc/html/rfc5280#section-5.1 #[derive(Clone, Debug, Eq, PartialEq, Sequence, ValueOrd)] #[allow(missing_docs)] -pub struct TbsCertList<'a> { +pub struct TbsCertList { pub version: Version, - pub signature: AlgorithmIdentifierRef<'a>, + pub signature: AlgorithmIdentifierOwned, pub issuer: Name, pub this_update: Time, pub next_update: Option