Bug 404136

Summary: When GPG is configured to use pinentry-kwallet, kwalletmanager hangs when opening a wallet that is GPG-encrypted
Product: [Frameworks and Libraries] frameworks-kwallet Reporter: Andreas <hohenegger>
Component: generalAssignee: Valentin Rusu <valir>
Status: REPORTED ---    
Severity: normal CC: kdelibs-bugs-null, mk.mateng
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=458085
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Andreas 2019-02-09 15:56:20 UTC
SUMMARY

It takes a very long time to open a GPG wallet encrypted wallet when pinentry-kwallet is configured in ~/.gnupg/gpg-agent.conf by means of the following line:
pinentry-program /usr/bin/pinentry-kwallet

Quite obviously, the program enters some sort closed loop here, as it calls kwallet while kwallet tries to open the present wallet. Apparently, it exits only after some timeout. 

Workaround: One can kill kwalletd to accelerate the process after pressing open.

STEPS TO REPRODUCE
1. Add 
pinentry-program /usr/bin/pinentry-kwallet 
to ~/.gnupg/gpg-agent.conf and run 
gpgconf --kill gpg-agent
2. Create a new GPG encrypted wallet.
3. Try to open the wallet by selecting it and pressing open in kwalletmanager.

OBSERVED RESULT
Should hang and take a very long time until the password dialog is shown. Then, after password entry and confirmation, it should hang again.

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
MacOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version:
Comment 1 michaelk83 2022-09-06 13:21:18 UTC
This is similar to Bug 458085. What is happening is KWallet needs to unlock GPG to unlock the wallet, but GPG is trying to read the key passphrase from KWallet, which is still locked.

The fix for Bug 458085 might work for this one as well, but otherwise you should not be using a GPG wallet with pinentry-kwallet.