summaryrefslogtreecommitdiffstats
path: root/SoftHSMv2/src/bin/win32/getpassphase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'SoftHSMv2/src/bin/win32/getpassphase.cpp')
-rw-r--r--SoftHSMv2/src/bin/win32/getpassphase.cpp35
1 files changed, 0 insertions, 35 deletions
diff --git a/SoftHSMv2/src/bin/win32/getpassphase.cpp b/SoftHSMv2/src/bin/win32/getpassphase.cpp
deleted file mode 100644
index 9d8aaca..0000000
--- a/SoftHSMv2/src/bin/win32/getpassphase.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* WIN32 getpassphrase */
-
-#include <config.h>
-#include <stdio.h>
-
-char *
-getpassphrase(const char *prompt) {
- static char buf[128];
- HANDLE h;
- DWORD cc, mode;
- int cnt;
-
- h = GetStdHandle(STD_INPUT_HANDLE);
- fputs(prompt, stderr);
- fflush(stderr);
- fflush(stdout);
- FlushConsoleInputBuffer(h);
- GetConsoleMode(h, &mode);
- SetConsoleMode(h, ENABLE_PROCESSED_INPUT);
-
- for (cnt = 0; cnt < sizeof(buf) - 1; cnt++)
- {
- ReadFile(h, buf + cnt, 1, &cc, NULL);
- if (buf[cnt] == '\r')
- break;
- fputc('*', stdout);
- fflush(stderr);
- fflush(stdout);
- }
-
- SetConsoleMode(h, mode);
- buf[cnt] = '\0';
- fputs("\n", stderr);
- return (buf);
-}