summaryrefslogtreecommitdiffstats
path: root/engines
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2010-03-12 12:48:32 +0000
committerDr. Stephen Henson <steve@openssl.org>2010-03-12 12:48:32 +0000
commit00947cea0cb1eec869f514e7f8474e8e3baeb0f2 (patch)
treeb1f8d8636150c99fb8fb419a19cb772a57af6f4c /engines
parente45c32fabf35e50ea451e8a0180c575104e700ac (diff)
PR: 2192
Submitted By: Jaroslav Imrich <jaroslav.imrich@disig.sk> The prompt_info and wrong_info parameters can be empty strings which can produce confusing prompts. Treat empty string same as NULL.
Diffstat (limited to 'engines')
-rw-r--r--engines/e_chil.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/engines/e_chil.c b/engines/e_chil.c
index c0643256f2..3cb1386eed 100644
--- a/engines/e_chil.c
+++ b/engines/e_chil.c
@@ -1201,6 +1201,11 @@ static int hwcrhk_get_pass(const char *prompt_info,
pem_password_cb *callback = NULL;
void *callback_data = NULL;
UI_METHOD *ui_method = NULL;
+ /* Despite what the documentation says prompt_info can be
+ * an empty string.
+ */
+ if (prompt_info && !*prompt_info)
+ prompt_info = NULL;
if (cactx)
{
@@ -1302,8 +1307,10 @@ static int hwcrhk_insert_card(const char *prompt_info,
{
char answer;
char buf[BUFSIZ];
-
- if (wrong_info)
+ /* Despite what the documentation says wrong_info can be
+ * an empty string.
+ */
+ if (wrong_info && *wrong_info)
BIO_snprintf(buf, sizeof(buf)-1,
"Current card: \"%s\"\n", wrong_info);
ok = UI_dup_info_string(ui, buf);