browserpass / browserpass-legacy

Legacy Browserpass repo, development is now happening at:
https://github.com/browserpass/browserpass-extension
MIT License
1k stars 80 forks source link

Firefox not prompting for passphrase #281

Closed JoakimLofgren closed 6 years ago

JoakimLofgren commented 6 years ago

General information

Exact steps to reproduce the problem

  1. Ensure pass/gpg needs password to unlock key
  2. Go to a login page you have credentials for
  3. Ctrl + Shift + L and press enter (or click the browserpass icon and the fill form )

What should happen?

It should prompt for my passphrase

What happened instead?

Nothing

Additional info

browser console has:

11:42:06.605 exit status 2
gpg: decryption failed: No secret key
background.js:70:13
11:42:06.605 stderr output from native app com.dannyvankooten.browserpass: [Browserpass] 2018/08/17 11:42:06 exit status 2
11:42:06.605 stderr output from native app com.dannyvankooten.browserpass: gpg: decryption failed: No secret key
$ gpg --version
gpg (GnuPG) 2.2.4
libgcrypt 1.8.1
...

Installing it for Chrome works, but not in Firefox.

maximbaz commented 6 years ago

It suggests to me that pinentry is somehow misbehaving or not properly configured, I wish I could help, but it doesn't sound like browserpass issue - for example it works for me.

See if some suggestions here could give you extra information: https://github.com/browserpass/browserpass/issues/266

JoakimLofgren commented 6 years ago

Is there a way to call the browserpass binary manually with what Firefox tries to send? Enable debug output or constructing the input myself?

maximbaz commented 6 years ago

Yeah, the binary accepts input data via stdin in the following format:

First 64 bit represent the length of the input data in little endian format, then comes the data itself. We have a wrapper that calculates the length and prepends it in the correct format: https://github.com/browserpass/native.pl

But be aware, Firefox and Chrome call binary in exactly the same way, in fact we have one shared source code for both browsers:

https://github.com/browserpass/browserpass/blob/1f64fc94457f0f915eb87adbf044f51dd22f9202/chrome/background.browserify.js#L57-L59

It could be a bug in how Firefox treats chrome.runtime.sendNativeMessage call, but I've just double-checked yet again and it works for me in Firefox (I'm on Arch Linux running FF 61.0.2 (64-bit)).

maximbaz commented 6 years ago

Closing as it seems there's nothing I can do, ping me if you find more details and especially if you discover that this is something we can fix in our code.

maximbaz commented 5 years ago

Just an idea, make sure pinentry application is properly configured in gpg-agent.conf, see this section of documentation for more info: https://github.com/browserpass/browserpass-native/#hints-for-configuring-gpg