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

UX: Document pinentry functionality. how to select a pinentry program. #280

Closed
vext01 opened this issue Dec 16, 2021 · 4 comments
Closed
Milestone

Comments

@vext01
Copy link

vext01 commented Dec 16, 2021

Having seen this, I was trying to figure out how pinentry support works. Specifically how to choose a different pinentry. Is it possible?

Should this be documented somewhere? In the README perhaps?

@str4d
Copy link
Owner

str4d commented Dec 28, 2021

rage uses the first binary named pinentry found in the PATH, so you can control which pinentry binary is used by placing the preferred binary earlier in the PATH. If no binary named pinentry can be found in the PATH, rage falls back to a CLI approach; this can be used to "disable" pinentry usage if needed. We could add a section to the main README that documents this, under a "Requesting secrets" heading (since we only use pinentry for requesting passphrases or plugin secrets).

Aside: I'm still trying to decide whether or not to keep pinentry support around. I added it because I thought it would be a predictable existing interface that users would be used to for secret requests, but that hasn't always been the case in the (few) user reports I've had back. I definitely don't want to go adding a bunch of configuration options for it, which would complicate the UX. For now, I think it remains useful enough.

@vext01
Copy link
Author

vext01 commented Dec 29, 2021 via email

@str4d
Copy link
Owner

str4d commented Jun 12, 2023

I finally had time to dig into how GPG configures pinentry, which is only used directly by gpg-agent:

  • The pinentry binary can be configured with the --pinentry-program option when starting gpg-agent, or permanently via the pinentry-program option in ~/.gnupg/gpg-agent.conf.
  • If a PINENTRY_USER_DATA environment variable is set then gpg2 ensures it gets passed through to gpg-agent and on to the underlying pinentry program (issue).

rage does not have a corresponding agent, and instead calls pinentry directly (if available). So I believe that pinentry should already inherit any environment variables, including PINENTRY_USER_DATA. I still don't want to add config options to rage for this, but I think I could live with a PINENTRY_PROGRAM environment variable that emulates the pinentry-program option for gpg-agent (and would also not be rage-specific, so if in future I decide to remove pinentry, the environment variable can just be ignored).

@str4d str4d added this to the rage 0.9.2 milestone Jun 12, 2023
@str4d
Copy link
Owner

str4d commented Jun 12, 2023

Closed by #364.

@str4d str4d closed this as completed Jun 12, 2023
str4d added a commit that referenced this issue Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants