summaryrefslogtreecommitdiffstats
path: root/crypto/evp/evp_key.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2010-03-27 19:31:55 +0000
committerDr. Stephen Henson <steve@openssl.org>2010-03-27 19:31:55 +0000
commit08df41277a2e0048af93ae33094923040a4e7f13 (patch)
treea33d0f483ffe9c07d03ddb1f7fe70703fcee4815 /crypto/evp/evp_key.c
parentac495542a663b241a598e9bd13bf8d2d7b8720be (diff)
PR: 1904
Submitted by: David Woodhouse <dwmw2@infradead.org> Pass passphrase minimum length down to UI.
Diffstat (limited to 'crypto/evp/evp_key.c')
-rw-r--r--crypto/evp/evp_key.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/evp/evp_key.c b/crypto/evp/evp_key.c
index a22fa5036e..7961fbebf2 100644
--- a/crypto/evp/evp_key.c
+++ b/crypto/evp/evp_key.c
@@ -90,6 +90,11 @@ char *EVP_get_pw_prompt(void)
* 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];
UI *ui;
@@ -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);