Skip to content

Commit

Permalink
Corrected supplicant EAP-TLS sequence id validation
Browse files Browse the repository at this point in the history
Suplicant now ignores messages with old sequence id i.e. value
less than previously used by the authenticator.
  • Loading branch information
Mika Leppänen committed May 9, 2019
1 parent bf36b5a commit f562de5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,6 @@ static void auth_eap_tls_sec_prot_state_machine(sec_prot_t *prot)
return;
}

// Increment sequence ID
//auth_eap_tls_sec_prot_seq_id_update(prot);

// Sends EAP request, TLS EAP start
auth_eap_tls_sec_prot_message_send(prot, EAP_REQ, EAP_TLS, EAP_TLS_EXCHANGE_START);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,19 @@ static int8_t supp_eap_tls_sec_prot_message_handle(sec_prot_t *prot)
uint8_t *data_ptr = data->recv_eapol_pdu.msg.eap.data_ptr;
uint16_t length = data->recv_eapol_pdu.msg.eap.length;

tr_info("EAP-TLS recv %s type %s id %i flags %x len %i", eap_msg_trace[data->eap_code - 1],
data->eap_type == EAP_IDENTITY ? "IDENTITY" : "TLS", data->recv_eapol_pdu.msg.eap.id_seq,
length >= 6 ? data_ptr[0] : 0, length);

uint8_t new_seq_id = false;
// New sequence identifier received
if (data->recv_eapol_pdu.msg.eap.id_seq > data->eap_id_seq) {
new_seq_id = true;
} else if (data->recv_eapol_pdu.msg.eap.id_seq < data->eap_id_seq) {
// Already received sequence ID is received again, ignore
return EAP_TLS_MSG_DECODE_ERROR;
}

tr_info("EAP-TLS recv %s type %s id %i flags %x len %i", eap_msg_trace[data->eap_code - 1],
data->eap_type == EAP_IDENTITY ? "IDENTITY" : "TLS", data->recv_eapol_pdu.msg.eap.id_seq,
length >= 6 ? data_ptr[0] : 0, length);

if (data->eap_type == EAP_IDENTITY) {
return EAP_TLS_MSG_IDENTITY;
}
Expand Down

0 comments on commit f562de5

Please sign in to comment.