summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2019-07-09 17:23:28 +0200
committerLinus Färnstrand <linus@mullvad.net>2019-07-10 13:36:30 +0200
commitdb0a74516a8cdfe68094084ff36f8cd0ce2f8c78 (patch)
treeb02e94b3445aa14189508dc8bd6142d6c9d17aeb
parenteedff7586befae446c478357e15d2633eea2a28a (diff)
downloadmullvadvpn-db0a74516a8cdfe68094084ff36f8cd0ce2f8c78.tar.xz
mullvadvpn-db0a74516a8cdfe68094084ff36f8cd0ce2f8c78.zip
Upgrade rand to 0.7.0
-rw-r--r--Cargo.lock4
-rw-r--r--mullvad-daemon/Cargo.toml2
-rw-r--r--talpid-types/Cargo.toml2
-rw-r--r--talpid-types/src/net/wireguard.rs5
4 files changed, 6 insertions, 7 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 213fd1343a..f092929b75 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1173,7 +1173,7 @@ dependencies = [
"mullvad-rpc 0.1.0",
"mullvad-types 0.1.0",
"parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2310,7 +2310,7 @@ dependencies = [
"base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ipnetwork 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)",
"x25519-dalek 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
diff --git a/mullvad-daemon/Cargo.toml b/mullvad-daemon/Cargo.toml
index 9f27f3f822..02b9792787 100644
--- a/mullvad-daemon/Cargo.toml
+++ b/mullvad-daemon/Cargo.toml
@@ -29,7 +29,7 @@ lazy_static = "1.0"
log = "0.4"
log-panics = "2.0.0"
parking_lot = "0.8"
-rand = "0.6"
+rand = "0.7"
regex = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
diff --git a/talpid-types/Cargo.toml b/talpid-types/Cargo.toml
index d18b212fe2..9fa2bd04a2 100644
--- a/talpid-types/Cargo.toml
+++ b/talpid-types/Cargo.toml
@@ -12,4 +12,4 @@ ipnetwork = "0.14"
base64 = "0.10"
hex = "0.3"
x25519-dalek = { version = "0.4.5", features = [ "std", "u64_backend" ], default-features = false }
-rand = "0.6"
+rand = "0.7"
diff --git a/talpid-types/src/net/wireguard.rs b/talpid-types/src/net/wireguard.rs
index d803197ebb..68beef9aa0 100644
--- a/talpid-types/src/net/wireguard.rs
+++ b/talpid-types/src/net/wireguard.rs
@@ -1,13 +1,12 @@
use crate::net::{Endpoint, GenericTunnelOptions, TransportProtocol};
use ipnetwork::IpNetwork;
+use rand::{rngs::OsRng, RngCore};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::{
fmt,
net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr},
};
-use rand::RngCore;
-
#[derive(Clone, Eq, PartialEq, Deserialize, Serialize, Debug)]
/// Wireguard tunnel parameters
@@ -73,7 +72,7 @@ impl PrivateKey {
pub fn new_from_random() -> Result<Self, rand::Error> {
let mut bytes = [0u8; 32];
- rand::rngs::OsRng::new()?.fill_bytes(&mut bytes);
+ OsRng.fill_bytes(&mut bytes);
Ok(Self::from(bytes))
}