Fix: PEM_read_bio_PrivateKey with no-ui / no-stdio
authorMat <mberchtold@gmail.com>
Mon, 9 May 2016 19:36:39 +0000 (21:36 +0200)
committerRich Salz <rsalz@openssl.org>
Tue, 31 May 2016 21:39:00 +0000 (17:39 -0400)
commitb01e1644d7f7a0d750340540385e93db7d180fd6
treea7825e76c7f2125418f2ff144d62240133ed31f6
parent80c630f6574a33b1c633815a174110d10ec37c60
Fix: PEM_read_bio_PrivateKey with no-ui / no-stdio

If openssl is compiled with no-ui or no-stdio, then PEM_read_bio_PrivateKey fails if a password but no callback is provided.

The reason is that the premature return in the PEM_def_callback implementation when OPENSSL_NO_STDIO or OPENSSL_NO_UI is defined, comes too early.

This patch moves the ifdef block to the correct place.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/pem/pem_lib.c