aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake McGinty <me@jake.su>2018-05-15 19:31:17 -0700
committerJake McGinty <me@jake.su>2018-05-15 19:31:17 -0700
commitfc76d67a4f7b6ce537aa69e4c670c71071b1ede0 (patch)
treed0a405e5f9ba4a284a725dc2b7019606a3a4db2c
parentglobal: upgrade snow, x25519-dalek and related deps (diff)
downloadwireguard-rs-fc76d67a4f7b6ce537aa69e4c670c71071b1ede0.tar.xz
wireguard-rs-fc76d67a4f7b6ce537aa69e4c670c71071b1ede0.zip
deps: upgrade to subtle 0.6
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml6
-rw-r--r--src/cookie.rs6
3 files changed, 7 insertions, 7 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 0bb3d48..9dae82f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -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)",
diff --git a/Cargo.toml b/Cargo.toml
index b4059f7..4104144 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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(())
}