From e8d3f50249a7bd7a80a585830a318635834f435d Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Thu, 26 Apr 2018 15:27:54 +0200 Subject: [PATCH] Fix no-ui In a recent commit, a OPENSSL_NO_UI guard was dropped by mistake in PEM_def_callback(), so this puts it back. At the same time, that previous commit got rid of the necessity to have a OPENSSL_NO_STDIO guard, so we drop that instead. Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/6096) --- crypto/pem/pem_lib.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index 04d374ba52..fdf2b006dc 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -30,8 +30,11 @@ int pem_check_suffix(const char *pem_str, const char *suffix); int PEM_def_callback(char *buf, int num, int rwflag, void *userdata) { - int i, min_len; + int i; +#ifndef OPENSSL_NO_UI + int min_len; const char *prompt; +#endif /* We assume that the user passes a default password as userdata */ if (userdata) { @@ -41,7 +44,7 @@ int PEM_def_callback(char *buf, int num, int rwflag, void *userdata) return i; } -#if defined(OPENSSL_NO_STDIO) || defined(OPENSSL_NO_UI) +#ifdef OPENSSL_NO_UI PEMerr(PEM_F_PEM_DEF_CALLBACK, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return -1; #else -- 2.25.1