marcwebbie / passpie

:closed_lock_with_key: Multiplatform command-line password manager
http://passpie.readthedocs.org/
MIT License
921 stars 68 forks source link

"Wrong passphrase" with gnupg 2.1.19 #112

Closed ilovezfs closed 7 years ago

ilovezfs commented 7 years ago
iMac-TMP:~ joe$ passpie init
Passphrase: 
Repeat for confirmation: 
Initialized database in /Users/joe/.passpie
iMac-TMP:~ joe$ passpie add foo@example.com --random
iMac-TMP:~ joe$ passpie add bar@example.com --pattern "[0-9]{5}[a-z]{5}"
iMac-TMP:~ joe$ passpie update foo@example.com --comment "Hello"
iMac-TMP:~ joe$ passpie
╒═════════════╤═════════╤════════════╤═══════════╕
│ Name        │ Login   │ Password   │ Comment   │
╞═════════════╪═════════╪════════════╪═══════════╡
│ example.com │ bar     │ ********   │           │
├─────────────┼─────────┼────────────┼───────────┤
│ example.com │ foo     │ ********   │ Hello     │
╘═════════════╧═════════╧════════════╧═══════════╛
iMac-TMP:~ joe$ passpie copy foo@example.com
Passphrase: 
Error: Wrong passphrase
ilovezfs commented 7 years ago

This seems to occur with v1.5.1, v1.5.5, and develop branch @ 8782180e5a7d76ba18d31a01831ad43201570e5b

ilovezfs commented 7 years ago

I've tested 2.1.15 - 2.1.19, and all appear to fail.

ilovezfs commented 7 years ago

I've opened https://github.com/Homebrew/homebrew-core/pull/11577 to "boneyard" passpie from Homebrew since we're upgrading everyone using Homebrew to gnupg 2.1.x.

See https://github.com/Homebrew/homebrew-core/pull/11083.

ilovezfs commented 7 years ago

CC @marcwebbie I'd prefer not to have to boneyard this software if possible. Any ideas?

marcwebbie commented 7 years ago

hello @ilovezfs I am not I understand the issue here. How can I get that version of GPG installed? Installing from brew I get version gnupg2-2.0.30_3 and with that version it seems to be working fine.

ilovezfs commented 7 years ago

@marcwebbie Yes, it works fine with 2.0.x. The problem is with 2.1.x.

You can get it by doing brew install gnupg@2.1; brew link -f gnupg@2.1

marcwebbie commented 7 years ago

Thanks @ilovezfs I have just identified the issue and I am working on a fix.

ilovezfs commented 7 years ago

@marcwebbie excellent! I will close the boneyarding PRs and look forward to your fix!

ilovezfs commented 7 years ago

Thanks @marcwebbie. It passes testing now on my end.

marcwebbie commented 7 years ago

Thank you @ilovezfs I will write a few more tests and release a new patch to brew/pip

ilovezfs commented 7 years ago

@marcwebbie is passpie supposed to be leaking gpg-agent processes like this?

iMac-TMP:~ joe$ brew test passpie -d
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/passpie.rb
Testing passpie
==> Using the sandbox
/usr/local/Homebrew/Library/Homebrew/test.rb (Formulary::FromPathLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/passpie.rb
/usr/local/Homebrew/Library/Homebrew/debrew.rb:11:in `raise'
RuntimeError: before
1. raise
2. ignore
3. backtrace
4. irb
5. shell
Choose an action: 5
When you exit this shell, you will return to the menu.
bash-3.2$ ps aux |grep gpg 
joe              52745   0.3  0.0  2434840    704 s012  S+   11:13AM   0:00.00 grep gpg
bash-3.2$ exit 0
exit
1. raise
2. ignore
3. backtrace
4. irb
5. shell
Choose an action: 2
==> /usr/local/Cellar/passpie/1.5.5/bin/passpie -D passpiedb init --force --passphrase s3cr3t
==> /usr/local/Cellar/passpie/1.5.5/bin/passpie -D passpiedb add foo@bar --random
==> /usr/local/Cellar/passpie/1.5.5/bin/passpie -D passpiedb copy --passphrase s3cr3t foo@bar --to stdout
/usr/local/Homebrew/Library/Homebrew/debrew.rb:11:in `raise'
RuntimeError: after
1. raise
2. ignore
3. backtrace
4. irb
5. shell
Choose an action: 5
When you exit this shell, you will return to the menu.
bash-3.2$ ps aux |grep gpg
joe              52773   0.0  0.0  2471012   1212   ??  Ss   11:13AM   0:00.59 gpg-agent --homedir /tmp/tmp4rxgLC --use-standard-socket --daemon
joe              52763   0.0  0.0  2452576   1012   ??  Ss   11:13AM   0:00.00 gpg-agent --homedir /tmp/tmpTcU4zx --use-standard-socket --daemon
joe              52752   0.0  0.0  2480228   1308   ??  Ss   11:13AM   0:05.77 gpg-agent --homedir /tmp/tmpBMuOQK --use-standard-socket --daemon
joe              52780   0.0  0.0  2434840    704 s012  S+   11:14AM   0:00.00 grep gpg
bash-3.2$ 
marcwebbie commented 7 years ago

No, it isn't, i am investigating this now. Thanks, I will open a new issue for it

manzapanza commented 7 years ago

I have the same problem here on Ubuntu 16. Maybe because I have both gpg and gpg2 installed?

gpg --version 
gpg (GnuPG) 1.4.20
gpg2 --version
gpg (GnuPG) 2.1.11