@@ -72,10 +72,10 @@ typedef struct {
72
72
bool send_pending : 1 ; /**< TLS data is not yet send to network */
73
73
} eap_tls_sec_prot_int_t ;
74
74
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
77
77
78
- static uint16_t retry_timeout = FWH_RETRY_TIMEOUT_SMALL ;
78
+ static uint16_t retry_timeout = EAP_TLS_RETRY_TIMEOUT_SMALL ;
79
79
80
80
static uint16_t supp_eap_tls_sec_prot_size (void );
81
81
static 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
93
93
static int8_t supp_eap_tls_sec_prot_init_tls (sec_prot_t * prot );
94
94
static void supp_eap_tls_sec_prot_delete_tls (sec_prot_t * prot );
95
95
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 );
97
97
98
98
#define eap_tls_sec_prot_get (prot ) (eap_tls_sec_prot_int_t *) &prot->data
99
99
@@ -113,9 +113,9 @@ int8_t supp_eap_tls_sec_prot_register(kmp_service_t *service)
113
113
int8_t supp_eap_sec_prot_timing_adjust (uint8_t timing )
114
114
{
115
115
if (timing < 16 ) {
116
- retry_timeout = FWH_RETRY_TIMEOUT_SMALL ;
116
+ retry_timeout = EAP_TLS_RETRY_TIMEOUT_SMALL ;
117
117
} else {
118
- retry_timeout = FWH_RETRY_TIMEOUT_LARGE ;
118
+ retry_timeout = EAP_TLS_RETRY_TIMEOUT_LARGE ;
119
119
}
120
120
return 0 ;
121
121
}
@@ -493,7 +493,10 @@ static void supp_eap_tls_sec_prot_state_machine(sec_prot_t *prot)
493
493
}
494
494
495
495
// 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
+ }
497
500
498
501
// All fragments received for a message
499
502
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)
524
527
// Send EAP response
525
528
supp_eap_tls_sec_prot_message_send (prot , EAP_RESPONSE , EAP_TLS , EAP_TLS_EXCHANGE_ONGOING );
526
529
data -> send_pending = false;
527
-
528
- // Add more time for re-send if no response
529
- data -> common .ticks = retry_timeout ;
530
-
531
530
break ;
532
531
533
532
case EAP_TLS_STATE_FINISH :
@@ -550,10 +549,16 @@ static void supp_eap_tls_sec_prot_state_machine(sec_prot_t *prot)
550
549
}
551
550
}
552
551
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 )
554
553
{
555
554
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
+ }
556
560
data -> eap_id_seq = data -> recv_eapol_pdu .msg .eap .id_seq ;
561
+ return new_seq_id ;
557
562
}
558
563
559
564
#endif /* HAVE_WS */
0 commit comments