From b66854ac93d843cc8c0ade28684302a99339273d Mon Sep 17 00:00:00 2001 From: Ingo Klöcker Date: Tue, 11 Jan 2022 10:08:45 +0100 Subject: 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 --- g10/keygen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'g10') 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; } -- cgit v1.2.3