diff --git a/openssl/src/pkcs12.rs b/openssl/src/pkcs12.rs index 6d7e8ba7..8c884e7f 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 ec17cbe2..eb517f80 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