]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
eap_tls_data was already checked.
authorAlan T. DeKok <aland@freeradius.org>
Fri, 26 May 2017 12:54:44 +0000 (08:54 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 26 May 2017 13:24:57 +0000 (09:24 -0400)
CID #1339404

src/modules/rlm_eap/lib/base/eap_tls.c

index 2df39aad679eb3ef7779ec3a33309ab6ac7276ca..9ef0f7003a656c301c1ae35a3a388ffd56098757 100644 (file)
@@ -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;