From: Tobias Brunner Date: Wed, 3 May 2023 10:23:58 +0000 (+0200) Subject: eap-ttls: Fix build with DEBUG_LEVEL < 1 X-Git-Tag: 5.9.11rc1~12^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e252e1b4651bf912b115b07e72de8607a88863da;p=thirdparty%2Fstrongswan.git eap-ttls: Fix build with DEBUG_LEVEL < 1 --- diff --git a/src/libcharon/plugins/eap_ttls/eap_ttls_peer.c b/src/libcharon/plugins/eap_ttls/eap_ttls_peer.c index 4c8d338044..63126a5c3a 100644 --- a/src/libcharon/plugins/eap_ttls/eap_ttls_peer.c +++ b/src/libcharon/plugins/eap_ttls/eap_ttls_peer.c @@ -79,7 +79,7 @@ METHOD(tls_application_t, process, status_t, pen_t vendor, received_vendor; uint16_t eap_len; size_t eap_pos = 0; - bool concatenated = FALSE; + bool concatenated DBG_UNUSED = FALSE; do { @@ -239,9 +239,6 @@ METHOD(tls_application_t, build, status_t, private_eap_ttls_peer_t *this, bio_writer_t *writer) { chunk_t data; - eap_code_t code; - eap_type_t type; - pen_t vendor; if (this->method == NULL && this->start_phase2) { @@ -261,11 +258,13 @@ METHOD(tls_application_t, build, status_t, if (this->out) { - code = this->out->get_code(this->out); - type = this->out->get_type(this->out, &vendor); +#if DEBUG_LEVEL >= 1 + pen_t vendor; + eap_code_t code = this->out->get_code(this->out); + eap_type_t type = this->out->get_type(this->out, &vendor); DBG1(DBG_IKE, "sending tunneled EAP-TTLS AVP [EAP/%N/%N]", - eap_code_short_names, code, eap_type_short_names, type); - + eap_code_short_names, code, eap_type_short_names, type); +#endif /* get the raw EAP message data */ data = this->out->get_data(this->out); this->avp->build(this->avp, writer, data); diff --git a/src/libcharon/plugins/eap_ttls/eap_ttls_server.c b/src/libcharon/plugins/eap_ttls/eap_ttls_server.c index d7279ce8c9..fc97f811ca 100644 --- a/src/libcharon/plugins/eap_ttls/eap_ttls_server.c +++ b/src/libcharon/plugins/eap_ttls/eap_ttls_server.c @@ -308,9 +308,6 @@ METHOD(tls_application_t, build, status_t, private_eap_ttls_server_t *this, bio_writer_t *writer) { chunk_t data; - eap_code_t code; - eap_type_t type; - pen_t vendor; if (this->method == NULL && this->start_phase2 && lib->settings->get_bool(lib->settings, @@ -333,10 +330,13 @@ METHOD(tls_application_t, build, status_t, if (this->out) { - code = this->out->get_code(this->out); - type = this->out->get_type(this->out, &vendor); +#if DEBUG_LEVEL >= 1 + pen_t vendor; + eap_code_t code = this->out->get_code(this->out); + eap_type_t type = this->out->get_type(this->out, &vendor); DBG1(DBG_IKE, "sending tunneled EAP-TTLS AVP [EAP/%N/%N]", - eap_code_short_names, code, eap_type_short_names, type); + eap_code_short_names, code, eap_type_short_names, type); +#endif /* get the raw EAP message data */ data = this->out->get_data(this->out);