diff --git a/openssl/src/pkcs12.rs b/openssl/src/pkcs12.rs index 6d7e8ba76494e8612f2ff12a1cdcbd44639debe2..8c884e7f2e21a33a9e6fee7bf102bd919af30faf 100644 --- a/openssl/src/pkcs12.rs +++ b/openssl/src/pkcs12.rs @@ -49,7 +49,7 @@ impl Pkcs12 { let pkey = PKey::from_ptr(pkey); let cert = X509::from_ptr(cert); - let chain = Stack::from_ptr(chain).into_iter().collect(); + let chain = Stack::from_ptr(chain); Ok(ParsedPkcs12 { pkey: pkey, @@ -63,7 +63,7 @@ impl Pkcs12 { pub struct ParsedPkcs12 { pub pkey: PKey, pub cert: X509, - pub chain: Vec, + pub chain: Stack, } #[cfg(test)] diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs index ec17cbe22cec5e0b4e5c3b7745f11a5d1a35131d..eb517f805863ea8976565c1bfbfaf0faae9150cd 100644 --- a/openssl/src/x509/mod.rs +++ b/openssl/src/x509/mod.rs @@ -480,6 +480,12 @@ impl AsRef for X509 { } } +impl AsRef for X509Ref { + fn as_ref(&self) -> &X509Ref { + self + } +} + impl Borrow for X509 { fn borrow(&self) -> &X509Ref { &*self