apps_ui.c: Correct handling of empty password from -passin
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Mon, 11 May 2020 13:32:26 +0000 (15:32 +0200)
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>
Thu, 10 Sep 2020 20:01:07 +0000 (22:01 +0200)
This is done in analogy to commit ca3245a61989009a99931748723d12e30d0a66b2

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12493)

apps/lib/apps_ui.c

index 8523cda3c22d43a81ef55d207399b846a6192c33..dd794ec747ec724fdb95b3cec724054e29b06e47 100644 (file)
@@ -15,7 +15,6 @@
 static UI_METHOD *ui_method = NULL;
 static const UI_METHOD *ui_fallback_method = NULL;
 
-
 static int ui_open(UI *ui)
 {
     int (*opener)(UI *ui) = UI_method_get_opener(ui_fallback_method);
@@ -72,7 +71,8 @@ static int ui_write(UI *ui, UI_STRING *uis)
             {
                 const char *password =
                     ((PW_CB_DATA *)UI_get0_user_data(ui))->password;
-                if (password && password[0] != '\0')
+
+                if (password != NULL)
                     return 1;
             }
             break;