1 /* WIN32 getpassphrase */
7 getpassphrase(const char *prompt) {
13 h = GetStdHandle(STD_INPUT_HANDLE);
14 fputs(prompt, stderr);
17 FlushConsoleInputBuffer(h);
18 GetConsoleMode(h, &mode);
19 SetConsoleMode(h, ENABLE_PROCESSED_INPUT);
21 for (cnt = 0; cnt < sizeof(buf) - 1; cnt++)
23 ReadFile(h, buf + cnt, 1, &cc, NULL);
31 SetConsoleMode(h, mode);