From a527bd7cf58563d07c89bec458c8967ab1b3e60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Mon, 10 Jan 2022 12:32:32 +0100 Subject: [PATCH] core: Return an error for secret key export operations src/export.c (export_status_handler): Handle "export_keys.secret". -- This allows callers of the synchronous export operations to react properly to errors (e.g. wrong passphrase) during the export of secret keys. GnuPG-bug-id: 5766 --- NEWS | 2 ++ src/export.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index dbbbd908..cd3cd6e6 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,8 @@ Noteworthy changes in version 1.16.1 (unreleased) * New export mode to export secret subkeys. [#5757] + * Detect errors during the export of secret keys. [#5766] + * cpp,qt: Add support for export of secret keys and secret subkeys. [#5757] diff --git a/src/export.c b/src/export.c index c5bcca6e..155085ff 100644 --- a/src/export.c +++ b/src/export.c @@ -105,7 +105,8 @@ export_status_handler (void *priv, gpgme_status_code_t code, char *args) return err; else if (opd->err) ; /* We only want to report the first error. */ - else if (!strcmp (loc, "keyserver_send")) + else if (!strcmp (loc, "keyserver_send") + || !strcmp (loc, "export_keys.secret")) opd->err = err; break;