]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
eap-ttls: Fix build with DEBUG_LEVEL < 1
authorTobias Brunner <tobias@strongswan.org>
Wed, 3 May 2023 10:23:58 +0000 (12:23 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 8 May 2023 15:32:18 +0000 (17:32 +0200)
src/libcharon/plugins/eap_ttls/eap_ttls_peer.c
src/libcharon/plugins/eap_ttls/eap_ttls_server.c

index 4c8d3380441381f9a64e4178f9f44efffabe40fe..63126a5c3a87fe05982876183537d9986c17635c 100644 (file)
@@ -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);
index d7279ce8c9b66cd5fdc8d006be1d837480d1f402..fc97f811ca5e429ad5d309d1fff950b54f2bc325 100644 (file)
@@ -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);