From 53c8f29125ff9664120879b78fb11a6e766f89f4 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 10 Mar 2026 10:13:46 +0900 Subject: Handle the case when pinentry is invoked multiple times. * src/passphrase.c (_gpgme_passphrase_status_handler): Reset no_passphrase and bad_passphrase field. -- GnuPG-bug-id: 7339 Signed-off-by: NIIBE Yutaka --- src/passphrase.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/passphrase.c b/src/passphrase.c index 140cd03a..d07afa91 100644 --- a/src/passphrase.c +++ b/src/passphrase.c @@ -114,6 +114,11 @@ _gpgme_passphrase_status_handler (void *priv, gpgme_status_code_t code, case GPGME_STATUS_CANCELED_BY_USER: return gpg_error (GPG_ERR_CANCELED); + case GPGME_STATUS_PINENTRY_LAUNCHED: + /* Another pinentry is invoked, reset the passphrase status. */ + opd->no_passphrase = opd->bad_passphrase = 0; + break; + case GPGME_STATUS_EOF: if (opd->no_passphrase || opd->bad_passphrase) return gpg_error (GPG_ERR_BAD_PASSPHRASE); -- cgit