]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
libtls: Fix build with DEBUG_LEVEL < 3
authorTobias Brunner <tobias@strongswan.org>
Tue, 18 Apr 2023 14:57:16 +0000 (16:57 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 8 May 2023 15:32:17 +0000 (17:32 +0200)
src/libtls/tls_eap.c
src/libtls/tls_fragmentation.c
src/libtls/tls_peer.c
src/libtls/tls_server.c

index 4b16504b557544b69646e945540b617198099eed..7928299b6369377400f4192dab6790fcc4581bac 100644 (file)
@@ -210,7 +210,7 @@ static status_t build_pkt(private_tls_eap_t *this, chunk_t *out)
        eap_tls_packet_t *pkt;
        size_t len, reclen, msg_len_offset;
        status_t status;
-       char *kind;
+       char *kind DBG_UNUSED;
 
        if (this->is_server)
        {
index a53b1d0045586019af357526c3f007afd6d86a25..52149016f68cb1eac8f4dcb85ec6786a571e6240 100644 (file)
@@ -230,7 +230,6 @@ static status_t process_application(private_tls_fragmentation_t *this,
        while (reader->remaining(reader))
        {
                status_t status;
-               chunk_t data;
 
                if (reader->remaining(reader) > TLS_MAX_FRAGMENT_LEN)
                {
@@ -238,8 +237,10 @@ static status_t process_application(private_tls_fragmentation_t *this,
                        this->alert->add(this->alert, TLS_FATAL, TLS_DECODE_ERROR);
                        return NEED_MORE;
                }
-               data = reader->peek(reader);
+#if DEBUG_LEVEL >= 3
+               chunk_t data = reader->peek(reader);
                DBG3(DBG_TLS, "%B", &data);
+#endif
                status = this->application->process(this->application, reader);
                switch (status)
                {
index edddf3262d1424d27db694573dd761b6616e58d3..78652c064a5252fec493274f12df7c33932b860a 100644 (file)
@@ -1112,7 +1112,7 @@ static status_t process_key_update(private_tls_peer_t *this,
 METHOD(tls_handshake_t, process, status_t,
        private_tls_peer_t *this, tls_handshake_type_t type, bio_reader_t *reader)
 {
-       tls_handshake_type_t expected;
+       tls_handshake_type_t expected DBG_UNUSED;
 
        if (this->tls->get_version_max(this->tls) < TLS_1_3)
        {
index 573893f2efb5e9fe48fb21a1eb45f74a1160fc20..e91e4e4407ea8e8340bef010a3cc72c28ceb6731 100644 (file)
@@ -1042,7 +1042,7 @@ static status_t process_key_update(private_tls_server_t *this,
 METHOD(tls_handshake_t, process, status_t,
        private_tls_server_t *this, tls_handshake_type_t type, bio_reader_t *reader)
 {
-       tls_handshake_type_t expected;
+       tls_handshake_type_t expected DBG_UNUSED;
 
        if (this->tls->get_version_max(this->tls) < TLS_1_3)
        {