FS#50409 - [gnupg] Libgcrypt warning: missing initialization

Attached to Project: Arch Linux
Opened by nfnty (nfnty) - Tuesday, 16 August 2016, 06:29 GMT
Last edited by Doug Newgard (Scimmia) - Saturday, 20 August 2016, 13:13 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Gaetan Bisson (vesath)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Every time `pacman --query` and `pacman --sync --info` are invoked, since gnupg 2.1.12-2, libgcrypt warning messages are logged to syslog.

`gpgconf[18854]: Libgcrypt warning: missing initialization - please fix the application`
This task depends upon

Closed by  Doug Newgard (Scimmia)
Saturday, 20 August 2016, 13:13 GMT
Reason for closing:  Fixed
Additional comments about closing:  gnupg 2.1.15-1
Comment by Doug Newgard (Scimmia) - Tuesday, 16 August 2016, 15:10 GMT
I'm not seeing this. Give us versions of all of the relevant packages.
Comment by nfnty (nfnty) - Tuesday, 16 August 2016, 15:22 GMT
Meant to say ever since upgrading from gnupg 2.1.12-2.

I've tracked it down to having signed databases. Using `SigLevel = Never` resolves the issue.
Comment by nfnty (nfnty) - Tuesday, 16 August 2016, 15:48 GMT
pacman: 5.0.1-4
gnupg: 2.1.14-1
gpgme: 1.6.0-3
Comment by Doug Newgard (Scimmia) - Tuesday, 16 August 2016, 16:05 GMT
The warning lists libgcrypt, how about the version there?
Comment by nfnty (nfnty) - Tuesday, 16 August 2016, 16:09 GMT
libgcrypt: 1.7.2-1
Comment by nfnty (nfnty) - Tuesday, 16 August 2016, 16:12 GMT
The issue is resolved when only downgrading gnupg to 2.1.12-2.
Comment by nfnty (nfnty) - Tuesday, 16 August 2016, 16:24 GMT
After further investigation, this is probably not a problem with pacman, but rather with gnupg. Seems like gpg-connect-agent also has the same issue now.
Comment by Doug Newgard (Scimmia) - Tuesday, 16 August 2016, 16:29 GMT
Of course it's not pacman, it's either gpg or libgcrypt.
Comment by nfnty (nfnty) - Tuesday, 16 August 2016, 16:40 GMT
Well, it used to only happen using pacman. Can't know if it's caused by them fixing some upstream bug which is revealing bugs in other applications. Other projects that have had this issue previously solved it by implementing downstream fixes.
Comment by nfnty (nfnty) - Tuesday, 16 August 2016, 16:52 GMT
This issue is really weird. Unsetting $GNUPGHOME resolves the issue. No messages are logged when using `sudo -i`, even though $GNUPGHOME is set. Warning messages are only logged when using `sudo su -` or logging in normally.
Comment by Gaetan Bisson (vesath) - Wednesday, 17 August 2016, 16:32 GMT
To get upstream to fix this, could you please provide a minimal working example that exhibits this issue using only gpg and standard Unix command (no pacman)?
Comment by nfnty (nfnty) - Wednesday, 17 August 2016, 17:05 GMT
`gpg-connect-agent updatestartuptty /bye`
Comment by Gaetan Bisson (vesath) - Wednesday, 17 August 2016, 17:52 GMT
Sorry but I cannot reproduce this issue. I've tried combining this command with sudo or `sudo su -` to no avail.
Comment by nfnty (nfnty) - Wednesday, 17 August 2016, 19:22 GMT
$GNUPGHOME has to be in your environment. Follow log with `journalctl --user --follow`.
Comment by nfnty (nfnty) - Wednesday, 17 August 2016, 19:30 GMT
This should also work: `gpg-connect-agent --homedir=/dummy updatestartuptty /bye`
Comment by nfnty (nfnty) - Wednesday, 17 August 2016, 19:36 GMT
Also, I can only replicate this issue when logging in normally or over ssh now, sudo doesn't work anymore for whatever reason.
Comment by Gaetan Bisson (vesath) - Wednesday, 17 August 2016, 19:54 GMT
Isn't it expected that a "initialization problem" shows up when you run gpg with an unexisting homedir?
Comment by nfnty (nfnty) - Wednesday, 17 August 2016, 19:57 GMT
My $GNUPGHOME is obviously existing and working. `--homedir=/dummy` is only for reproducing the issue. Everything works fine except for the syslog warning messages.
Comment by nfnty (nfnty) - Wednesday, 17 August 2016, 20:01 GMT
gnupg 'common/homedir.c' was completely refactored between 2.1.12 and 2.1.13.
Comment by nfnty (nfnty) - Wednesday, 17 August 2016, 20:10 GMT
No warning message is printed with: `gpg-connect-agent "--homedir=${HOME}/.gnupg" updatestartuptty /bye`
Comment by nfnty (nfnty) - Wednesday, 17 August 2016, 20:16 GMT
Probably due to L554 in 'common/homedir.c'
Comment by nfnty (nfnty) - Wednesday, 17 August 2016, 20:43 GMT
Verified to be caused by the function call 'gcry_md_hash_buffer' in 'common/homedir.c' L554.
Comment by Gaetan Bisson (vesath) - Wednesday, 17 August 2016, 21:04 GMT
Great work! Could you please report it upstream to https://bugs.g10code.com/gnupg/ ? Thanks.
Comment by nfnty (nfnty) - Wednesday, 17 August 2016, 22:50 GMT

Loading...