diff options
| author | Steven Fackler <[email protected]> | 2018-05-24 20:35:06 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2018-05-24 21:07:36 -0700 |
| commit | a774c0c5f2867b33735bec9e1cb6c9870a5ece08 (patch) | |
| tree | fcef80401d7a31c1349b877f72b7318b67bd557e /openssl/src/ssl | |
| parent | Add some digest support (diff) | |
| download | rust-openssl-a774c0c5f2867b33735bec9e1cb6c9870a5ece08.tar.xz rust-openssl-a774c0c5f2867b33735bec9e1cb6c9870a5ece08.zip | |
Rename X509Ref::fingerprint to X509Ref::digest and avoid allocating
Diffstat (limited to 'openssl/src/ssl')
| -rw-r--r-- | openssl/src/ssl/test.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/openssl/src/ssl/test.rs b/openssl/src/ssl/test.rs index 0d418d2c..f5ec7b29 100644 --- a/openssl/src/ssl/test.rs +++ b/openssl/src/ssl/test.rs @@ -295,8 +295,8 @@ run_test!(verify_callback_data, |method, stream| { match cert { None => false, Some(cert) => { - let fingerprint = cert.fingerprint(MessageDigest::sha1()).unwrap(); - fingerprint == node_id + let fingerprint = cert.digest(MessageDigest::sha1()).unwrap(); + node_id == &*fingerprint } } }); @@ -323,8 +323,8 @@ run_test!(ssl_verify_callback, |method, stream| { match x509.current_cert() { None => false, Some(cert) => { - let fingerprint = cert.fingerprint(MessageDigest::sha1()).unwrap(); - fingerprint == node_id + let fingerprint = cert.digest(MessageDigest::sha1()).unwrap(); + node_id == &*fingerprint } } }); @@ -424,10 +424,10 @@ run_test!(get_peer_certificate, |method, stream| { let ctx = SslContext::builder(method).unwrap(); let stream = Ssl::new(&ctx.build()).unwrap().connect(stream).unwrap(); let cert = stream.ssl().peer_certificate().unwrap(); - let fingerprint = cert.fingerprint(MessageDigest::sha1()).unwrap(); + let fingerprint = cert.digest(MessageDigest::sha1()).unwrap(); let node_hash_str = "59172d9313e84459bcff27f967e79e6e9217e584"; let node_id = Vec::from_hex(node_hash_str).unwrap(); - assert_eq!(node_id, fingerprint) + assert_eq!(node_id, &*fingerprint) }); #[test] |