FS#64663 - [gnupg] Decrypting with 2.2.18-1 results in error

Attached to Project: Arch Linux
Opened by Niels IJsselstein (nijssels) - Wednesday, 27 November 2019, 08:15 GMT
Last edited by Gaetan Bisson (vesath) - Friday, 29 November 2019, 22:48 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Gaetan Bisson (vesath)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 5
Private No



After upgrading to 2.2.18-1 unencrypting a file results in error:

Downgrading to 2.2.17-3 resolved the problem.

Additional info:
* package version(s): core/gnupg 2.2.18-1

Steps to reproduce:

# encrypt a file
gpg --hidden-recipient "John Doe" -o tmp.txt.g --encrypt tmp.txt

# decrypt file
gpg -d tmp.txt.g

gpg: selecting card failed: No such device
gpg: anonymous recipient; trying secret key XXXXXXXXXX ...
free(): double free detected in tcache 2
Aborted (core dumped)

This task depends upon

Closed by  Gaetan Bisson (vesath)
Friday, 29 November 2019, 22:48 GMT
Reason for closing:  Fixed
Additional comments about closing:  gnupg-2.2.18-2 in [testing]
Comment by Gaetan Bisson (vesath) - Wednesday, 27 November 2019, 21:54 GMT
It works just fine for me. Note that you must replace "John Doe" with an actual name from your keyring.
Then again I don't use smartcards. There must be something specific to your setup that triggers this issue.
Could you report it upstream to: https://dev.gnupg.org/
Comment by Milen Stefanov (smilen) - Thursday, 28 November 2019, 10:36 GMT
I can confirm the bug. It's reproducible with my YubiKey when I want to decrypt with my private gpg key.

My test output:
~ gpg --decrypt --verbose tmp.txt.g
gpg: public key is 0x0000000000000000
gpg: anonymous recipient; trying secret key *****MY SECRET KEY ID******
gpg: pinentry launched (1768 gtk2 1.1.0 /dev/pts/0 st-256color :0)
gpg: okay, we are the anonymous recipient.
free(): double free detected in tcache 2
[1] 1760 abort (core dumped) gpg --decrypt --verbose tmp.txt.g

Downgrading to 2.2.17-3 fixed the issue.
Comment by Gaetan Bisson (vesath) - Thursday, 28 November 2019, 17:30 GMT
Please report this issue upstream and paste the link to the upstream tracker here. This bug won't fix itself on its own.
Comment by Niels IJsselstein (nijssels) - Friday, 29 November 2019, 08:04 GMT
Reported issue upstream: