summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEivind Næss <eivnaes@yahoo.com>2021-07-11 14:36:44 -0700
committerEivind Næss <eivnaes@yahoo.com>2021-07-20 08:24:08 -0700
commit6e6a48fe628b76ec368277fd52685428e3dc8766 (patch)
treef7d94663e4e75d6bc589c79288841addbdfa9ffd
parent2883dd07101bf851e2ea368f0c04c91aea85cff2 (diff)
downloadppp-6e6a48fe628b76ec368277fd52685428e3dc8766.tar.gz
Compiling with clang encounters an error in eap-tls.c
This moves the inline functions to outside the function and declares them static. Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
-rw-r--r--pppd/eap-tls.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/pppd/eap-tls.c b/pppd/eap-tls.c
index 265f6d5..b15d801 100644
--- a/pppd/eap-tls.c
+++ b/pppd/eap-tls.c
@@ -285,6 +285,23 @@ ENGINE *eaptls_ssl_load_engine( char *engine_name )
#endif
+#ifndef OPENSSL_NO_ENGINE
+static int eaptls_UI_writer(UI *ui, UI_STRING *uis)
+{
+ PW_CB_DATA* cb_data = (PW_CB_DATA*)UI_get0_user_data(ui);
+ UI_set_result(ui, uis, cb_data->password);
+ return 1;
+}
+
+static int eaptls_UI_stub(UI* ui) {
+ return 1;
+}
+
+static int eaptls_UI_reader(UI *ui, UI_STRING *uis) {
+ return 1;
+}
+#endif
+
/*
* Initialize the SSL stacks and tests if certificates, key and crl
* for client or server use can be loaded.
@@ -578,20 +595,11 @@ SSL_CTX *eaptls_init_ssl(int init_server, char *cacertfile, char *capath,
{
UI_METHOD* transfer_pin = UI_create_method("transfer_pin");
- int writer (UI *ui, UI_STRING *uis)
- {
- PW_CB_DATA* cb_data = (PW_CB_DATA*)UI_get0_user_data(ui);
- UI_set_result(ui, uis, cb_data->password);
- return 1;
- };
- int stub (UI* ui) {return 1;};
- int stub_reader (UI *ui, UI_STRING *uis) {return 1;};
-
- UI_method_set_writer(transfer_pin, writer);
- UI_method_set_opener(transfer_pin, stub);
- UI_method_set_closer(transfer_pin, stub);
- UI_method_set_flusher(transfer_pin, stub);
- UI_method_set_reader(transfer_pin, stub_reader);
+ UI_method_set_writer(transfer_pin, eaptls_UI_writer);
+ UI_method_set_opener(transfer_pin, eaptls_UI_stub);
+ UI_method_set_closer(transfer_pin, eaptls_UI_stub);
+ UI_method_set_flusher(transfer_pin, eaptls_UI_stub);
+ UI_method_set_reader(transfer_pin, eaptls_UI_reader);
dbglog( "Using our private key URI: '%s' in engine", privkeyfile );
pkey = ENGINE_load_private_key(pkey_engine, privkeyfile, transfer_pin, &cb_data);