Skip to content

Commit

Permalink
Return a Stack in Pkcs12
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Nov 5, 2016
1 parent ed69d6b commit 8037258
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openssl/src/pkcs12.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -63,7 +63,7 @@ impl Pkcs12 {
pub struct ParsedPkcs12 {
pub pkey: PKey,
pub cert: X509,
pub chain: Vec<X509>,
pub chain: Stack<X509>,
}

#[cfg(test)]
Expand Down
6 changes: 6 additions & 0 deletions openssl/src/x509/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,12 @@ impl AsRef<X509Ref> for X509 {
}
}

impl AsRef<X509Ref> for X509Ref {
fn as_ref(&self) -> &X509Ref {
self
}
}

impl Borrow<X509Ref> for X509 {
fn borrow(&self) -> &X509Ref {
&*self
Expand Down

0 comments on commit 8037258

Please sign in to comment.