Page MenuHome GnuPG

--list-only with --decrypt skips listing my key
Closed, ResolvedPublic

Description

I have an encrypted file, test.txt.gpg, created with the following:

[me@myhost ~]$ gpg --armor -o test.txt.gpg --recipient E85B146000000000 --recipient 05E73AAC00000000 --encrypt test.txt

When I decrypt it, as expected, I can see the original recipients list, the ones used for encryption:

[me@myhost ~]$ gpg -o test.txt -d test.txt.gpg
gpg: encrypted with 2048-bit RSA key, ID E85B146000000000, created 2011-03-10
      "My Friend <myfriend@myhost.com>"
gpg: encrypted with 2048-bit RSA key, ID 05E73AAC00000000, created 2017-12-04
      "Me <me@myhost.com>"

But if I wish to only see the disclosed recipients with --list-only, the result is different, my key is missing:

[me@myhost ~]$ gpg --list-only -d test.txt.gpg
gpg: encrypted with 2048-bit RSA key, ID E85B146000000000, created 2011-03-10
      "My Friend <myfriend@myhost.com>"

I have also tried to swap the recipients when encrypting, but the results were the same. I'm thinking that this might be some quirky feature, not a bug, but even if - the listing of keys should be coherent whether or not --list-only is used.

ENVIRONMENT:
Arch Linux

[me@myhost ~]$ uname -a
Linux myhost 4.14.11-1-ARCH #1 SMP PREEMPT Wed Jan 3 07:02:42 UTC 2018 x86_64 GNU/Linux
[me@myhost ~]$ pacman -Q gnupg
gnupg 2.2.4-1

STEPS TO REPRODUCE:
Encrypt a file with two or more recipients, one of them yourself, then list keys on that encrypted file with and without --list-only switch. See description above for specific commands.

Details

Version
GnuPG 2.2.4, libcrypt 1.8.2