diff options
| author | Lionel Flandrin <[email protected]> | 2016-10-31 23:53:28 +0100 |
|---|---|---|
| committer | Lionel Flandrin <[email protected]> | 2016-11-01 21:23:18 +0100 |
| commit | 36bf0bb38750412e5c2700273a850f16398cc427 (patch) | |
| tree | 547b6ce043a53f6b0ae09ac7d8cbc57edbdebcd0 /openssl/src/ssl | |
| parent | Implement a generic Stack API to deal with OpenSSL stacks (diff) | |
| download | rust-openssl-36bf0bb38750412e5c2700273a850f16398cc427.tar.xz rust-openssl-36bf0bb38750412e5c2700273a850f16398cc427.zip | |
Replace GeneralNames by the new Stack API
Diffstat (limited to 'openssl/src/ssl')
| -rw-r--r-- | openssl/src/ssl/connector.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/openssl/src/ssl/connector.rs b/openssl/src/ssl/connector.rs index b2e00a81..c95b0fa1 100644 --- a/openssl/src/ssl/connector.rs +++ b/openssl/src/ssl/connector.rs @@ -256,7 +256,8 @@ mod verify { use std::str; use nid; - use x509::{X509StoreContext, X509, GeneralNames, X509Name}; + use x509::{X509StoreContext, X509, X509Name, GeneralName}; + use stack::Stack; use types::Ref; pub fn verify_callback(domain: &str, @@ -275,15 +276,16 @@ mod verify { fn verify_hostname(domain: &str, cert: &Ref<X509>) -> bool { match cert.subject_alt_names() { - Some(names) => verify_subject_alt_names(domain, &names), + Some(names) => verify_subject_alt_names(domain, names), None => verify_subject_name(domain, &cert.subject_name()), } } - fn verify_subject_alt_names(domain: &str, names: &GeneralNames) -> bool { + fn verify_subject_alt_names(domain: &str, + names: Stack<GeneralName>) -> bool { let ip = domain.parse(); - for name in names { + for name in &names { match ip { Ok(ip) => { if let Some(actual) = name.ipaddress() { |