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

start: enable pinentry passphrase caching #152

Merged
merged 2 commits into from
Jan 12, 2025

Conversation

toobuntu
Copy link
Contributor

@toobuntu toobuntu commented Dec 4, 2024

@toobuntu
Copy link
Contributor Author

toobuntu commented Dec 4, 2024

It feels like caching should be an opt-in feature, but this does seem like what most users would want.

Note: In the referenced docs there is mention of SETKEYINFO, but in my testing (set as "SETKEYINFO n/homebrew-autoupdate") it seemed harmful because it saves the passphrase in the macOS login keychain with no expiry under the name GnuPG, which can be seen in Keychain Access.app. Pinentry then uses the saved credentials on each subsequent invocation and sudo --reset-timestamp doesn't stop it because pinentry gets the passphrase directly from the keychain and supplies it to sudo. We would seemingly need to ensure that this key is deleted from the keychain, for example before exiting the SUDO_ASKPASS script (security delete-generic-password -a "homebrew-autoupdate" -D "application password" -s GnuPG). Not doing so could cause problems should the user later change the admin password (and it seems like the user should anyway be made aware of the persistent key storage). So I left it out.

@toobuntu
Copy link
Contributor Author

toobuntu commented Dec 4, 2024

@DomT4 The CI failure should be addressed by #153.

@DomT4
Copy link
Owner

DomT4 commented Jan 12, 2025

Happy to go with this and we can have another look if there's issues. I agree with the logic discussed ref SETKEYINFO and the potential dangers there.

@DomT4 DomT4 merged commit 386308b into DomT4:master Jan 12, 2025
1 check passed
@DomT4
Copy link
Owner

DomT4 commented Jan 12, 2025

Thank you again, and apologies for the wait.

@toobuntu toobuntu deleted the pinentry-caching branch January 13, 2025 00:39
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

Successfully merging this pull request may close these issues.

Admin password is asked multiple times
2 participants