diff options
author | Werner Koch <wk@gnupg.org> | 2024-01-16 14:02:42 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2024-01-16 14:02:42 +0100 |
commit | 1a2c8267f54ba0a55fa2f87fdc19068b0088510f (patch) | |
tree | e0d6b509ab0c816814e7bc5395c79a2245fd2090 /g10 | |
parent | doc: Describe the ssh-agent protocol options for Windows. (diff) | |
download | gnupg2-1a2c8267f54ba0a55fa2f87fdc19068b0088510f.tar.xz gnupg2-1a2c8267f54ba0a55fa2f87fdc19068b0088510f.zip |
gpg: When using a parm file w/o usage don't set the RENC usage.
* g10/keygen.c (proc_parameter_file): Don't include RENC in the
default usage.
--
Testplan:
$ gpg --gen-key --batch <<EOF
Key-Type: EDDSA
Key-Curve: ed448
Key-Usage: cert
Name-Real: Meh Muh
Name-Email: test-3@example.org
Expire-Date: 2025-01-01
Passphrase: abc
subkey-type: ecdh
Subkey-curve: cv448
EOF
and check that the R flag does not show up in the usage.
Diffstat (limited to 'g10')
-rw-r--r-- | g10/keygen.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/g10/keygen.c b/g10/keygen.c index 3efdf94a3..10b81d1ee 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -4220,12 +4220,13 @@ proc_parameter_file (ctrl_t ctrl, struct para_data_s *para, const char *fname, if (!err) { /* Default to algo capabilities if subkey-usage is not - provided */ + provided. Take care not to include RENC. */ r = xmalloc_clear (sizeof(*r)); r->key = pSUBKEYUSAGE; r->u.usage = (is_default ? PUBKEY_USAGE_ENC - : openpgp_pk_algo_usage (algo)); + : (openpgp_pk_algo_usage (algo) + & ~PUBKEY_USAGE_RENC) ); append_to_parameter (para, r); } else if (err == -1) |