summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ui
diff options
context:
space:
mode:
authormarkus <>2002-09-05 22:44:52 +0000
committermarkus <>2002-09-05 22:44:52 +0000
commit715a204e4615e4a70a466fcb383a9a57cad5e6b8 (patch)
tree2d2e93c4a34d1f7f04aba73706353332d7700641 /src/lib/libcrypto/ui
parent15b5d84f9da2ce4bfae8580e56e34a859f74ad71 (diff)
downloadopenbsd-715a204e4615e4a70a466fcb383a9a57cad5e6b8.tar.gz
openbsd-715a204e4615e4a70a466fcb383a9a57cad5e6b8.tar.bz2
openbsd-715a204e4615e4a70a466fcb383a9a57cad5e6b8.zip
import openssl-0.9.7-beta3
Diffstat (limited to 'src/lib/libcrypto/ui')
-rw-r--r--src/lib/libcrypto/ui/ui_openssl.c2
-rw-r--r--src/lib/libcrypto/ui/ui_util.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/libcrypto/ui/ui_openssl.c b/src/lib/libcrypto/ui/ui_openssl.c
index 4e12165410..2c2fbc0443 100644
--- a/src/lib/libcrypto/ui/ui_openssl.c
+++ b/src/lib/libcrypto/ui/ui_openssl.c
@@ -269,7 +269,7 @@ static long tty_orig[3], tty_new[3]; /* XXX Is there any guarantee that this w
269static long status; 269static long status;
270static unsigned short channel = 0; 270static unsigned short channel = 0;
271#else 271#else
272#ifndef OPENSSL_SYS_MSDOS 272#if !defined(OPENSSL_SYS_MSDOS) || defined(__DJGPP__)
273static TTY_STRUCT tty_orig,tty_new; 273static TTY_STRUCT tty_orig,tty_new;
274#endif 274#endif
275#endif 275#endif
diff --git a/src/lib/libcrypto/ui/ui_util.c b/src/lib/libcrypto/ui/ui_util.c
index 7c6f7d3a73..f05573df33 100644
--- a/src/lib/libcrypto/ui/ui_util.c
+++ b/src/lib/libcrypto/ui/ui_util.c
@@ -71,12 +71,15 @@ int UI_UTIL_read_pw(char *buf,char *buff,int size,const char *prompt,int verify)
71 int ok = 0; 71 int ok = 0;
72 UI *ui; 72 UI *ui;
73 73
74 if (size < 1)
75 return -1;
76
74 ui = UI_new(); 77 ui = UI_new();
75 if (ui) 78 if (ui)
76 { 79 {
77 ok = UI_add_input_string(ui,prompt,0,buf,0,BUFSIZ-1); 80 ok = UI_add_input_string(ui,prompt,0,buf,0,size-1);
78 if (ok == 0 && verify) 81 if (ok == 0 && verify)
79 ok = UI_add_verify_string(ui,prompt,0,buff,0,BUFSIZ-1, 82 ok = UI_add_verify_string(ui,prompt,0,buff,0,size-1,
80 buf); 83 buf);
81 if (ok == 0) 84 if (ok == 0)
82 ok=UI_process(ui); 85 ok=UI_process(ui);