diff options
author | Ingo Klöcker <dev@ingo-kloecker.de> | 2022-01-11 10:08:45 +0100 |
---|---|---|
committer | Ingo Klöcker <dev@ingo-kloecker.de> | 2022-01-11 10:12:07 +0100 |
commit | b66854ac93d843cc8c0ade28684302a99339273d (patch) | |
tree | ebfbfa8265694a82889c7f85f0cecabc3009a9d8 /g10 | |
parent | gpg: Request keygrip of key to add via command interface (diff) | |
download | gnupg2-b66854ac93d843cc8c0ade28684302a99339273d.tar.xz gnupg2-b66854ac93d843cc8c0ade28684302a99339273d.zip |
gpg: Report failed generation of subkey pair via status interface
* g10/keygen.c (generate_subkeypair): On error, write error and
"key not created" message to status interface.
--
This change allows users of the status/command interface to detect
errors when adding a subkey to a key. Similar status messages are
output by do_generate_keypair.
GnuPG-bug-id: 5771
Diffstat (limited to 'g10')
-rw-r--r-- | g10/keygen.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/g10/keygen.c b/g10/keygen.c index ffae93295..bb243522d 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -5976,7 +5976,11 @@ generate_subkeypair (ctrl_t ctrl, kbnode_t keyblock, const char *algostr, xfree (cache_nonce); xfree (passwd_nonce); if (err) - log_error (_("Key generation failed: %s\n"), gpg_strerror (err) ); + { + log_error (_("Key generation failed: %s\n"), gpg_strerror (err) ); + write_status_error (cardkey? "card_key_generate":"key_generate", err); + print_status_key_not_created ( NULL ); + } return err; } |