summaryrefslogtreecommitdiffstats
path: root/apps/apps.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-03-21 18:08:57 +0100
committerRichard Levitte <levitte@openssl.org>2016-03-31 13:32:01 +0200
commit923b1857decf4440b13b82f2aa7cf1189327d1a3 (patch)
tree6b6a6387610cdad0b7a1bdbb0b23da12ac80bc94 /apps/apps.c
parent4de9913b8c2a11f17258a2ad5e357046fd221360 (diff)
Fix "no-ui" configuration
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'apps/apps.c')
-rw-r--r--apps/apps.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/apps.c b/apps/apps.c
index e1241495ea..7ba12fea5a 100644
--- a/apps/apps.c
+++ b/apps/apps.c
@@ -266,6 +266,7 @@ int dump_cert_text(BIO *out, X509 *x)
return 0;
}
+#ifndef OPENSSL_NO_UI
static int ui_open(UI *ui)
{
return UI_method_get_opener(UI_OpenSSL())(ui);
@@ -335,20 +336,25 @@ void destroy_ui_method(void)
ui_method = NULL;
}
}
+#endif
int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
{
- UI *ui = NULL;
int res = 0;
+#ifndef OPENSSL_NO_UI
+ UI *ui = NULL;
const char *prompt_info = NULL;
+#endif
const char *password = NULL;
PW_CB_DATA *cb_data = (PW_CB_DATA *)cb_tmp;
if (cb_data) {
if (cb_data->password)
password = cb_data->password;
+#ifndef OPENSSL_NO_UI
if (cb_data->prompt_info)
prompt_info = cb_data->prompt_info;
+#endif
}
if (password) {
@@ -359,6 +365,7 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
return res;
}
+#ifndef OPENSSL_NO_UI
ui = UI_new_method(ui_method);
if (ui) {
int ok = 0;
@@ -408,6 +415,7 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
UI_free(ui);
OPENSSL_free(prompt);
}
+#endif
return res;
}