-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not fill in password #8
Comments
Does this happen on all login forms or just one particular web page form? At this stage it is very unlikely that I can help you with this issue unless I can replicate it. Note that I have only tested this on Ubuntu 16:04 and works perfectly for me. |
Under no illusion this is a tricky one 😄 Running Ubuntu 16.04 with the i3 window manager, this may be changing the environment slightly. |
Same here:
and
pass:
gpg-agent:
nativePass location:
nativePass version:
chrome-pass plugin: also 0.2.1 Window manager: cinnamon (although I can't really imagine that makes a difference) |
@wjdp @mrtndwrd I would need your help to debug this issue as I cannot replicate it on my system. Since you mention that the list of passwords do appears in the extension popup I assume that the extension and native pass are installed correctly. If only the password is not being filled it can only mean that the GPG decryption in the nativeApp is not working. I just published a new version of the nativePass application that contains an additional command to test password decryption. Please install the new version:
With this command in place you can now run the following to get a list of credentials with decrypted passwords:
The above command will print all credentials/passwords that match You may also try to test if your python3 installation is able to decrypt the passwords using the following python code: import gnupg
import os
gpg = gnupg.GPG()
txt = open("~/.password-store/path/to/a/password.gpg", "rb")
data = gpg.decrypt_file(txt)
if data.status == "decryption ok":
password = data.data.decode('utf-8').split("\n")[0]
print("Password: %s"%password)
else:
print("Decryption failed : %s"%data.status) The code above is the exact same code used by the nativePass application to decrypt the passwords. If that does not work then we need to find out why. Some notes:
|
Right. Which version of Ubuntu default: In [4]: gnupg.__version__
Out[4]: '0.4.1'
In [6]: import gnupg
...: import os
...:
...: gpg = gnupg.GPG()
...: txt = open("<my-key>.gpg", "rb")
...: data = gpg.decrypt_file(txt)
...: if data.status == "decryption ok":
...: password = data.data.decode('utf-8').split("\n")[0]
...: print("Password: %s"%password)
...: else:
...: print("Decryption failed : %s"%data.status)
...:
Decryption failed : decryption failed Newest version on pip: In [2]: gnupg.__version__
Out[2]: '2.3.0'
In [3]: import gnupg
...: import os
...:
...: gpg = gnupg.GPG()
...: txt = open("<my-key>.gpg", "rb")
...: data = gpg.decrypt_file(txt)
...: if data.status == "decryption ok":
...: password = data.data.decode('utf-8').split("\n")[0]
...: print("Password: %s"%password)
...: else:
...: print("Decryption failed : %s"%data.status)
...:
Decryption failed : None Middle ground, newest 1.* version: In [2]: import gnupg
...:
...: print(gnupg.__version__)
...:
...: import os
...:
...: gpg = gnupg.GPG()
...: txt = open("<my-key>.gpg", "rb")
...: data = gpg.decrypt_file(txt)
...: if data.status == "decryption ok":
...: password = data.data.decode('utf-8').split("\n")[0]
...: print("Password: %s"%password)
...: else:
...: print("Decryption failed : %s"%data.status)
...:
1.4.0
Decryption failed : decryption failed Last thing i tried (with python gnupg 2.3.0):
I don't know what's happening here anymore. Full disclosure: I am using a GPG smart card instead of keys that are saved on the hard drive, but as long as python-gnupg is just a wrapper around gpg2, I think that should not be a problem... |
@mrtndwrd thanks for the feedback. As suspected the decryption is giving troubles for some reason. For reference I use gnupg version 0.3.9 with gpg2 binary. If you change the nativePass code so it works with your last example does the extension work for you? |
Just to be clear: the last example doesn't work either. So what would be
the point?
…On 25 Jul 2017 12:08 pm, "Horacio Sanson" ***@***.***> wrote:
@mrtndwrd <https://github.com/mrtndwrd> thanks for the feedback. As
suspected the decryption is giving troubles for some reason. For reference
I use gnupg version 0.3.9 with gpg2 binary.
If you change the nativePass code so it works with your last example does
the extension work for you?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAy00yTokHKbKe5mdxbPwr67gw43dZEtks5sRb6qgaJpZM4OezSQ>
.
|
import gnupg
import os
print(gnupg.__version__)
gpg = gnupg.GPG()
txt = open(".password-store/key.gpg", "rb")
data = gpg.decrypt_file(txt)
if data.status == "decryption ok":
password = data.data.decode('utf-8').split("\n")[0]
print("Password: %s"%password)
else:
print("Decryption failed : %s"%data.status) yields
Seems same issue as @mrtndwrd. I suspect while gpg-agent is working within our shell environments when running elsewhere on the system it is not setup correctly. Beyond this I know very little about the workings of gpg. (I mention window manager previously as using something other than Ubuntu's default forces you to do some of the setup work for tools like gpg-agent, whereas unity does this for you.) |
Well, thunderbird is communicating with my gpg agent without troubles...
…On 25 Jul 2017 5:13 pm, "Will Pimblett" ***@***.***> wrote:
import gnupgimport os
print(gnupg.__version__)
gpg = gnupg.GPG()
txt = open(".password-store/key.gpg", "rb")
data = gpg.decrypt_file(txt)if data.status == "decryption ok":
password = data.data.decode('utf-8').split("\n")[0]
print("Password: %s"%password)else:
print("Decryption failed : %s"%data.status)
yields
0.4.1
Decryption failed : decryption failed
Seems same issue as @mrtndwrd <https://github.com/mrtndwrd>. I suspect
while gpg-agent is working within our shell environments when running
elsewhere on the system it is not setup correctly. Beyond this I know very
little about the workings of gpg.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAy008p18Ld1TWt9-gKb8IuNdjK3YgYiks5sRgYugaJpZM4OezSQ>
.
|
With the nativePass tool I get ~600 lines of top level items in my pass directory like:
|
@mrtndwrd @wjdp thanks for the debugging. Reading the documentation of gnupg python module it looks like by default it does not use gpg-agent. Also found some other details that can help improve the decoding code: https://pythonhosted.org/python-gnupg Would you mind trying again using the following modified code? import gnupg
import os
print(gnupg.__version__)
PASSFILE="/full/path/to/password.gpg"
gpg = gnupg.GPG(use_agent=True)
txt = open(PASSFILE, "rb")
data = gpg.decrypt_file(txt)
if data.ok:
password = data.data.decode('utf-8').split("\n")[0]
print("Password: %s"%password)
else:
print("Decryption failed : %s"%data.stderr) When creating the gpg object try different options like gpgbinary, gnupghome, etc. And let me know the results you get. @wjdp the output you show above is from nativePass 0.2.1 and below. On version 0.2.2 you should actually get a list of the password paths and the decrypted passwords:
|
After some more investigation it seems the python-gnupg module found in pip is a modified version of the original module. After installing that version on my machine the plugin and the test script above stopped working on my machine too. If possible please uninstall any gnupg package you have installed on your machines and leave the default one that comes with python. Just uninstalling anything gnupg related via "pip3 uninstall" would do. Then test to see if the test script works for you. And also I just released version 0.2.3 of the extension with some usability improvements. Now errors are shown in the popup window as they should. |
I just found out yesterday I was testing with the wrong gnupg: there's I installed python3-gnupg from the Ubuntu repo (
Now I found out that this is the same problem as when I try to decrypt using
Tried again to set the binary to gpg2, but this time with In [10]: import gnupg
...: import os
...:
...: print(gnupg.__version__)
...:
...: PASSFILE="/home/users/maarten/.password-store/greenhost/cosmos-accept.greenhost.nl/maarten.gpg"
...:
...: gpg = gnupg.GPG(gpgbinary="/usr/bin/gpg2", use_agent=True)
...: txt = open(PASSFILE, "rb")
...: data = gpg.decrypt_file(txt)
...: if data.ok:
...: password = data.data.decode('utf-8').split("\n")[0]
...: print("Password: %s"%password)
...: else:
...: print("Decryption failed : %s"%data.stderr)
...:
0.3.8
Password: <my password> SUCCESSS!!! |
Check #9 for my changes |
@mrtndwrd thanks for the debugging and the MR. In resume: The python-gnupg package installed via pip breaks python GPG decryption. There is a recent issue about this. Instead make sure to use the python3-gnupg package that comes by default with Ubuntu. pip3 uninstall python-gnupg
sudo apt-get instrall python3-gnupg Now regarding the gpg vs gpg2 binary is more complicated. I will close this issue and open a new one to track this. |
Can't seem to get the extension to fill passwords.
I have gpg-agent and a pinentry program. I assume they are set up correctly (i.e. it works from the terminal). Dotfiles are here: https://github.com/wjdp/dotfiles
The text was updated successfully, but these errors were encountered: