diff options
author | Neal H. Walfield <neal@g10code.com> | 2015-12-22 14:21:18 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@g10code.com> | 2015-12-22 15:03:54 +0100 |
commit | dc52995d85048ed12ae8b9f330e9ca41a4030aae (patch) | |
tree | 3c22fc598e33f3038f360f2752e6dd948c0e3b9d /g10/gpg.c | |
parent | gpg: Remove unused parameter. (diff) | |
download | gnupg2-dc52995d85048ed12ae8b9f330e9ca41a4030aae.tar.xz gnupg2-dc52995d85048ed12ae8b9f330e9ca41a4030aae.zip |
gpg: Lazily evaluate --default-key.
* g10/gpg.c (main): If --encrypt-to-default-key is specified, don't
add --default-key's value to REMUSR here...
* g10/pkclist.c (build_pk_list): ... do it here.
* tests/openpgp/Makefile.am (TESTS): Add default-key.test.
* tests/openpgp/default-key.test: New file.
--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
Diffstat (limited to 'g10/gpg.c')
-rw-r--r-- | g10/gpg.c | 21 |
1 files changed, 0 insertions, 21 deletions
@@ -4281,8 +4281,6 @@ main (int argc, char **argv) } { - int have_def_secret_key = opt.def_secret_key != NULL; - rc = check_user_ids (&locusr, 1, 1); if (rc) g10_exit (1); @@ -4292,25 +4290,6 @@ main (int argc, char **argv) rc = check_user_ids (&opt.def_secret_key, 1, 0); if (rc) g10_exit (1); - - if (opt.encrypt_to_default_key) - { - const char *default_key = parse_def_secret_key (ctrl); - if (default_key) - { - sl = add_to_strlist2 (&remusr, default_key, utf8_strings); - sl->flags = ((oEncryptToDefaultKey << PK_LIST_SHIFT) - | PK_LIST_ENCRYPT_TO); - if (opt.encrypt_to_default_key == 2) - sl->flags |= PK_LIST_CONFIG; - } - else if (have_def_secret_key) - log_info (_("option '%s' given, but no valid default keys given\n"), - "--encrypt-to-default-key"); - else - log_info (_("option '%s' given, but option '%s' not given\n"), - "--encrypt-to-default-key", "--default-key"); - } } /* The command dispatcher. */ |