geluk / pass-winmenu

An easy-to-use password manager for Windows, compatible with pass.
MIT License
385 stars 25 forks source link

pass-winmenu don't decrypt password properly (empty file) #135

Closed majvax closed 1 month ago

majvax commented 1 month ago

I imported my gpg key, up the trust using the shell built-in pass-winmenu. The problem is that when decrypting the file to put it in my clipboard, I got nothing. When editing the password file, it shows an empty file:

image

However, the file should contain my password, since I sync it with github from my phone image

The file is detected so it's not a problem from the path, I don't really know...

image

willpower232 commented 1 month ago

did you get the gpg version or the non-gpg version of pass-winmenu?

depending on where you imported your key, you may also need to edit the config file to point to the right place

majvax commented 1 month ago

non-gpg version I mean i read the config file and didn't found anything interesting imo but I may didn't see a settings or smth. I follow the readme to configure pass-winmenu (for importing the key)

willpower232 commented 1 month ago

I always change gnupghome-override because my directory is in a non default place and you would need to make sure that the gpg-path is set correctly for wherever you are running it from

image

majvax commented 1 month ago

Yeah, gpg-path is set correctly I think. I don't really understand why should i override the gpg home (I don't use oyher gpg homedir) I still specified the same directory as you.

I reimported the key image image

but still, the clipboard is empty and same when editing password file image

This is my config: image (I added gpg bin to my path env but that change nothing to the problem)

geluk commented 1 month ago

Are you sure you didn't encrypt an empty file? What is the output of running gpg --decrypt github/personnal.gpg in the builtin password shell? (Make sure to censor the password if it's in there somewhere!)

willpower232 commented 1 month ago

You would probably also need to restart the app if the config file changed, presuming your gnupg is indeed in your home directory, I think the default path is fine if thats where your folder is. I just copy mine out of linux and dump it there since I use the gpg version of pass-winmenu.

majvax commented 1 month ago

It doesn't output anything

image

But I can assure that it contains something since on my phone I can see the password when using pass show github/personnal

image

git status indicated that i'm up to date with the repo so It shouldn't be a problem from an empty file

I didn't mention but I already restart the app everytime I made some change to the config

majvax commented 1 month ago

To provide further information, I fix the issue by installing GnuPG, removing the old pass-winmenu and installing the nogpg version. I imported the key and now, It work flawlessly. Maybe there is a problem in the gpg version distributed with the app ?

geluk commented 1 month ago

Glad to hear you were able to fix it. In my experience the version distributed with the app works fine, but one thing that I've seen before is that when you have two different versions of GPG, they can sometimes conflict. This can happen because on first launch GPG will start gpg-agent, a background process that handles part of the cryptographic operations. If conflicting versions of GPG and gpg-agent try to communicate (for instance, because you have a local GPG installation different from the one bundled in pass-winmenu) decryption fail or hang without a clear error message.

If you want we can investigate this further but since it looks like a problem with GPG, I'm also fine with just closing this issue and reopening it if it occurs again.

majvax commented 1 month ago

The thing is that I don't have two different versions of gpg, this is precisely why I didn't choose the no GPGversion in the first place, because I wanted pass-winmenu to work out of the box. (I later installed the version shipped without GPGand installed the GPG myself).

I'm also fine just closing the issue since I don't have any knowledge regarding GPG.