summaryrefslogtreecommitdiffstats
path: root/sq
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-10-22 16:29:02 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-10-22 16:29:02 +0200
commit5ff30d8ed398fc6c3e973773043c8211214db63c (patch)
tree8f74c268d420ecb227dcd028b23ffa52f09ac42c /sq
parent06bd95ec9165aa723356ec999f87c86f57b7e065 (diff)
openpgp: Select only supported encryption-capable keys.
Diffstat (limited to 'sq')
-rw-r--r--sq/src/commands/mod.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/sq/src/commands/mod.rs b/sq/src/commands/mod.rs
index 6415e2cf..fbf96657 100644
--- a/sq/src/commands/mod.rs
+++ b/sq/src/commands/mod.rs
@@ -51,6 +51,7 @@ fn get_signing_keys(certs: &[openpgp::Cert], p: &dyn Policy,
'next_cert: for tsk in certs {
for key in tsk.keys().with_policy(p, timestamp).alive().revoked(false)
.for_signing()
+ .supported()
.map(|ka| ka.key())
{
if let Some(secret) = key.optional_secret() {
@@ -108,7 +109,7 @@ pub fn encrypt<'a>(policy: &'a dyn Policy,
for cert in recipients.iter() {
let mut count = 0;
for key in cert.keys().with_policy(policy, None).alive().revoked(false)
- .key_flags(&mode).map(|ka| ka.key())
+ .key_flags(&mode).supported().map(|ka| ka.key())
{
recipient_subkeys.push(key.into());
count += 1;