aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2022-01-11 08:54:29 +0000
committerIngo Klöcker <[email protected]>2022-01-11 09:12:07 +0000
commit19b1a28621c614b81f596e363b1ce49dd9fae115 (patch)
tree124203782b664c50f3832dc53466e2342f5617b6
parentdirmngr: Map all gnupg.net addresses to the Ubuntu keyserver. (diff)
downloadgnupg-19b1a28621c614b81f596e363b1ce49dd9fae115.tar.gz
gnupg-19b1a28621c614b81f596e363b1ce49dd9fae115.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
-rw-r--r--doc/help.txt9
-rw-r--r--g10/keygen.c4
2 files changed, 11 insertions, 2 deletions
diff --git a/doc/help.txt b/doc/help.txt
index 9f056c3e0..fb7a22ca4 100644
--- a/doc/help.txt
+++ b/doc/help.txt
@@ -168,6 +168,15 @@ key, and in parentheses the usage of the key (cert, sign, auth, encr).
If known the standard usage for a key is marked with an asterisk.
.
+
+.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 b48a79006..ffae93295 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -2252,8 +2252,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)
{