FS#52354 - [gnupg] 2.1.17-3 broken DNS
Attached to Project:
Arch Linux
Opened by Noel Kuntze (thermi) - Tuesday, 03 January 2017, 16:47 GMT
Last edited by Gaetan Bisson (vesath) - Thursday, 19 January 2017, 23:32 GMT
Opened by Noel Kuntze (thermi) - Tuesday, 03 January 2017, 16:47 GMT
Last edited by Gaetan Bisson (vesath) - Thursday, 19 January 2017, 23:32 GMT
|
Details
Description:
The gnupg package in version 2.1.17-3 has broken DNS resolving and is unable to use keyservers. Downgrading to 2.1.16-1 makes it work. I can not test the 2.1.17-{1,2}, because I do not have those packages. Additional info: * package 2.1.17-3 * config and/or log files etc. Steps to reproduce: 1. Install 2.1.17-1 2. Try to refresh, upload, download or search keys 3. Watch it fail Output: LANG=C gpg --verbose --verbose --search-keys robert@alsdorff.de gpg: no keyserver known (use option --keyserver) gpg: keyserver search failed: No keyserver available |
This task depends upon
Closed by Gaetan Bisson (vesath)
Thursday, 19 January 2017, 23:32 GMT
Reason for closing: Fixed
Additional comments about closing: gnupg- 2.1.17-4 in [testing]
Thursday, 19 January 2017, 23:32 GMT
Reason for closing: Fixed
Additional comments about closing: gnupg- 2.1.17-4 in [testing]
The DNS resolution works and gpg gets a reply with the requested A/AAAA/SRV record, however it reports those as being not known and there's a patch in the 2.1.17-3 package, that patches some stuff regarding libdns, it seems. So I guess this patch could have broken it.
Example:
$ gpg --recv-keys --keyserver hkp://18.9.60.141 1EB2638FF56C0C53 works
$ gpg --recv-keys --keyserver hkp://pgp.mit.edu 1EB2638FF56C0C53 does not work
$ gpg --recv-keys --keyserver hkp://pgp.mit.edu 1EB2638FF56C0C53
gpg: key 1EB2638FF56C0C53: public key "Dave Reisner <d@falconindy.com>" imported
gpg: marginals needed: 3 completes needed: 1 trust model: pgp
gpg: depth: 0 valid: 2 signed: 16 trust: 0-, 0q, 0n, 0m, 0f, 2u
gpg: depth: 1 valid: 16 signed: 8 trust: 16-, 0q, 0n, 0m, 0f, 0u
gpg: next trustdb check due at 2018-02-03
gpg: Total number processed: 1
gpg: imported: 1
Please try running:
$ gpg --homedir /tmp --recv-keys --keyserver hkp://pgp.mit.edu 1EB2638FF56C0C53
If this works, the issue is with your configuration files, then you can do a binary search to find the offending option and report it upstream. Cheers.
LANG=C gpg --homedir /tmp --recv-keys --keyserver hkp://pgp.mit.edu 1EB2638FF56C0C53
gpg: keyserver receive failed: No keyserver available
I recommend you try building the latest git snapshot of gnupg from source: if it fixes the problem I can backport the relevant commit into our package, and if not you should definitely bring this up with upstream. Cheers.
I'll try to see if there is anything that may be breaking gnupg here, and report a bug upstream.
By the way, I am using systemd-networkd and systemd-resolved to configure my network connection, in case that matters.
The source has to be patched with the patch given in commit b200e636ab20d2aa93d9f71f3789db5a04af0a56 [1],
additionally to the one that is already in the source of the package with version 2.1.17-3 (called libdns.patch there)
and gnupg has to be built with libdns.
[1] https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=commitdiff;h=b200e636ab20d2aa93d9f71f3789db5a04af0a56
$ gpg --recv-keys --keyserver hkp://pgp.mit.edu 1EB2638FF56C0C53
gpg: keyserver receive failed: Server indicated a failure
And subsequent calls return:
gpg: keyserver receive failed: No keyserver available
I'd really love to get upstream's libdns to work but somehow we're not there yet.
Attached you find the DNS query and response, as well as my resolv.conf.
EDIT: Misclicked when trying to add the attachements. They're now attached.
dns.pcapng (1.5 KiB)
What's weird however is that capturing packets (see attached) I can see the SRV record being asked, none being found, but no query for the A/AAAA record is ever made. I'm not sure where the IP address of pgp.mit.edu could be hardcoded on my system...
(Edit: Just to be clear, all this is using gnupg-2.1.17-3 from [core].)
To avoid stupid errors, the two patches and the install file are attached as well.
I think dirmngr caches DNS responses or something else does. I observed the same thing when testing the failure in I'M experiencing with -3, when I don't kill gpg-agent
and dirmngr beforehand.
Do you mind making a capture with my PKGBUILD an the new patch?
Btw: I'm having the failure on -3 on a different installation on my Laptop as well and that also happened in another network at 33c3.
libdns.patch (1.9 KiB)
dns-stuff.patch (1.5 KiB)
install (0.2 KiB)
Here's what I get with your proposed PKGBUILD. I'm not sure why the broadcast: I had set my nameserver to 8.8.8.8 in resolv.conf.
I disabled IPv6 on my interface and there's still no working keyserver interaction. So I think that it's independent of IPv6. (I have working IPv6 and the package that my PKGBUILD produces works fine with that).
No, I don't use nscd. It's also not running.
What's your /etc/nsswitch.conf? Mine's attached.
If nsswitch.conf is slighly malconfigured for hosts resolution, like the following[1], keyserver interaction does not work. Removing the ! from [!UNAVAIL=return] makes it work.
However, it does not fix the problem with gnupg 2.1.17-3.
the hosts line was taken from the avahi wiki article[2].
I would really like to see your nsswitch.conf file, Gaetan.
[1] Failing nsswitch.conf hosts line: `hosts: files mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns myhostname`
[2] https://wiki.archlinux.org/index.php/avahi
# Begin /etc/nsswitch.conf
passwd: compat mymachines systemd
group: compat mymachines systemd
shadow: compat
publickey: files
hosts: files mymachines resolve [!UNAVAIL=return] dns myhostname
networks: files
protocols: files
services: files
ethers: files
rpc: files
netgroup: files
# End /etc/nsswitch.conf
Please test gnupg-2.1.17-4 from [testing]
Gaetan: Do you mind bringing that upstream and getting a discussion started to get it included there?
$ gpg --recv-keys 0x20D04E5A713660A7
gpg: keyserver receive failed: Server indicated a failure
$ gpg --recv-keys 0x20D04E5A713660A7
gpg: keyserver receive failed: No keyserver available