Home GnuPG
Diffusion GnuPG e1e35db510c9

gpg: Fix the use of future-default with --quick-add-key.


gpg: Fix the use of future-default with --quick-add-key.

* g10/keygen.c (parse_key_parameter_part): Add arg clear_cert.
(parse_key_parameter_string): Add arg suggested_use and implement
fallback.  Change callers to pass 0 for new arg.
(parse_algo_usage_expire): Pass the parsed USAGESTR to
parse_key_parameter_string so that it can use it in case a subkey is
to be created.

The problem here was that future-default gives the primary and subkey
algorithm. However, when using future-default for adding a key, the
second part was always used which is for encryption. If the caller
now wanted to create a signing subkey using the future-default
parameters this did not worked.

gpg --batch --passphrase "" --quick-add-key FPR future-default encr

aready worked as did

gpg --batch --passphrase "" --quick-add-key FPR ed25519 sign


gpg --batch --passphrase "" --quick-add-key FPR future-default sign

does only work with this fix.

  • GnuPG-bug-id: T3747
  • Signed-off-by: Werner Koch <wk@gnupg.org>