summaryrefslogtreecommitdiffstats
path: root/openpgp/Cargo.toml
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2018-06-18 19:18:56 +0200
committerJustus Winter <justus@sequoia-pgp.org>2018-06-19 11:41:00 +0200
commitb2ee991c96698043f922b2b2d2dea77436db7549 (patch)
treebec005196021436ce88405ee40323aace72f4747 /openpgp/Cargo.toml
parentb6f578b052ca4356d787ee428b1b00820e0775ab (diff)
openpgp, buffered-reader: Make compression an optional feature.
- This helps to reduce the trusted computing base if compression is not needed. - This makes it easier to fuzz Sequoia, previously the fuzzer was doing a great job creating compression bombs that triggered the fuzzers timeout. - Currently, the cargo workspace feature does not propagate --no-default-features, but it is possible to depend on the openpgp crate with `default-features = false`. - Unfortunately, a lot of test cases include compressed packages. This change conditionally disables these tests.
Diffstat (limited to 'openpgp/Cargo.toml')
-rw-r--r--openpgp/Cargo.toml14
1 files changed, 11 insertions, 3 deletions
diff --git a/openpgp/Cargo.toml b/openpgp/Cargo.toml
index 3d2d4c31..acf33a3c 100644
--- a/openpgp/Cargo.toml
+++ b/openpgp/Cargo.toml
@@ -4,11 +4,19 @@ version = "0.1.0"
authors = ["Neal H. Walfield <neal@gnu.org>"]
[dependencies]
-buffered-reader = { path = "../buffered-reader" }
+buffered-reader = { path = "../buffered-reader", default-features = false }
base64 = "0.9.0"
-bzip2 = "0.3.2"
+bzip2 = { version = "0.3.2", optional = true }
failure = "0.1.1"
-flate2 = "1.0.1"
+flate2 = { version = "1.0.1", optional = true }
nettle = { git = "https://gitlab.com/sequoia-pgp/nettle-rs.git" }
quickcheck = "0.6"
time = "0.1.38"
+
+[features]
+default = ["compression"]
+
+# The compression algorithms.
+compression = ["compression-deflate", "compression-bzip2"]
+compression-deflate = ["flate2", "buffered-reader/compression-deflate"]
+compression-bzip2 = ["bzip2", "buffered-reader/compression-bzip2"]