summaryrefslogtreecommitdiff
path: root/openssl/src/pkcs12.rs
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2017-03-06 09:59:00 +0100
committerSebastian Thiel <byronimo@gmail.com>2017-03-06 09:59:00 +0100
commitf92ac2477b3f857dfe2399a304033d9bcf3d1b3e (patch)
tree8f20e1291ceaa2de03f6e7a97a3d99111080b58b /openssl/src/pkcs12.rs
parent357b994fac7038f727e14206a300330bf4419093 (diff)
downloadrust-openssl-f92ac2477b3f857dfe2399a304033d9bcf3d1b3e.zip
Add test to run into issue with stack.len()
Diffstat (limited to 'openssl/src/pkcs12.rs')
-rw-r--r--openssl/src/pkcs12.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/openssl/src/pkcs12.rs b/openssl/src/pkcs12.rs
index 9f014af6..31864802 100644
--- a/openssl/src/pkcs12.rs
+++ b/openssl/src/pkcs12.rs
@@ -197,6 +197,17 @@ mod test {
}
#[test]
+ fn parse_empty_chain() {
+ let der = include_bytes!("../test/keystore-empty-chain.p12");
+ let pkcs12 = Pkcs12::from_der(der).unwrap();
+ let parsed = pkcs12.parse("cassandra").unwrap();
+
+
+ assert_eq!(parsed.chain.len(), 0);
+ assert_eq!(parsed.chain.into_iter().collect::<Vec<_>>().len(), 0);
+ }
+
+ #[test]
fn create() {
let subject_name = "ns.example.com";
let rsa = Rsa::generate(2048).unwrap();