@@ -72,10 +72,10 @@ typedef struct {
7272 bool send_pending : 1 ; /**< TLS data is not yet send to network */
7373} eap_tls_sec_prot_int_t ;
7474
75- #define FWH_RETRY_TIMEOUT_SMALL 330*10 // retry timeout for small network additional 30 seconds for authenticator delay
76- #define FWH_RETRY_TIMEOUT_LARGE 750*10 // retry timeout for large network additional 30 seconds for authenticator delay
75+ #define EAP_TLS_RETRY_TIMEOUT_SMALL 330*10 // retry timeout for small network additional 30 seconds for authenticator delay
76+ #define EAP_TLS_RETRY_TIMEOUT_LARGE 750*10 // retry timeout for large network additional 30 seconds for authenticator delay
7777
78- static uint16_t retry_timeout = FWH_RETRY_TIMEOUT_SMALL ;
78+ static uint16_t retry_timeout = EAP_TLS_RETRY_TIMEOUT_SMALL ;
7979
8080static uint16_t supp_eap_tls_sec_prot_size (void );
8181static int8_t supp_eap_tls_sec_prot_init (sec_prot_t * prot );
@@ -93,7 +93,7 @@ static void supp_eap_tls_sec_prot_timer_timeout(sec_prot_t *prot, uint16_t ticks
9393static int8_t supp_eap_tls_sec_prot_init_tls (sec_prot_t * prot );
9494static void supp_eap_tls_sec_prot_delete_tls (sec_prot_t * prot );
9595
96- static void supp_eap_tls_sec_prot_seq_id_update (sec_prot_t * prot );
96+ static bool supp_eap_tls_sec_prot_seq_id_update (sec_prot_t * prot );
9797
9898#define eap_tls_sec_prot_get (prot ) (eap_tls_sec_prot_int_t *) &prot->data
9999
@@ -113,9 +113,9 @@ int8_t supp_eap_tls_sec_prot_register(kmp_service_t *service)
113113int8_t supp_eap_sec_prot_timing_adjust (uint8_t timing )
114114{
115115 if (timing < 16 ) {
116- retry_timeout = FWH_RETRY_TIMEOUT_SMALL ;
116+ retry_timeout = EAP_TLS_RETRY_TIMEOUT_SMALL ;
117117 } else {
118- retry_timeout = FWH_RETRY_TIMEOUT_LARGE ;
118+ retry_timeout = EAP_TLS_RETRY_TIMEOUT_LARGE ;
119119 }
120120 return 0 ;
121121}
@@ -493,7 +493,10 @@ static void supp_eap_tls_sec_prot_state_machine(sec_prot_t *prot)
493493 }
494494
495495 // Store sequence ID
496- supp_eap_tls_sec_prot_seq_id_update (prot );
496+ if (supp_eap_tls_sec_prot_seq_id_update (prot )) {
497+ // When receiving a new sequence number, adds more time for re-send if no response
498+ data -> common .ticks = retry_timeout ;
499+ }
497500
498501 // All fragments received for a message
499502 if (result == EAP_TLS_MSG_RECEIVE_DONE && data -> tls_ongoing ) {
@@ -524,10 +527,6 @@ static void supp_eap_tls_sec_prot_state_machine(sec_prot_t *prot)
524527 // Send EAP response
525528 supp_eap_tls_sec_prot_message_send (prot , EAP_RESPONSE , EAP_TLS , EAP_TLS_EXCHANGE_ONGOING );
526529 data -> send_pending = false;
527-
528- // Add more time for re-send if no response
529- data -> common .ticks = retry_timeout ;
530-
531530 break ;
532531
533532 case EAP_TLS_STATE_FINISH :
@@ -550,10 +549,16 @@ static void supp_eap_tls_sec_prot_state_machine(sec_prot_t *prot)
550549 }
551550}
552551
553- static void supp_eap_tls_sec_prot_seq_id_update (sec_prot_t * prot )
552+ static bool supp_eap_tls_sec_prot_seq_id_update (sec_prot_t * prot )
554553{
555554 eap_tls_sec_prot_int_t * data = eap_tls_sec_prot_get (prot );
555+ bool new_seq_id = false;
556+
557+ if (data -> recv_eapol_pdu .msg .eap .id_seq > data -> eap_id_seq ) {
558+ new_seq_id = true;
559+ }
556560 data -> eap_id_seq = data -> recv_eapol_pdu .msg .eap .id_seq ;
561+ return new_seq_id ;
557562}
558563
559564#endif /* HAVE_WS */
0 commit comments