diff options
author | wangyuhang <524413304@qq.com> | 2022-12-07 09:48:16 +0100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-12-11 21:23:37 +0100 |
commit | efec0f4611ee854f2b0b3da0c135e839bf8e7d04 (patch) | |
tree | 7b6afebb63cba15938cd0b027db2cdd5971483af /apps | |
parent | Run-checker merge CI: Replace no-shared with no-modules (diff) | |
download | openssl-efec0f4611ee854f2b0b3da0c135e839bf8e7d04.tar.xz openssl-efec0f4611ee854f2b0b3da0c135e839bf8e7d04.zip |
unbuffer stdin before get passwd from stdin
commond LD_LIBRARY_PATH= openssl rsa -aes256 -passout stdin <<< "xxxxxx” will get pass(fun app_get_pass()) from stdin first, and then load key(fun load_key()). but it unbuffer stdin before load key, this will cause the load key to fail.
now unbuffer stdin before get pass, this will solve https://github.com/openssl/openssl/issues/19835
CLA: trivial
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19851)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lib/apps.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/apps/lib/apps.c b/apps/lib/apps.c index bbe0d009ef..4bd2ab964d 100644 --- a/apps/lib/apps.c +++ b/apps/lib/apps.c @@ -301,6 +301,7 @@ static char *app_get_pass(const char *arg, int keepbio) pwdbio = BIO_push(btmp, pwdbio); #endif } else if (strcmp(arg, "stdin") == 0) { + unbuffer(stdin); pwdbio = dup_bio_in(FORMAT_TEXT); if (pwdbio == NULL) { BIO_printf(bio_err, "Can't open BIO for stdin\n"); |