I’ve been using gpg (from GPG4Win, on Windows of course) on this particular machine for months to sign git commits. One day, I noticed that committing never worked. I investigated a bit, and found that using gpg is unsuccessful.
I scoured the 'net and found that a good baseline test is to run gpg -K to list secret keys - and running gpg -K, I get no output whatsoever. The application starts, and just sits there - cursor blinking, no output, the application doesn’t exit, absolutely nothing happens.
I tried running gpg -K -v to get some more logging information and I only get an output of:
gpg: enabled compatibility flags:
gpg: using pgp trust model
How can I investigate further? I’ve already tried reinstalling GPG4Win and this did not help the situation. I’ve seen a couple posts around the internet with a similar issues, but they largely pertain to Linux - though I’ve tried following their recommendations as well. I’ve checked permissions on my %appdata%/gnupg folder, as well as my secret keys in that folder. Same with my windows home folder - ~/.gnupg - I also have full control here.
On the command line try gpgconf --show-configs and maybe paste the output here.
Something that could cause this is a bad software which also installs gnupg and sets a registry key to change the homedir to its preferred place. This happened in the past. Also you might try to run:
I am not sure what you mean by “~/.gnupg” on Windows. If you have changed the homedir location to this then maybe the setting of that change is the problem? In my command example that is the default homedir.
I tried running gpg --homedir C:\Users\username\AppData\Roaming\gnupg -K and got the same behaviour - no output, application doesn’t exit.
When I mention ~/.gnupg I just meant C:\Users\username.gnupg is all. Permissions are full control there. I haven’t changed a homedir at all (not even sure how I’d do that, and I see from gpgconf --show-configs that it’s as you mentioned)
When I mention ~/.gnupg I just meant C:\Users\username.gnupg is all. Permissions are full control there. I haven’t changed a homedir at all (not even sure how I’d do that, and I see from gpgconf --show-configs that it’s as you mentioned)
So your Keys are in C:\Users\username.gnupg ? That would explain it, because GnuPG looks in C:\Users\Username\AppData\Roaming\gnupg .
Try running the command with --homedir C:\Users\username.gnupg and / or copy the contents of C:\Users\username.gnupg to C:\Users\Username\AppData\Roaming\gnupg
When I run gpg -vv -K, I get three lines of output - “enabled compatibility flags:”, “using pgp trust model”, and “key : accepted as trusted key”
When I run with --debug-all, the last two lines seem to be a bit interesting:
iobuf-1.0: underflow: buffer size: 2314; still buffered: 0 => space for 2314 bytes
iobuf-1.0: close ‘?’
I don’t know what this means, but it doesn’t quite seem right. I don’t have any sort of firewall that should be blocking anything. I did, however, check task manager and I didn’t see gpg-agent running - so I tried launching it with gpgconf --launch gpg-agent, which also had the same behaviour of just sitting there with no output and not exiting, and also did not change the behaviour of gpg -K
@Andre, to be clear, I do indeed have my secret keys in the default location (AppData). I only mention C:\Users\username.gnupg because the folder happened to exist on my system. If I try running with --homedir C:\users\username.gnupg the application DOES actually exit, but with no output