From 6086029056285316ba2e968ca87468a3d2243e85 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 18 Apr 2023 16:57:16 +0200 Subject: [PATCH] libtls: Fix build with DEBUG_LEVEL < 3 --- src/libtls/tls_eap.c | 2 +- src/libtls/tls_fragmentation.c | 5 +++-- src/libtls/tls_peer.c | 2 +- src/libtls/tls_server.c | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libtls/tls_eap.c b/src/libtls/tls_eap.c index 4b16504b55..7928299b63 100644 --- a/src/libtls/tls_eap.c +++ b/src/libtls/tls_eap.c @@ -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) { diff --git a/src/libtls/tls_fragmentation.c b/src/libtls/tls_fragmentation.c index a53b1d0045..52149016f6 100644 --- a/src/libtls/tls_fragmentation.c +++ b/src/libtls/tls_fragmentation.c @@ -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) { diff --git a/src/libtls/tls_peer.c b/src/libtls/tls_peer.c index edddf3262d..78652c064a 100644 --- a/src/libtls/tls_peer.c +++ b/src/libtls/tls_peer.c @@ -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) { diff --git a/src/libtls/tls_server.c b/src/libtls/tls_server.c index 573893f2ef..e91e4e4407 100644 --- a/src/libtls/tls_server.c +++ b/src/libtls/tls_server.c @@ -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) { -- 2.47.2