diff --git a/askpass.c b/askpass.c new file mode 100644 index 0000000..aa8d7e0 --- /dev/null +++ b/askpass.c @@ -0,0 +1,24 @@ +/* + ssh-add on Windows (probably part of the source at https://github.com/PowerShell/openssh-portable) + does not/can not read the passphrase from stdin. + + However, when the DISPLAY env var is set and ssh-add is not run from a terminal (however it tests + that), it will run the executable pointed to by SSH_ASKPASS in a subprocess and read the passphrase + from that subprocess' stdout. + + This program can be used as the SSH_ASKPASS implementation. It will return the passphrase set + in the SSH_PASS env variable. + + To cross-compile from Ubuntu, I installed the `mingw-w64` package and ran + $ x86_64-w64-mingw32-gcc askpass.c -static -o askpass.exe +*/ + +#include +#include + +int main(int argc, char** argv) +{ + printf("%s\n", getenv("SSH_PASS")); + + return 0; +} diff --git a/askpass.exe b/askpass.exe index 631d3db..c06bfda 100755 Binary files a/askpass.exe and b/askpass.exe differ