libtls: Fix build with DEBUG_LEVEL < 3

This commit is contained in:
Tobias Brunner 2023-04-18 16:57:16 +02:00
parent bb06b7a4bb
commit 6086029056
4 changed files with 6 additions and 5 deletions

View File

@ -210,7 +210,7 @@ static status_t build_pkt(private_tls_eap_t *this, chunk_t *out)
eap_tls_packet_t *pkt; eap_tls_packet_t *pkt;
size_t len, reclen, msg_len_offset; size_t len, reclen, msg_len_offset;
status_t status; status_t status;
char *kind; char *kind DBG_UNUSED;
if (this->is_server) if (this->is_server)
{ {

View File

@ -230,7 +230,6 @@ static status_t process_application(private_tls_fragmentation_t *this,
while (reader->remaining(reader)) while (reader->remaining(reader))
{ {
status_t status; status_t status;
chunk_t data;
if (reader->remaining(reader) > TLS_MAX_FRAGMENT_LEN) 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); this->alert->add(this->alert, TLS_FATAL, TLS_DECODE_ERROR);
return NEED_MORE; return NEED_MORE;
} }
data = reader->peek(reader); #if DEBUG_LEVEL >= 3
chunk_t data = reader->peek(reader);
DBG3(DBG_TLS, "%B", &data); DBG3(DBG_TLS, "%B", &data);
#endif
status = this->application->process(this->application, reader); status = this->application->process(this->application, reader);
switch (status) switch (status)
{ {

View File

@ -1112,7 +1112,7 @@ static status_t process_key_update(private_tls_peer_t *this,
METHOD(tls_handshake_t, process, status_t, METHOD(tls_handshake_t, process, status_t,
private_tls_peer_t *this, tls_handshake_type_t type, bio_reader_t *reader) 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) if (this->tls->get_version_max(this->tls) < TLS_1_3)
{ {

View File

@ -1042,7 +1042,7 @@ static status_t process_key_update(private_tls_server_t *this,
METHOD(tls_handshake_t, process, status_t, METHOD(tls_handshake_t, process, status_t,
private_tls_server_t *this, tls_handshake_type_t type, bio_reader_t *reader) 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) if (this->tls->get_version_max(this->tls) < TLS_1_3)
{ {