PR: 1904
[openssl.git] / crypto / evp / evp_key.c
index 361ea69ab6d5fd685ca98dfb0f94de238988a9af..839d6a3a164c6229c4e41a72aed822d4f77f255a 100644 (file)
@@ -89,6 +89,11 @@ char *EVP_get_pw_prompt(void)
  * in the DES library -- if someone ever wants to disable DES,
  * this function will fail */
 int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify)
+       {
+       return EVP_read_pw_string_min(buf, 0, len, prompt, verify);
+       }
+
+int EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt, int verify)
        {
        int ret;
        char buff[BUFSIZ];
@@ -97,10 +102,10 @@ int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify)
        if ((prompt == NULL) && (prompt_string[0] != '\0'))
                prompt=prompt_string;
        ui = UI_new();
-       UI_add_input_string(ui,prompt,0,buf,0,(len>=BUFSIZ)?BUFSIZ-1:len);
+       UI_add_input_string(ui,prompt,0,buf,min,(len>=BUFSIZ)?BUFSIZ-1:len);
        if (verify)
                UI_add_verify_string(ui,prompt,0,
-                       buff,0,(len>=BUFSIZ)?BUFSIZ-1:len,buf);
+                       buff,min,(len>=BUFSIZ)?BUFSIZ-1:len,buf);
        ret = UI_process(ui);
        UI_free(ui);
        OPENSSL_cleanse(buff,BUFSIZ);