summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/evp_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp/evp_key.c')
-rw-r--r--src/lib/libcrypto/evp/evp_key.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/libcrypto/evp/evp_key.c b/src/lib/libcrypto/evp/evp_key.c
index 361ea69ab6..839d6a3a16 100644
--- a/src/lib/libcrypto/evp/evp_key.c
+++ b/src/lib/libcrypto/evp/evp_key.c
@@ -90,6 +90,11 @@ char *EVP_get_pw_prompt(void)
90 * this function will fail */ 90 * this function will fail */
91int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify) 91int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify)
92 { 92 {
93 return EVP_read_pw_string_min(buf, 0, len, prompt, verify);
94 }
95
96int EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt, int verify)
97 {
93 int ret; 98 int ret;
94 char buff[BUFSIZ]; 99 char buff[BUFSIZ];
95 UI *ui; 100 UI *ui;
@@ -97,10 +102,10 @@ int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify)
97 if ((prompt == NULL) && (prompt_string[0] != '\0')) 102 if ((prompt == NULL) && (prompt_string[0] != '\0'))
98 prompt=prompt_string; 103 prompt=prompt_string;
99 ui = UI_new(); 104 ui = UI_new();
100 UI_add_input_string(ui,prompt,0,buf,0,(len>=BUFSIZ)?BUFSIZ-1:len); 105 UI_add_input_string(ui,prompt,0,buf,min,(len>=BUFSIZ)?BUFSIZ-1:len);
101 if (verify) 106 if (verify)
102 UI_add_verify_string(ui,prompt,0, 107 UI_add_verify_string(ui,prompt,0,
103 buff,0,(len>=BUFSIZ)?BUFSIZ-1:len,buf); 108 buff,min,(len>=BUFSIZ)?BUFSIZ-1:len,buf);
104 ret = UI_process(ui); 109 ret = UI_process(ui);
105 UI_free(ui); 110 UI_free(ui);
106 OPENSSL_cleanse(buff,BUFSIZ); 111 OPENSSL_cleanse(buff,BUFSIZ);