GpgSM: Decryption with multiple recipients emits a failure, if the first pinenty is cancelled
Open, LowPublic

Assigned To
None
Authored By
timegrid
Thu, Jul 9, 2:43 PM

Description

To reproduce:

  1. S/MIME encrypt a file for two recipients (with both secret keys in keyring), e.g for Ted/Edward

  1. Kill all background processes
  2. Decrypt the file
  3. Cancel the first pinentry
  4. Enter the correct passhrase in the second pinentry => decryption works, but a FAILURE is printed
[GNUPG:] DECRYPTION_OKAY
12345[GNUPG:] FAILURE gpgsm-exit 50331649

CLI output

Z:\testdata\verification-feedback\8273-refactor-firstpart>gpgsm -vv --status-fd 2 --decrypt smime.encrypted-only.multiple.txt.p7m
gpgsm: enabled compatibility flags:
gpgsm: no running keyboxd - starting 'C:\\Program Files\\Gpg4win\\..\\GnuPG\\bin\\keyboxd.exe'
gpgsm: waiting for the keyboxd to come up ... (8s)
gpgsm: connection to the keyboxd established
gpgsm: recp 0 - issuer: 'CN=Root-CA 2020,OU=GnuPG.com,O=g10 Code GmbH,C=DE'
gpgsm: recp 0 - serial: 281B974B684B7934
[GNUPG:] ENC_TO C7FD4C0193216FA6 0 0
gpgsm: encrypted to brainpoolP256r1 key FF810B9281A43C394AA138E9C7FD4C0193216FA6
gpgsm: no running gpg-agent - starting 'C:\\Program Files\\Gpg4win\\..\\GnuPG\\bin\\gpg-agent.exe'
[GNUPG:] PROGRESS starting_agent ? 0 0
gpgsm: waiting for the agent to come up ... (8s)
gpgsm: connection to the agent established
gpgsm: error decrypting session key: Operation cancelled
gpgsm: decrypting session key failed: Operation cancelled
gpgsm: recp 1 - issuer: 'CN=Root-CA 2020,OU=GnuPG.com,O=g10 Code GmbH,C=DE'
gpgsm: recp 1 - serial: 4D9528785EE3E701
[GNUPG:] ENC_TO F7ED85B98C7DDFC5 0 0
gpgsm: encrypted to rsa3072 key 54DCF69AD0C25D777CB4B73EF7ED85B98C7DDFC5
gpgsm: AES256.CBC encrypted data
gpgsm: certificate is good
gpgsm: validation model used: shell
[GNUPG:] DECRYPTION_OKAY
12345[GNUPG:] FAILURE gpgsm-exit 50331649

Split from T8334: Only one recipient shown in decryption feedback for files S/MIME encrypted for multiple recipients

Details

Version
gpg (GnuPG) 2.5.21

Event Timeline

timegrid created this task.
timegrid created this object with edit policy "Contributor (Project)".
In T8334#220115, @pl13 wrote:

The error comes from this log error message. Cancelling the pin entry leads to Operation cancelled. gpgsm exits with an error if an error was printed with the log_error function.