diff --git a/Cargo.toml b/Cargo.toml index 66fb38c1..5d007a12 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ categories = ["network-programming", "cryptography"] untrusted = "0.5.1" base64 = "0.6" log = { version = "0.3.6", optional = true } -ring = { version = "0.12", features = ["rsa_signing"] } +ring = { version = "0.12.1", features = ["rsa_signing"] } webpki = { git = "https://github.com/briansmith/webpki" } sct = "0.2" diff --git a/src/hash_hs.rs b/src/hash_hs.rs index 8d4c6e37..64be38ae 100644 --- a/src/hash_hs.rs +++ b/src/hash_hs.rs @@ -24,15 +24,6 @@ pub struct HandshakeHash { buffer: Vec, } -// This hack is needed because rust doesn't provide reference -// equality: in other words given a and b of type &T, are -// the references for the same object? -fn hash_eq(ha: &'static digest::Algorithm, hb: &'static digest::Algorithm) -> bool { - let a = digest::digest(ha, &[]); - let b = digest::digest(hb, &[]); - a.as_ref() == b.as_ref() -} - impl HandshakeHash { pub fn new() -> HandshakeHash { HandshakeHash { @@ -62,7 +53,7 @@ impl HandshakeHash { match self.alg { None => {}, Some(started) => { - if !hash_eq(started, alg) { + if started != alg { // hash type is changing warn!("altered hash to HandshakeHash::start_hash"); return false;