diff options
author | Jake McGinty <me@jake.su> | 2018-05-15 19:31:17 -0700 |
---|---|---|
committer | Jake McGinty <me@jake.su> | 2018-05-15 19:31:17 -0700 |
commit | fc76d67a4f7b6ce537aa69e4c670c71071b1ede0 (patch) | |
tree | d0a405e5f9ba4a284a725dc2b7019606a3a4db2c | |
parent | global: upgrade snow, x25519-dalek and related deps (diff) | |
download | wireguard-rs-fc76d67a4f7b6ce537aa69e4c670c71071b1ede0.tar.xz wireguard-rs-fc76d67a4f7b6ce537aa69e4c670c71071b1ede0.zip |
deps: upgrade to subtle 0.6
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 6 | ||||
-rw-r--r-- | src/cookie.rs | 6 |
3 files changed, 7 insertions, 7 deletions
@@ -1465,7 +1465,7 @@ dependencies = [ "socket2 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "structopt 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "structopt-derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "subtle 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "subtle 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -41,15 +41,15 @@ lazy_static = "^1" libc = { git = "https://github.com/rust-lang/libc" } log = "^0.4" hex = "^0.3" -notify = "4.0.0" +notify = "^4.0" rand = "0.5.0-pre.2" nix = { git = "https://github.com/mcginty/nix", branch = "ipv6-pktinfo"} mio = "^0.6" pnet_packet = "^0.21" snow = { git = "https://github.com/mcginty/snow", features = ["ring-accelerated"], branch = "wireguard" } socket2 = "^0.3" -subtle = "^0.5" -tokio = "^0.1.5" +subtle = "^0.6" +tokio = "^0.1.6" tokio-io = "^0.1" tokio-core = "^0.1" tokio-uds = "^0.1" diff --git a/src/cookie.rs b/src/cookie.rs index cbd3b89..4a1f77f 100644 --- a/src/cookie.rs +++ b/src/cookie.rs @@ -6,7 +6,7 @@ use consts::COOKIE_REFRESH_TIME; use message::CookieReply; use failure::{Error, err_msg}; use rand::{self, RngCore}; -use subtle; +use subtle::ConstantTimeEq; use std::time::Instant; pub struct ValidatorMac2 { @@ -51,7 +51,7 @@ impl Validator { debug_assert!(mac.len() == 16); let our_mac = blake2s(16, self.mac1_key.as_bytes(), mac_input); - ensure!(subtle::slices_equal(mac, our_mac.as_bytes()) == 1, "mac mismatch"); + ensure!(mac.ct_eq(our_mac.as_bytes()).unwrap_u8() == 1, "mac mismatch"); Ok(()) } @@ -62,7 +62,7 @@ impl Validator { let cookie = blake2s(16, &self.mac2.secret, source); let mac2 = blake2s(16, cookie.as_bytes(), &message[..message.len()-16]); - ensure!(subtle::slices_equal(mac2.as_bytes(), &message[..message.len()-16]) == 1, "mac mismatch"); + ensure!(mac2.as_bytes().ct_eq(&message[..message.len()-16]).unwrap_u8() == 1, "mac mismatch"); Ok(()) } |