unbuffer stdin before get passwd from stdin
authorwangyuhang <524413304@qq.com>
Wed, 7 Dec 2022 08:48:16 +0000 (16:48 +0800)
committerPauli <pauli@openssl.org>
Sun, 11 Dec 2022 20:23:37 +0000 (07:23 +1100)
commitefec0f4611ee854f2b0b3da0c135e839bf8e7d04
tree7b6afebb63cba15938cd0b027db2cdd5971483af
parentd5696547e46e9ea85fcb7581b9d49c58b7c24eeb
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)
apps/lib/apps.c