Skip to content
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

gopass init --crypto age fails if pgp tools are not installed. #1655

Closed
joe-getcouragenow opened this issue Nov 17, 2020 · 8 comments · Fixed by #1697
Closed

gopass init --crypto age fails if pgp tools are not installed. #1655

joe-getcouragenow opened this issue Nov 17, 2020 · 8 comments · Fixed by #1697
Labels
age age-encryption.org backend bug Defects help-wanted
Milestone

Comments

@joe-getcouragenow
Copy link

joe-getcouragenow commented Nov 17, 2020

Summary

gopass init --crypto age fails if pgp tools such as pinentry-mac are not installed.

I am using age because for end users its so much easier for them, in that pinentry-mac is not needed.
How about

Steps To Reproduce

gopass init --crypto age
[init] Initializing a new password store ...

Error: failed to initialize store: failed to read user input: pinentry Error: exec: "pinentry-mac": executable file not found in $PATH

Expected behaviour

Should not require the user to have pinentry-mac, since they are not using pgp as the basis of their crypto.

Environment

  • OS: Mac OS X Big sur

  • OS version:
    uname -a
    Darwin x-MacBook-Pro.local 20.1.0 Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:11 PDT 2020; root:xnu-7195.50.7~2/RELEASE_X86_64 x86_64

  • gopass Version:
    gopass --version
    gopass 1.10.1-git+HEAD go1.15.5 darwin amd64

  • Installation method: source

Additional context

Am integrating gopass with sops and age.

@AnomalRoil
Copy link
Member

Seems this is currently by design:

return pinentry.New()

We use pinentry to ask for passwords.

Now the question becomes: should we have an alternative that allows to not have pinentry?
@dominikschulz opinion?

@AnomalRoil AnomalRoil added age age-encryption.org backend bug Defects help-wanted labels Nov 18, 2020
@AnomalRoil AnomalRoil added this to the 1.x.x milestone Nov 18, 2020
@joe-getcouragenow
Copy link
Author

joe-getcouragenow commented Nov 19, 2020

suggest using this : github.com/Songmu/prompter

looks battle tested: https://github.com/search?l=Go&q=github.com%2FSongmu%2Fprompter&type=Code

is cross platform also

@FiloSottile
Copy link

FWIW, pinentry-mac does not require gpg and aside from using Assuan as the protocol, is a fairly independent tool.

https://formulae.brew.sh/formula/pinentry-mac

yubikey-agent also depends on pinentry-mac and doesn't use PGP.

@ckolumbus
Copy link
Contributor

ckolumbus commented Dec 10, 2020

According to my understanding, pinentry and gpg/pgp are completely independent. The implementation of finding the pinentry executable is quite static in gopass, so one option could be to make it changeable via env variables or some other means. I don't know whether this makes sense under OSX (not much experience there, yet). but at least gpg-agent has a config option for setting the actual pinentry program to switch between gui and terminal pinentry versions. Some programs even have internal fall-back options.

BTW: brew let's you install pinentry-mac independently of pgp/gpg.

Whereas : for gopass as a command-line tool I ask myself how often we really need a GUI pinentry dialog, and whether prompter could actually be an option

@dominikschulz
Copy link
Member

pinentry is important for several core use cases, but falling back to reading a password from the command line might be an option. Not sure if I want to add that complexity, but we can consider it.

We wouldn't need to use prompter, we have a helper lib that does the same thing already. But if prompter (or some other lib) proves to be more robust refactoring that might be a new cleanup, too.

@ckolumbus
Copy link
Contributor

we have a helper lib that does the same thing already.

Then the easiest would be to have this as a fallback if no pinentry is found. No need to get new dependencies if something exist.

dominikschulz added a commit to dominikschulz/gopass that referenced this issue Jan 12, 2021
Fixes gopasspw#1655

RELEASE_NOTES=[ENHANCEMENT] Add Pinentry CLI fallback

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
dominikschulz added a commit to dominikschulz/gopass that referenced this issue Jan 12, 2021
Fixes gopasspw#1655

RELEASE_NOTES=[ENHANCEMENT] Add Pinentry CLI fallback

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
@dominikschulz
Copy link
Member

dominikschulz commented Jan 12, 2021

@ckolumbus

I have created #1697, but I'm still not sure if I want to merge this. Let me know what you think.
If you want to have it merged please test it and report if it solves your issue.

@AnomalRoil AnomalRoil modified the milestones: 1.x.x, 1.11.1 Jan 12, 2021
dominikschulz added a commit to dominikschulz/gopass that referenced this issue Jan 18, 2021
Fixes gopasspw#1655

RELEASE_NOTES=[ENHANCEMENT] Add Pinentry CLI fallback

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
AnomalRoil pushed a commit that referenced this issue Jan 18, 2021
Fixes #1655

RELEASE_NOTES=[ENHANCEMENT] Add Pinentry CLI fallback

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
@ckolumbus
Copy link
Contributor

@dominikschulz some late feedback!

Let me know what you think.

I looked at #1697 and looks very good to me!

kpitt pushed a commit to kpitt/gopass that referenced this issue Jul 21, 2022
Fixes gopasspw#1655

RELEASE_NOTES=[ENHANCEMENT] Add Pinentry CLI fallback

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
age age-encryption.org backend bug Defects help-wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants