Commit Diff


commit - 691fef445877337da35f91df842f8b79e24c316c
commit + 78cd00e8cf33122b5b72896172cc3daf5fb0eca3
blob - 880233a013d19e8fd2064361f6cb2d6f5fa4a769
blob + 851065630a8baf4dc932ac9d6f4f102f4e7e3442
--- compat/readpassphrase.c
+++ compat/readpassphrase.c
@@ -25,13 +25,10 @@
 
 #include "compat.h"
 
-#ifndef HAVE_READPASSPHRASE
-
 #include <termios.h>
 #include <signal.h>
 #include <ctype.h>
 #include <fcntl.h>
-#include <readpassphrase.h>
 #include <errno.h>
 #include <string.h>
 #include <unistd.h>
@@ -191,21 +188,9 @@ restart:
 		errno = save_errno;
 	return(nr == -1 ? NULL : buf);
 }
-DEF_WEAK(readpassphrase);
 
-#if 0
-char *
-getpass(const char *prompt)
-{
-	static char buf[_PASSWORD_LEN + 1];
-
-	return(readpassphrase(prompt, buf, sizeof(buf), RPP_ECHO_OFF));
-}
-#endif
-
 static void handler(int s)
 {
 
 	signo[s] = 1;
 }
-#endif /* HAVE_READPASSPHRASE */
blob - 264574eb9d5ca2770e16b68ebdce78d73ef28bac
blob + ecc232ab03e6c6ffacb2d4791fbcb0f57ac3ac84
--- compat.h
+++ compat.h
@@ -20,6 +20,7 @@
 #include "config.h"
 
 #include <paths.h>
+#include <stddef.h>
 
 #ifndef _PATH_TTY
 #define _PATH_TTY "/dev/tty"
@@ -29,6 +30,19 @@
 const char	*getprogname(void);
 #endif
 
+#ifdef HAVE_READPASSPHRASE
+#include <readpassphrase.h>
+#else
+char		*readpassphrase(const char *, char *, size_t, int);
+#define RPP_ECHO_OFF    0x00            /* Turn off echo (default). */
+#define RPP_ECHO_ON     0x01            /* Leave echo on. */
+#define RPP_REQUIRE_TTY 0x02            /* Fail if there is no tty. */
+#define RPP_FORCELOWER  0x04            /* Force input to lower case. */
+#define RPP_FORCEUPPER  0x08            /* Force input to upper case. */
+#define RPP_SEVENBIT    0x10            /* Strip the high bit from input. */
+#define RPP_STDIN       0x20            /* Read from stdin, not /dev/tty */
+#endif
+
 #ifndef HAVE_STRTONUM
 long long	 strtonum(const char*, long long, long long, const char**);
 #endif
blob - f7e7d7e62c0f922809999fc5c1e0c4a7cbca5f46
blob + 2f0cbccc62125dd5fa566891a54579a92f1d5580
--- xc.c
+++ xc.c
@@ -17,7 +17,6 @@
 #include "compat.h"
 
 #include <err.h>
-#include <readpassphrase.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>