summaryrefslogtreecommitdiffstats
path: root/crypto/ui
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2019-06-17 16:57:25 +0200
committerBernd Edlinger <bernd.edlinger@hotmail.de>2019-06-21 12:22:10 +0200
commita7581949e463e198db21cb3c46a688a5cb4d1730 (patch)
tree68d7aa93408e738fe009aaf89c3b4b92a86a030d /crypto/ui
parent441c1e093feb9c98733a0fc524b7f82661de2322 (diff)
Handle CTRL-C as non-redoable abort signal
This is a bit annoying, if for instance "openssl genrsa -aes128" tries to read a 4+ character size password, but CTRL-C does no longer work after a RETURN key, since the flag UI_FLAG_REDOABLE is set by UI_set_result_ex, together with the error "You must type in 4 to 1023 characters". Thus remove the REDOABLE flag to allow CTRL-C to work. [extended tests] Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9170) (cherry picked from commit f8922b5107d098c78f846c8c999f96111345de8d)
Diffstat (limited to 'crypto/ui')
-rw-r--r--crypto/ui/ui_lib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/ui/ui_lib.c b/crypto/ui/ui_lib.c
index 139485dcd1..8dce57872c 100644
--- a/crypto/ui/ui_lib.c
+++ b/crypto/ui/ui_lib.c
@@ -500,6 +500,7 @@ int UI_process(UI *ui)
if (ui->meth->ui_flush != NULL)
switch (ui->meth->ui_flush(ui)) {
case -1: /* Interrupt/Cancel/something... */
+ ui->flags &= ~UI_FLAG_REDOABLE;
ok = -2;
goto err;
case 0: /* Errors */
@@ -517,6 +518,7 @@ int UI_process(UI *ui)
sk_UI_STRING_value(ui->strings,
i))) {
case -1: /* Interrupt/Cancel/something... */
+ ui->flags &= ~UI_FLAG_REDOABLE;
ok = -2;
goto err;
case 0: /* Errors */