age: add --pinentry flag to use pinentry to read passphrase#386
Conversation
1c675ff to
bcb9842
Compare
|
Author of gopasspw/pinentry here. I do support the proposal to replace gopasspw/pinentry with a different implementation. We have introduced our package for an experimental feature that we currently don't put much focus on. So our pinentry implementation is not our top priority right now (and likely won't be anytime soon). We kept it around primarily because I knew that If |
9100306 to
a5fcefa
Compare
|
I've updated this to use https://github.com/twpayne/go-pinentry-minimal, which has the same functionality as https://github.com/twpayne/go-pinentry but has no dependencies outside the Go standard library. |
|
Thank you @twpayne for the package, and @dominikschulz for chiming in. I've decided we won't merge alternative password input methods in cmd/age, but we'll ship them all in a separate plugin. I'll make sure to support pinentry there and I'll be using the minimal package like in yubikey-agent. See #256 (comment) for a bit more details. |
|
The new batchpass plugin handles non-interactive passphrase encryption. See #256 (comment) for usage and a warning. It doesn't include pinentry support, but if you'd like to copy it to make an age-plugin-pinentry, that'd be great! |
|
Thank you! I made an initial copy and replaced the passphrase prompt with pinentry: https://github.com/twpayne/age-plugin-pinentry Warning: I've only checked that this code compiles, I've not run it yet, but PRs and contributions welcome. |
Fixes #182.
This commit uses https://pkg.go.dev/github.com/twpayne/go-pinentry instead of https://pkg.go.dev/github.com/gopasspw/pinentry because the former provides a more complete API, more robust error handling, and correct escape character handling by default.
If this adds too many dependencies, I'd be happy to strip down https://github.com/twpayne/go-pinentry to reduce the dependencies to a minimum.