Skip to content

Commit

Permalink
be more careful about session established. Fixes #4878
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Feb 1, 2023
1 parent 3840e25 commit 0812bc1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -5338,7 +5338,13 @@ fr_tls_status_t tls_ack_handler(tls_session_t *ssn, REQUEST *request)
return FR_TLS_FAIL;

case handshake:
if ((ssn->is_init_finished) && (ssn->dirty_out.used == 0)) {
if (ssn->dirty_out.used > 0) {
RDEBUG2("(TLS) Peer ACKed our handshake fragment");
/* Fragmentation handler, send next fragment */
return FR_TLS_REQUEST;
}

if (ssn->is_init_finished || SSL_is_init_finished(ssn->ssl)) {
RDEBUG2("(TLS) Peer ACKed our handshake fragment. handshake is finished");

/*
Expand All @@ -5350,9 +5356,8 @@ fr_tls_status_t tls_ack_handler(tls_session_t *ssn, REQUEST *request)
return FR_TLS_SUCCESS;
} /* else more data to send */

RDEBUG2("(TLS) Peer ACKed our handshake fragment");
/* Fragmentation handler, send next fragment */
return FR_TLS_REQUEST;
REDEBUG("(TLS) Cannot continue, as the peer is misbehaving.");
return FR_TLS_FAIL;

case application_data:
RDEBUG2("(TLS) Peer ACKed our application data fragment");
Expand Down

0 comments on commit 0812bc1

Please sign in to comment.