Skip to content

Commit f562de5

Browse files
author
Mika Leppänen
committed
Corrected supplicant EAP-TLS sequence id validation
Suplicant now ignores messages with old sequence id i.e. value less than previously used by the authenticator.
1 parent bf36b5a commit f562de5

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

source/Security/protocols/eap_tls_sec_prot/auth_eap_tls_sec_prot.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,6 @@ static void auth_eap_tls_sec_prot_state_machine(sec_prot_t *prot)
405405
return;
406406
}
407407

408-
// Increment sequence ID
409-
//auth_eap_tls_sec_prot_seq_id_update(prot);
410-
411408
// Sends EAP request, TLS EAP start
412409
auth_eap_tls_sec_prot_message_send(prot, EAP_REQ, EAP_TLS, EAP_TLS_EXCHANGE_START);
413410

source/Security/protocols/eap_tls_sec_prot/supp_eap_tls_sec_prot.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,19 @@ static int8_t supp_eap_tls_sec_prot_message_handle(sec_prot_t *prot)
186186
uint8_t *data_ptr = data->recv_eapol_pdu.msg.eap.data_ptr;
187187
uint16_t length = data->recv_eapol_pdu.msg.eap.length;
188188

189+
tr_info("EAP-TLS recv %s type %s id %i flags %x len %i", eap_msg_trace[data->eap_code - 1],
190+
data->eap_type == EAP_IDENTITY ? "IDENTITY" : "TLS", data->recv_eapol_pdu.msg.eap.id_seq,
191+
length >= 6 ? data_ptr[0] : 0, length);
192+
189193
uint8_t new_seq_id = false;
194+
// New sequence identifier received
190195
if (data->recv_eapol_pdu.msg.eap.id_seq > data->eap_id_seq) {
191196
new_seq_id = true;
197+
} else if (data->recv_eapol_pdu.msg.eap.id_seq < data->eap_id_seq) {
198+
// Already received sequence ID is received again, ignore
199+
return EAP_TLS_MSG_DECODE_ERROR;
192200
}
193201

194-
tr_info("EAP-TLS recv %s type %s id %i flags %x len %i", eap_msg_trace[data->eap_code - 1],
195-
data->eap_type == EAP_IDENTITY ? "IDENTITY" : "TLS", data->recv_eapol_pdu.msg.eap.id_seq,
196-
length >= 6 ? data_ptr[0] : 0, length);
197-
198202
if (data->eap_type == EAP_IDENTITY) {
199203
return EAP_TLS_MSG_IDENTITY;
200204
}

0 commit comments

Comments
 (0)