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

Allow password to be provided by stdin #56

Open
jeremyevans opened this issue May 31, 2022 · 0 comments
Open

Allow password to be provided by stdin #56

jeremyevans opened this issue May 31, 2022 · 0 comments

Comments

@jeremyevans
Copy link

OpenBSD signify supports password to be provided by stdin:

$ echo -n password > pass
$ signify -G -p t.pub -s t.sec < pass
$ signify -S -s t.sec -m t.pub < pass
$ signify -V -p t.pub -m t.pub
Signature Verified

It would be great if signify-rs could support this as well, as it's makes automated use much easier (consider use of signify-rs in automated tests). Implementation wise, if stdin is not a terminal, read stdin to get the password. If stdin is a terminal, continue prompting for a password. Here's how OpenBSD signify implements password reading (readpassphrase(3) reads from stdin if RPP_STDIN flag is used): https://github.com/openbsd/src/blob/600ae3309934717b40f3a8f30104f26d08b69791/usr.bin/signify/signify.c#L266-L280

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

1 participant