summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Matuszewski <igor@sequoia-pgp.org>2020-04-04 18:10:29 +0200
committerIgor Matuszewski <igor@sequoia-pgp.org>2020-04-06 16:41:34 +0200
commit583cb3def73457d9594d518679d03fcda1464180 (patch)
tree89270ddea8c83b08c15e8496477bc25d031978e2
parent488985f8f2e119c553f2d03d8bd87d49f45d8227 (diff)
openpgp: Introduce (mandatory, for now) crypto-nettle feature flag
-rw-r--r--openpgp/Cargo.toml6
-rw-r--r--openpgp/src/lib.rs3
-rw-r--r--sqv/Cargo.toml2
3 files changed, 8 insertions, 3 deletions
diff --git a/openpgp/Cargo.toml b/openpgp/Cargo.toml
index 375908f4..104cb6c5 100644
--- a/openpgp/Cargo.toml
+++ b/openpgp/Cargo.toml
@@ -32,7 +32,7 @@ lalrpop-util = "0.17"
lazy_static = "1.3"
libc = "0.2"
memsec = "0.5.6"
-nettle = "7"
+nettle = { version = "7", optional = true }
quickcheck = { version = "0.9", default-features = false }
rand = { version = "0.7", default-features = false }
regex = "1"
@@ -46,7 +46,9 @@ lalrpop = "0.17"
rpassword = "=4.0.3"
[features]
-default = ["compression"]
+default = ["compression", "crypto-nettle"]
+# TODO(#333): Allow for/implement more backends
+crypto-nettle = ["nettle"]
# The compression algorithms.
compression = ["compression-deflate", "compression-bzip2"]
diff --git a/openpgp/src/lib.rs b/openpgp/src/lib.rs
index f41eeba6..7d9a7670 100644
--- a/openpgp/src/lib.rs
+++ b/openpgp/src/lib.rs
@@ -54,6 +54,9 @@ extern crate lazy_static;
#[macro_use]
mod macros;
+#[cfg(not(feature = "crypto-nettle"))]
+compile_error!("Sequoia currently requires the Nettle cryptographic library for now");
+
// On debug builds, Vec<u8>::truncate is very, very slow. For
// instance, running the decrypt_test_stream test takes 51 seconds on
// my (Neal's) computer using Vec<u8>::truncate and <0.1 seconds using
diff --git a/sqv/Cargo.toml b/sqv/Cargo.toml
index 6435258a..fda13995 100644
--- a/sqv/Cargo.toml
+++ b/sqv/Cargo.toml
@@ -21,7 +21,7 @@ gitlab = { repository = "sequoia-pgp/sequoia" }
maintenance = { status = "actively-developed" }
[dependencies]
-sequoia-openpgp = { path = "../openpgp", version = "0.16", default-features = false }
+sequoia-openpgp = { path = "../openpgp", version = "0.16", default-features = false, features = ["crypto-nettle"] }
anyhow = "1"
chrono = "0.4"
clap = "2.32.0"