Implement passphrase input.

This commit is contained in:
Con Kolivas 2011-03-15 16:32:32 +11:00
parent 202d972a6c
commit 412cf013c4
4 changed files with 59 additions and 2 deletions

8
util.c
View file

@ -38,6 +38,7 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <termios.h>
#ifdef _SC_PAGE_SIZE
# define PAGE_SIZE (sysconf(_SC_PAGE_SIZE))
@ -86,6 +87,13 @@ void unlink_files(void)
static void fatal_exit(void)
{
struct termios termios_p;
/* Make sure we haven't died after disabling stdin echo */
tcgetattr(fileno(stdin), &termios_p);
termios_p.c_lflag |= ECHO;
tcsetattr(fileno(stdin), 0, &termios_p);
unlink_files();
fprintf(outputfile, "Fatal error - exiting\n");
fflush(outputfile);