summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-18 13:10:47 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-18 13:10:47 -0400
commitbcc1368c77d6ed8ac7f8bd81acdec7bb2da9f925 (patch)
tree1e43e2b3575efb909dbc6cd4f88b6314709dbb34
parentac64e007945637489101d0d35d830eb8584f5505 (diff)
parent9799cc90b06d4e9e165c0927092274066ca45a66 (diff)
downloadtor-bcc1368c77d6ed8ac7f8bd81acdec7bb2da9f925.tar.gz
tor-bcc1368c77d6ed8ac7f8bd81acdec7bb2da9f925.zip
Merge branch 'maint-0.3.4'
-rw-r--r--src/rust/crypto/lib.rs8
-rw-r--r--src/rust/crypto/rand/mod.rs10
-rw-r--r--src/rust/crypto/rand/rng.rs4
3 files changed, 10 insertions, 12 deletions
diff --git a/src/rust/crypto/lib.rs b/src/rust/crypto/lib.rs
index b349664dbe..b4250dec34 100644
--- a/src/rust/crypto/lib.rs
+++ b/src/rust/crypto/lib.rs
@@ -29,9 +29,17 @@
// External crates from cargo or TOR_RUST_DEPENDENCIES.
extern crate digest;
extern crate libc;
+extern crate rand_core;
+
+// External dependencies for tests.
+#[cfg(test)]
+extern crate rand as rand_crate;
// Our local crates.
extern crate external;
+#[cfg(not(test))]
+#[macro_use]
+extern crate tor_log;
pub mod digests; // Unfortunately named "digests" plural to avoid name conflict with the digest crate
pub mod rand;
diff --git a/src/rust/crypto/rand/mod.rs b/src/rust/crypto/rand/mod.rs
index 6b3058ad58..82d02a70bb 100644
--- a/src/rust/crypto/rand/mod.rs
+++ b/src/rust/crypto/rand/mod.rs
@@ -2,15 +2,5 @@
// Copyright (c) 2018, isis agora lovecruft
// See LICENSE for licensing information
-// External dependencies
-#[cfg(test)]
-extern crate rand;
-extern crate rand_core;
-
// Internal dependencies
-extern crate external;
-#[cfg(not(test))]
-#[macro_use]
-extern crate tor_log;
-
pub mod rng;
diff --git a/src/rust/crypto/rand/rng.rs b/src/rust/crypto/rand/rng.rs
index d5fae8a32e..07a0a7bdc7 100644
--- a/src/rust/crypto/rand/rng.rs
+++ b/src/rust/crypto/rand/rng.rs
@@ -130,8 +130,8 @@ mod internal {
#[cfg(test)]
mod internal {
// It doesn't matter if we pretend ChaCha is a CSPRNG in tests.
- pub use rand::ChaChaRng as TorRng;
- pub use rand::ChaChaRng as TorStrongestRng;
+ pub use rand_crate::ChaChaRng as TorRng;
+ pub use rand_crate::ChaChaRng as TorStrongestRng;
}
// Finally, expose the public functionality of whichever appropriate internal