From: Alan T. DeKok Date: Fri, 26 May 2017 12:54:44 +0000 (-0400) Subject: eap_tls_data was already checked. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c5a330d3397839cd17f4e4e72caa1a186671802;p=thirdparty%2Ffreeradius-server.git eap_tls_data was already checked. CID #1339404 --- diff --git a/src/modules/rlm_eap/lib/base/eap_tls.c b/src/modules/rlm_eap/lib/base/eap_tls.c index 2df39aad679..9ef0f7003a6 100644 --- a/src/modules/rlm_eap/lib/base/eap_tls.c +++ b/src/modules/rlm_eap/lib/base/eap_tls.c @@ -569,6 +569,10 @@ static eap_tls_status_t eap_tls_verify(eap_session_t *eap_session) * is too short. See eap_validate()., in ../../eap.c */ eap_tls_data = (eap_tls_data_t *)this_round->response->type.data; + if (eap_tls_data) { + RDEBUG("Invalid EAP-TLS packet; no data"); + return EAP_TLS_INVALID; + } /* * First output the flags (for debugging) @@ -602,9 +606,8 @@ static eap_tls_status_t eap_tls_verify(eap_session_t *eap_session) * * Find if this is a reply to the previous request sent */ - if ((!eap_tls_data) || - ((this_round->response->length == EAP_HEADER_LEN + 2) && - ((eap_tls_data->flags & 0xc0) == 0x00))) { + if ((this_round->response->length == EAP_HEADER_LEN + 2) && + ((eap_tls_data->flags & 0xc0) == 0x00)) { if (!prev_round || (prev_round->request->id != this_round->response->id)) { REDEBUG("Received Invalid TLS ACK"); return EAP_TLS_INVALID;