Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 408121 - app-crypt/gnupg-2.0.17 USE=static cannot retrieve keys from keyserver
Summary: app-crypt/gnupg-2.0.17 USE=static cannot retrieve keys from keyserver
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Crypto team [DISABLED]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-14 06:42 UTC by thetuber
Modified: 2013-01-12 20:47 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Output of 'emerge --info' (file_408121.txt,15.50 KB, text/plain)
2012-03-14 06:42 UTC, thetuber
Details
config.log from `USE="static" emerge gnupg` (config.log,880.02 KB, text/plain)
2012-04-05 08:10 UTC, Alessandro Di Federico
Details
patch to provide more debugging info (gpgkeys_hkp.c.patch,567 bytes, patch)
2012-04-06 19:41 UTC, Sławomir Nizio
Details | Diff
"test-file" mentioned in comment 4 (test-file,151 bytes, text/plain)
2012-04-06 19:42 UTC, Sławomir Nizio
Details

Note You need to log in before you can comment on or make changes to this bug.
Description thetuber 2012-03-14 06:42:27 UTC
Created attachment 305271 [details]
Output of 'emerge --info'

I have app-crypt/gnupg-2.0.17 installed with the following USE flags:

bzip2 ldap nls static -adns -caps -doc -openct -pcsc-lite (-selinux) -smartcard

When I try to retrieve a key from a keyserver, I get the following error (key ID replaced with XXX):

$ gpg --keyserver subkeys.pgp.net --keyserver-options debug --recv-keys XXX 
gpg: requesting key XXX from hkp server subkeys.pgp.net
gpgkeys: curl version = GnuPG curl-shim
* HTTP proxy is "null"
* HTTP URL is "http://subkeys.pgp.net:11371/pks/lookup?op=get&options=mr&search=XXX"
* HTTP auth is "null"
* HTTP method is GET
: can't connect to `subkeys.pgp.net': host not found
gpgkeys: HTTP fetch error 7: couldn't connect: Not found
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

If I build gnupg with -static, everything works fine.

I will add the output of 'emerge --info' as an attachment.
Comment 1 Alessandro Di Federico 2012-04-04 20:42:31 UTC
Same here, also with gnupg-2.0.19.


# gpg2 --homedir /etc/portage/gpg --keyserver subkeys.pgp.net --recv-keys 0x239C75C4 0x96D8BF6D
gpg: requesting key 239C75C4 from hkp server subkeys.pgp.net
gpg: requesting key 96D8BF6D from hkp server subkeys.pgp.net
: can't connect to `subkeys.pgp.net': host not found
gpgkeys: HTTP fetch error 7: couldn't connect: Not found
: can't connect to `subkeys.pgp.net': host not found
gpgkeys: HTTP fetch error 7: couldn't connect: Not found
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
Comment 2 Alessandro Di Federico 2012-04-05 08:09:51 UTC
Attached config.log, I think the intersting part is from:

configure:9374: checking whether libcurl is usable
configure:9407: x86_64-pc-linux-gnu-gcc -o conftest -O2 -pipe -march=native -mno-avx   -Wl,-O1 -Wl,--as-needed -static conftest.c -lcurl -lldap -lrt -lz -lgnutls  >&5

Which fails with a lot of errors. I think we're missing some static-libs.

I've the static-libs USE flag enabled on these ebuilds (among others):

dev-libs/openssl
dev-libs/libgcrypt
net-libs/gnutls
net-misc/curl
Comment 3 Alessandro Di Federico 2012-04-05 08:10:31 UTC
Created attachment 307859 [details]
config.log from `USE="static" emerge gnupg`
Comment 4 Sławomir Nizio 2012-04-06 19:39:29 UTC
I've tracked the issue down a little and it the problem *might* be in the gpg2keys_hkp binary (maybe also gpg2keys_curl).

I'll attach two attachements that might help with debugging.
The easy way to test it is:
cd gnupg-2.0.19
LDFLAGS=-static ./configure
make

then you can do this:
~/gnupg-2.0.19 $ cat test-file | ./keyserver/gpg2keys_hkp

and, if you used my patch, get this:
VERSION 1
PROGRAM 2.0.19

Host:		keyserver.ubuntu.com
Command:	SEARCH
SEARCH joost BEGIN
gpgkeys: HTTP URL is `http://keyserver.ubuntu.com:11371/pks/lookup?op=index&options=mr&search=joost'
* HTTP proxy is "null"
* HTTP URL is "http://keyserver.ubuntu.com:11371/pks/lookup?op=index&options=mr&search=joost"
* HTTP auth is "null"
* HTTP method is GET
: can't connect to `keyserver.ubuntu.com': host not found
gpgkeys: HTTP search error 7: couldn't connect: Not found

SEARCH joost FAILED 9


"test-file" is a file that contains a (seems) valid string that gpg feeds to gpg2keys_hkp when executed with --search-keys joost (just an example). It worked for me if without static and doesn't if -static option passed.


These artifacts are results of my attempts to track it down. Keep in mind I'm not sure it's the correct "path"…

I'll attach the "test-file" and the patch.
Comment 5 Sławomir Nizio 2012-04-06 19:41:16 UTC
Created attachment 308029 [details, diff]
patch to provide more debugging info
Comment 6 Sławomir Nizio 2012-04-06 19:42:19 UTC
Created attachment 308031 [details]
"test-file" mentioned in comment 4
Comment 7 samurai.no.dojo 2012-04-28 12:46:36 UTC
Hello I also have same problem.
Comment 8 Agostino Sarubbo gentoo-dev 2012-07-04 12:06:22 UTC
it happens with 2.0.19 ?
Comment 9 aves 2012-07-04 12:09:43 UTC
Same problem with amd64 with GPG 2.0.19

gpg --keyserver http://pool.sks-keyservers.net --recv-keys XXX
gpg: requesting key XXX from http server pool.sks-keyservers.net
gpgkeys: no key data found for http://pool.sks-keyservers.net/
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

It seems to be common to gpgp 2.x, I found the key with gpg on ubuntu, but the same problem occurred with gpg2.
Comment 10 Alon Bar-Lev (RETIRED) gentoo-dev 2012-12-16 21:55:49 UTC
I don't think upstream supports gpg2 built in static.
Comment 11 Alon Bar-Lev (RETIRED) gentoo-dev 2013-01-12 20:47:03 UTC
Should be fixed in gnupg-2.0.19-r1.

USE="static" emerge --oneshot gnupg

gpg --keyserver pgp.mit.edu --recv-keys F758CE318D77295D
gpg: requesting key 8D77295D from hkp server pgp.mit.edu
gpg: key 8D77295D: public key "Eric Evans <eevans@sym-link.com>" imported
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:  12  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 12u
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)