summaryrefslogtreecommitdiffstats
path: root/tool/src
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-07-28 16:48:21 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-07-28 17:02:21 +0200
commitb9f1dac59c758826c7c92541d01f447179a1e4d2 (patch)
treea9c9f465e6433715edb749c21c0a6ae6f0197877 /tool/src
parentc5f44ce753f3b56338311b9dc9d1d3de86307fa3 (diff)
openpgp: Reimplement the KeyFlags struct using Bitfield.
- This also drops the implementation of PartialOrd since we did not use it in the key selection after all. - Fixes #525.
Diffstat (limited to 'tool/src')
-rw-r--r--tool/src/commands/key.rs4
-rw-r--r--tool/src/sq.rs8
2 files changed, 6 insertions, 6 deletions
diff --git a/tool/src/commands/key.rs b/tool/src/commands/key.rs
index 9e83b49f..abd95433 100644
--- a/tool/src/commands/key.rs
+++ b/tool/src/commands/key.rs
@@ -86,8 +86,8 @@ pub fn generate(m: &ArgMatches, force: bool) -> Result<()> {
match (m.value_of("can-encrypt"), m.is_present("cannot-encrypt")) {
(Some("universal"), false) | (None, false) => {
builder = builder.add_subkey(KeyFlags::default()
- .set_transport_encryption(true)
- .set_storage_encryption(true),
+ .set_transport_encryption()
+ .set_storage_encryption(),
None,
None);
}
diff --git a/tool/src/sq.rs b/tool/src/sq.rs
index 5e1a59bc..dc634aba 100644
--- a/tool/src/sq.rs
+++ b/tool/src/sq.rs
@@ -232,12 +232,12 @@ fn main() -> Result<()> {
.unwrap_or(Ok(vec![]))?;
let mode = match m.value_of("mode").expect("has default") {
"rest" => KeyFlags::default()
- .set_storage_encryption(true),
+ .set_storage_encryption(),
"transport" => KeyFlags::default()
- .set_transport_encryption(true),
+ .set_transport_encryption(),
"all" => KeyFlags::default()
- .set_storage_encryption(true)
- .set_transport_encryption(true),
+ .set_storage_encryption()
+ .set_transport_encryption(),
_ => unreachable!("uses possible_values"),
};
let time = if let Some(time) = m.value_of("time") {