diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-01-13 13:39:08 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2018-01-13 13:39:08 +0100 |
commit | 00abb1f201cbe1e40c2eef30819be115d3d04d10 (patch) | |
tree | 7eb36871dd7af02db7d2f59482644a56bc79d7bb /thirdparty/openssl/crypto/evp/evp_key.c | |
parent | de0b31edd5b36b8c8016b7ca50c1823f2efbfa74 (diff) |
openssl: Update to pristine 1.0.2n (security update)
Diffstat (limited to 'thirdparty/openssl/crypto/evp/evp_key.c')
-rw-r--r-- | thirdparty/openssl/crypto/evp/evp_key.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/thirdparty/openssl/crypto/evp/evp_key.c b/thirdparty/openssl/crypto/evp/evp_key.c index 5be9e336f9..cdffe1c8c4 100644 --- a/thirdparty/openssl/crypto/evp/evp_key.c +++ b/thirdparty/openssl/crypto/evp/evp_key.c @@ -97,7 +97,7 @@ int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify) int EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt, int verify) { - int ret; + int ret = -1; char buff[BUFSIZ]; UI *ui; @@ -105,16 +105,18 @@ int EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt, prompt = prompt_string; ui = UI_new(); if (ui == NULL) - return -1; - UI_add_input_string(ui, prompt, 0, buf, min, - (len >= BUFSIZ) ? BUFSIZ - 1 : len); - if (verify) - UI_add_verify_string(ui, prompt, 0, - buff, min, (len >= BUFSIZ) ? BUFSIZ - 1 : len, - buf); + return ret; + if (UI_add_input_string(ui, prompt, 0, buf, min, + (len >= BUFSIZ) ? BUFSIZ - 1 : len) < 0 + || (verify + && UI_add_verify_string(ui, prompt, 0, buff, min, + (len >= BUFSIZ) ? BUFSIZ - 1 : len, + buf) < 0)) + goto end; ret = UI_process(ui); - UI_free(ui); OPENSSL_cleanse(buff, BUFSIZ); + end: + UI_free(ui); return ret; } |