diff options
author | Ingo Klöcker <[email protected]> | 2022-01-11 08:54:29 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2022-07-25 13:17:42 +0000 |
commit | ee8f1c10a7a54714fb2a9ca141d38e666b9a424d (patch) | |
tree | a7dbbe809dd43d9f8edf52fc8cec286d311d9cb2 | |
parent | wkd: Fix path traversal attack on gpg-wks-server. (diff) | |
download | gnupg-ee8f1c10a7a54714fb2a9ca141d38e666b9a424d.tar.gz gnupg-ee8f1c10a7a54714fb2a9ca141d38e666b9a424d.zip |
gpg: Request keygrip of key to add via command interface
* g10/keygen.c (ask_algo): Request keygrip via cpr_get.
* doc/help.txt (gpg.keygen.keygrip): New help text.
--
This change makes it possible to add an existing (sub)key to
another key via the status/command interface.
GnuPG-bug-id: 5771
(cherry picked from commit 19b1a28621c614b81f596e363b1ce49dd9fae115)
-rw-r--r-- | doc/help.txt | 9 | ||||
-rw-r--r-- | g10/keygen.c | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/doc/help.txt b/doc/help.txt index 38f25cd3e..a17217622 100644 --- a/doc/help.txt +++ b/doc/help.txt @@ -134,6 +134,15 @@ Please consult your security expert first. . + +.gpg.keygen.keygrip +Enter the keygrip of the key to add. + +The keygrip is a string of 40 hex digits that identifies a key. It +must belong to a secret key or a secret subkey stored in your keyring. +. + + .gpg.keygen.flags Toggle the capabilities of the key. diff --git a/g10/keygen.c b/g10/keygen.c index fee752376..80d65c444 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -2066,8 +2066,8 @@ ask_algo (ctrl_t ctrl, int addmode, int *r_subkey_algo, unsigned int *r_usage, for (;;) { xfree (answer); - answer = tty_get (_("Enter the keygrip: ")); - tty_kill_prompt (); + answer = cpr_get ("keygen.keygrip", _("Enter the keygrip: ")); + cpr_kill_prompt (); trim_spaces (answer); if (!*answer) { |