From 36b89b5d4c528ee5b995a49c0dc37d52e491dc65 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Fri, 15 Dec 2023 18:52:07 +0100 Subject: openpgp: Require the rand crate only for tests and RustCrypto. - Also, disable the default features and enable only what we need. --- openpgp/Cargo.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openpgp/Cargo.toml b/openpgp/Cargo.toml index 870814cb..de75a852 100644 --- a/openpgp/Cargo.toml +++ b/openpgp/Cargo.toml @@ -45,7 +45,6 @@ regex-syntax = "0.8" sha1collisiondetection = { version = "0.3.1", default-features = false, features = ["std"] } thiserror = "1.0.2" xxhash-rust = { version = "0.8", features = ["xxh3"] } -rand = { version = "0.8" } # At least 0.10.55 is needed due `no-ocb` check: # https://github.com/sfackler/rust-openssl/blob/master/openssl/CHANGELOG.md @@ -82,6 +81,7 @@ idea = { version = "0.5", optional = true, features = ["zeroize"] } md-5 = { version = "0.10", features = ["oid"], optional = true } num-bigint-dig = { version = "0.8", default-features = false, optional = true } p256 = { version = "0.13", optional = true, features = ["ecdh", "ecdsa"] } +rand = { version = "0.8", optional = true, default-features = false } rand_core = { version = "0.6", optional = true } ripemd = { version = "0.1", features = ["oid"], optional = true } rsa = { version = "0.9.0", optional = true } @@ -103,6 +103,7 @@ lalrpop = { version = "0.20", default-features = false } [dev-dependencies] quickcheck = { version = "1", default-features = false } +rand = { version = "0.8", default-features = false, features = ["std", "std_rng"] } rpassword = "7.0" criterion = { version = "0.5", features = ["html_reports"] } @@ -117,8 +118,8 @@ crypto-rust = [ "dep:md-5", "dep:num-bigint-dig", "dep:ripemd", "dep:rsa", "dep:sha2", "sha1collisiondetection/digest-trait", "sha1collisiondetection/oid", "dep:twofish", "dep:typenum", "dep:x25519-dalek", "dep:p256", - "dep:rand_core", "rand_core?/getrandom", "dep:ecdsa", "dep:aes-gcm", - "dep:dsa" + "dep:rand", "rand?/getrandom", "dep:rand_core", "rand_core?/getrandom", + "dep:ecdsa", "dep:aes-gcm", "dep:dsa" ] crypto-cng = [ "dep:cipher", "dep:eax", "dep:winapi", "dep:win-crypto-ng", -- cgit v1.2.3