aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/x509/tests.rs
diff options
context:
space:
mode:
authorIan P. Cooke <[email protected]>2018-01-15 05:20:09 -0600
committerIan P. Cooke <[email protected]>2018-01-15 11:22:29 -0600
commit60337266abbd0c9eff47c78779441a6ce96ee01d (patch)
treed6a258e4d0db3f8e3c8c6d9b1654c35aeb8bdafb /openssl/src/x509/tests.rs
parentRelease openssl v0.10.2 (diff)
downloadrust-openssl-60337266abbd0c9eff47c78779441a6ce96ee01d.tar.xz
rust-openssl-60337266abbd0c9eff47c78779441a6ce96ee01d.zip
add support for rfc822Name (email) and uniformResourceIdentifier (uri) to GeneralName
Diffstat (limited to 'openssl/src/x509/tests.rs')
-rw-r--r--openssl/src/x509/tests.rs16
1 files changed, 13 insertions, 3 deletions
diff --git a/openssl/src/x509/tests.rs b/openssl/src/x509/tests.rs
index 2d9348e8..6f6b430a 100644
--- a/openssl/src/x509/tests.rs
+++ b/openssl/src/x509/tests.rs
@@ -92,13 +92,15 @@ fn test_subject_alt_name() {
let cert = X509::from_pem(cert).unwrap();
let subject_alt_names = cert.subject_alt_names().unwrap();
- assert_eq!(3, subject_alt_names.len());
- assert_eq!(Some("foobar.com"), subject_alt_names[0].dnsname());
+ assert_eq!(5, subject_alt_names.len());
+ assert_eq!(Some("example.com"), subject_alt_names[0].dnsname());
assert_eq!(subject_alt_names[1].ipaddress(), Some(&[127, 0, 0, 1][..]));
assert_eq!(
subject_alt_names[2].ipaddress(),
Some(&b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01"[..])
);
+ assert_eq!(Some("[email protected]"), subject_alt_names[3].email());
+ assert_eq!(Some("http://www.example.com"), subject_alt_names[4].uri());
}
#[test]
@@ -110,7 +112,7 @@ fn test_subject_alt_name_iter() {
let mut subject_alt_names_iter = subject_alt_names.iter();
assert_eq!(
subject_alt_names_iter.next().unwrap().dnsname(),
- Some("foobar.com")
+ Some("example.com")
);
assert_eq!(
subject_alt_names_iter.next().unwrap().ipaddress(),
@@ -120,6 +122,14 @@ fn test_subject_alt_name_iter() {
subject_alt_names_iter.next().unwrap().ipaddress(),
Some(&b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01"[..])
);
+ assert_eq!(
+ subject_alt_names_iter.next().unwrap().email(),
+ );
+ assert_eq!(
+ subject_alt_names_iter.next().unwrap().uri(),
+ Some("http://www.example.com")
+ );
assert!(subject_alt_names_iter.next().is_none());
}