From b2ee991c96698043f922b2b2d2dea77436db7549 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 18 Jun 2018 19:18:56 +0200 Subject: 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. --- openpgp/Cargo.toml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'openpgp/Cargo.toml') 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 "] [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"] -- cgit v1.2.3