If an empty password is supplied still try to use it
authorMatt Caswell <matt@openssl.org>
Thu, 25 Jun 2020 15:10:54 +0000 (16:10 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 3 Jul 2020 16:20:38 +0000 (17:20 +0100)
commitca3245a61989009a99931748723d12e30d0a66b2
tree71fb55e69604cf4a74378754ff0be2c1a20e4040
parent5a640713f34d4b9b6bf9520a46b0c8ee3334d8bf
If an empty password is supplied still try to use it

If an empty password was supplied we ignored it and were trying to use
the fallback method to read the password instead (i.e. read from stdin).
However if that failed (which it always does if the cmp option -batch is
used) then we were reporting that we had successfully read the password
without actually setting one.

Instead, if an empty password is explicitly provided we should use it. If
no password is supplied explicitly and we have no fallback method then we
assume the empty password.

[extended tests]

Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12275)
apps/lib/apps_ui.c