Skip to content

Commit 38dd4a6

Browse files
author
Mika Leppänen
committed
Corrected PTK and PMK lifetime handling
- Changed PMK/PTK lifetime update timer to one second resolution from 60 seconds on authenticator, since amount of active supplicants is now limited (based on configuration e.g. to 50). - Changed security protocols to init the PMK/PTK lifetime rigth away to configured value and not to init needed value. This required adding the EAPOL timer configuration structure to security protocol structure so that it is available to security protocols. - Added storing/reading of PMK/PTK lifetime to/from NVM on supplicant, that was missing on NVM data storing functions.
1 parent 64f2a77 commit 38dd4a6

20 files changed

+129
-92
lines changed

source/6LoWPAN/ws/ws_pae_auth.c

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ typedef struct {
9898
sec_timer_cfg_t *sec_timer_cfg; /**< Timer configuration */
9999
sec_prot_cfg_t *sec_prot_cfg; /**< Protocol Configuration */
100100
uint16_t supp_max_number; /**< Max number of stored supplicants */
101-
uint16_t slow_timer_seconds; /**< Slow timer seconds */
102101
bool timer_running : 1; /**< Timer is running */
103102
bool gtk_new_inst_req_exp : 1; /**< GTK new install required timer expired */
104103
bool gtk_new_act_time_exp: 1; /**< GTK new activation time expired */
@@ -127,7 +126,7 @@ static void ws_pae_auth_kmp_api_create_indication(kmp_api_t *kmp, kmp_type_e typ
127126
static void ws_pae_auth_kmp_api_finished_indication(kmp_api_t *kmp, kmp_result_e result, kmp_sec_keys_t *sec_keys);
128127
static void ws_pae_auth_next_kmp_trigger(pae_auth_t *pae_auth, supp_entry_t *supp_entry);
129128
static kmp_type_e ws_pae_auth_next_protocol_get(pae_auth_t *pae_auth, supp_entry_t *supp_entry);
130-
static kmp_api_t *ws_pae_auth_kmp_create_and_start(kmp_service_t *service, kmp_type_e type, supp_entry_t *supp_entry, sec_prot_cfg_t *cfg);
129+
static kmp_api_t *ws_pae_auth_kmp_create_and_start(kmp_service_t *service, kmp_type_e type, supp_entry_t *supp_entry, sec_prot_cfg_t *prot_cfg, sec_timer_cfg_t *timer_cfg);
131130
static void ws_pae_auth_kmp_api_finished(kmp_api_t *kmp);
132131

133132
static int8_t tasklet_id = -1;
@@ -167,7 +166,6 @@ int8_t ws_pae_auth_init(protocol_interface_info_entry_t *interface_ptr, sec_prot
167166
pae_auth->sec_prot_cfg = sec_prot_cfg;
168167
pae_auth->supp_max_number = SUPPLICANT_MAX_NUMBER;
169168

170-
pae_auth->slow_timer_seconds = 0;
171169
pae_auth->gtk_new_inst_req_exp = false;
172170
pae_auth->gtk_new_act_time_exp = false;
173171

@@ -708,11 +706,7 @@ void ws_pae_auth_slow_timer(uint16_t seconds)
708706
}
709707
}
710708

711-
pae_auth->slow_timer_seconds += seconds;
712-
if (pae_auth->slow_timer_seconds > 60) {
713-
ws_pae_lib_supp_list_slow_timer_update(&pae_auth->active_supp_list, pae_auth->sec_timer_cfg, pae_auth->slow_timer_seconds);
714-
pae_auth->slow_timer_seconds = 0;
715-
}
709+
ws_pae_lib_supp_list_slow_timer_update(&pae_auth->active_supp_list, seconds);
716710
}
717711

718712
// Update key storage timer
@@ -905,7 +899,7 @@ static kmp_api_t *ws_pae_auth_kmp_incoming_ind(kmp_service_t *service, kmp_type_
905899
}
906900

907901
// Create a new KMP for initial eapol-key
908-
kmp = kmp_api_create(service, type + IEEE_802_1X_INITIAL_KEY, pae_auth->sec_prot_cfg);
902+
kmp = kmp_api_create(service, type + IEEE_802_1X_INITIAL_KEY, pae_auth->sec_prot_cfg, pae_auth->sec_timer_cfg);
909903

910904
if (!kmp) {
911905
return 0;
@@ -1020,7 +1014,7 @@ static void ws_pae_auth_next_kmp_trigger(pae_auth_t *pae_auth, supp_entry_t *sup
10201014
}
10211015

10221016
// Create new instance
1023-
kmp_api_t *new_kmp = ws_pae_auth_kmp_create_and_start(pae_auth->kmp_service, next_type, supp_entry, pae_auth->sec_prot_cfg);
1017+
kmp_api_t *new_kmp = ws_pae_auth_kmp_create_and_start(pae_auth->kmp_service, next_type, supp_entry, pae_auth->sec_prot_cfg, pae_auth->sec_timer_cfg);
10241018
if (!new_kmp) {
10251019
return;
10261020
}
@@ -1033,7 +1027,7 @@ static void ws_pae_auth_next_kmp_trigger(pae_auth_t *pae_auth, supp_entry_t *sup
10331027
return;
10341028
}
10351029
// Create TLS instance */
1036-
if (ws_pae_auth_kmp_create_and_start(pae_auth->kmp_service, TLS_PROT, supp_entry, pae_auth->sec_prot_cfg) == NULL) {
1030+
if (ws_pae_auth_kmp_create_and_start(pae_auth->kmp_service, TLS_PROT, supp_entry, pae_auth->sec_prot_cfg, pae_auth->sec_timer_cfg) == NULL) {
10371031
ws_pae_lib_kmp_list_delete(&supp_entry->kmp_list, new_kmp);
10381032
return;
10391033
}
@@ -1100,10 +1094,10 @@ static kmp_type_e ws_pae_auth_next_protocol_get(pae_auth_t *pae_auth, supp_entry
11001094
return next_type;
11011095
}
11021096

1103-
static kmp_api_t *ws_pae_auth_kmp_create_and_start(kmp_service_t *service, kmp_type_e type, supp_entry_t *supp_entry, sec_prot_cfg_t *cfg)
1097+
static kmp_api_t *ws_pae_auth_kmp_create_and_start(kmp_service_t *service, kmp_type_e type, supp_entry_t *supp_entry, sec_prot_cfg_t *prot_cfg, sec_timer_cfg_t *timer_cfg)
11041098
{
11051099
// Create KMP instance for new authentication
1106-
kmp_api_t *kmp = kmp_api_create(service, type, cfg);
1100+
kmp_api_t *kmp = kmp_api_create(service, type, prot_cfg, timer_cfg);
11071101

11081102
if (!kmp) {
11091103
return NULL;

source/6LoWPAN/ws/ws_pae_lib.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
#include "NWK_INTERFACE/Include/protocol.h"
2727
#include "6LoWPAN/ws/ws_cfg_settings.h"
2828
#include "6LoWPAN/ws/ws_config.h"
29-
#include "6LoWPAN/ws/ws_pae_timers.h"
3029
#include "Security/protocols/sec_prot_cfg.h"
30+
#include "6LoWPAN/ws/ws_pae_timers.h"
3131
#include "Security/kmp/kmp_addr.h"
3232
#include "Security/kmp/kmp_api.h"
3333
#include "Security/protocols/sec_prot_certs.h"
@@ -242,17 +242,16 @@ bool ws_pae_lib_supp_list_timer_update(void *instance, supp_list_t *active_supp_
242242
return timer_running;
243243
}
244244

245-
void ws_pae_lib_supp_list_slow_timer_update(supp_list_t *supp_list, sec_timer_cfg_t *timer_settings, uint16_t seconds)
245+
void ws_pae_lib_supp_list_slow_timer_update(supp_list_t *supp_list, uint16_t seconds)
246246
{
247247
ns_list_foreach(supp_entry_t, entry, supp_list) {
248-
if (sec_prot_keys_pmk_lifetime_decrement(&entry->sec_keys, timer_settings->pmk_lifetime, seconds)) {
248+
if (sec_prot_keys_pmk_lifetime_decrement(&entry->sec_keys, seconds)) {
249249
tr_info("PMK and PTK expired, eui-64: %s, system time: %"PRIu32"", trace_array(entry->addr.eui_64, 8), protocol_core_monotonic_time / 10);
250250
}
251-
if (sec_prot_keys_ptk_lifetime_decrement(&entry->sec_keys, timer_settings->ptk_lifetime, seconds)) {
251+
if (sec_prot_keys_ptk_lifetime_decrement(&entry->sec_keys, seconds)) {
252252
tr_info("PTK expired, eui-64: %s, system time: %"PRIu32"", trace_array(entry->addr.eui_64, 8), protocol_core_monotonic_time / 10);
253253
}
254254
}
255-
256255
}
257256

258257
void ws_pae_lib_supp_init(supp_entry_t *entry)

source/6LoWPAN/ws/ws_pae_lib.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,10 @@ bool ws_pae_lib_supp_list_timer_update(void *instance, supp_list_t *active_supp_
252252
* ws_pae_lib_supp_list_slow_timer_update updates slow timer on supplicant list
253253
*
254254
* \param supp_list list of supplicants
255-
* \param timer_settings timer settings
256255
* \param seconds seconds
257256
*
258257
*/
259-
void ws_pae_lib_supp_list_slow_timer_update(supp_list_t *supp_list, sec_timer_cfg_t *timer_settings, uint16_t seconds);
258+
void ws_pae_lib_supp_list_slow_timer_update(supp_list_t *supp_list, uint16_t seconds);
260259

261260
/**
262261
* ws_pae_lib_supp_list_timer_update updates supplicant timers

source/6LoWPAN/ws/ws_pae_nvm_data.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,12 @@ void ws_pae_nvm_store_keys_tlv_create(nvm_tlv_t *tlv_entry, sec_prot_keys_t *sec
204204
uint8_t *pmk = sec_prot_keys_pmk_get(sec_keys);
205205
if (pmk) {
206206
*tlv++ = PAE_NVM_FIELD_SET;
207+
uint32_t lifetime = sec_prot_keys_pmk_lifetime_get(sec_keys);
208+
tlv = common_write_32_bit(lifetime, tlv);
207209
memcpy(tlv, pmk, PMK_LEN);
208210
} else {
209211
*tlv++ = PAE_NVM_FIELD_NOT_SET;
210-
memset(tlv, 0, PMK_LEN);
212+
memset(tlv, 0, 4 + PMK_LEN);
211213
}
212214
tlv += PMK_LEN;
213215

@@ -217,10 +219,12 @@ void ws_pae_nvm_store_keys_tlv_create(nvm_tlv_t *tlv_entry, sec_prot_keys_t *sec
217219
uint8_t *ptk = sec_prot_keys_ptk_get(sec_keys);
218220
if (ptk) {
219221
*tlv++ = PAE_NVM_FIELD_SET;
222+
uint32_t lifetime = sec_prot_keys_ptk_lifetime_get(sec_keys);
223+
tlv = common_write_32_bit(lifetime, tlv);
220224
memcpy(tlv, ptk, PTK_LEN);
221225
} else {
222226
*tlv++ = PAE_NVM_FIELD_NOT_SET;
223-
memset(tlv, 0, PTK_LEN);
227+
memset(tlv, 0, 4 + PTK_LEN);
224228
}
225229
tlv += PTK_LEN;
226230

@@ -247,7 +251,11 @@ int8_t ws_pae_nvm_store_keys_tlv_read(nvm_tlv_t *tlv_entry, sec_prot_keys_t *sec
247251

248252
// PMK set
249253
if (*tlv++ == PAE_NVM_FIELD_SET) {
250-
sec_prot_keys_pmk_write(sec_keys, tlv);
254+
uint32_t lifetime = common_read_32_bit(tlv);
255+
tlv += 4;
256+
sec_prot_keys_pmk_write(sec_keys, tlv, lifetime);
257+
} else {
258+
tlv += 4;
251259
}
252260
tlv += PMK_LEN;
253261

@@ -257,7 +265,11 @@ int8_t ws_pae_nvm_store_keys_tlv_read(nvm_tlv_t *tlv_entry, sec_prot_keys_t *sec
257265

258266
// PTK set
259267
if (*tlv++ == PAE_NVM_FIELD_SET) {
260-
sec_prot_keys_ptk_write(sec_keys, tlv);
268+
uint32_t lifetime = common_read_32_bit(tlv);
269+
tlv += 4;
270+
sec_prot_keys_ptk_write(sec_keys, tlv, lifetime);
271+
} else {
272+
tlv += 4;
261273
}
262274

263275
tlv += PTK_LEN;

source/6LoWPAN/ws/ws_pae_nvm_data.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
// pan_id (2) + network name (33) + (GTK set (1) + GTK expiry timestamp (8) + status (1) + install order (1) + GTK (16)) * 4
3939
#define PAE_NVM_NW_INFO_LEN 2 + 33 + (1 + 8 + 1 + 1 + GTK_LEN) * GTK_NUM
4040

41-
// PTK EUI-64 set (1) + PTK EUI-64 (8) + PMK set (1) + PMK (32) + PMK replay counter (8) + PTK set (1) + PTK (48)
42-
#define PAE_NVM_KEYS_LEN 1 + 8 + 1 + PMK_LEN + 8 + 1 + PTK_LEN
41+
// PTK EUI-64 set (1) + PTK EUI-64 (8) + PMK set (1) + PMK lifetime (4) + PMK (32) + PMK replay counter (8) + PTK set (1) + PTK lifetime (4) + PTK (48)
42+
#define PAE_NVM_KEYS_LEN 1 + 8 + 1 + 4 + PMK_LEN + 8 + 1 + 4 + PTK_LEN
4343

4444
// restart counter + stored time + (frame counter set (1) + GTK (16) + frame counter (4)) * 4
4545
#define PAE_NVM_FRAME_COUNTER_LEN 4 + 8 + (1 + GTK_LEN + 4) * GTK_NUM

source/6LoWPAN/ws/ws_pae_supp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ static kmp_api_t *ws_pae_supp_kmp_incoming_ind(kmp_service_t *service, kmp_type_
11371137
static kmp_api_t *ws_pae_supp_kmp_create_and_start(kmp_service_t *service, kmp_type_e type, pae_supp_t *pae_supp)
11381138
{
11391139
// Create new instance
1140-
kmp_api_t *kmp = kmp_api_create(service, type, pae_supp->sec_prot_cfg);
1140+
kmp_api_t *kmp = kmp_api_create(service, type, pae_supp->sec_prot_cfg, pae_supp->sec_timer_cfg);
11411141
if (!kmp) {
11421142
return NULL;
11431143
}

source/6LoWPAN/ws/ws_pae_timers.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "NWK_INTERFACE/Include/protocol.h"
2727
#include "6LoWPAN/ws/ws_config.h"
2828
#include "6LoWPAN/ws/ws_cfg_settings.h"
29+
#include "Security/protocols/sec_prot_cfg.h"
2930
#include "6LoWPAN/ws/ws_pae_timers.h"
3031

3132
#ifdef HAVE_WS

source/6LoWPAN/ws/ws_pae_timers.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,6 @@
1818
#ifndef WS_PAE_TIMERS_H_
1919
#define WS_PAE_TIMERS_H_
2020

21-
typedef struct sec_timer_cfg_s {
22-
uint32_t gtk_expire_offset; /* GTK lifetime; GTK_EXPIRE_OFFSET (seconds) */
23-
uint32_t pmk_lifetime; /* PMK lifetime (seconds) */
24-
uint32_t ptk_lifetime; /* PTK lifetime (seconds) */
25-
uint16_t gtk_new_act_time; /* GTK_NEW_ACTIVATION_TIME (1/X of expire offset) */
26-
uint16_t revocat_lifetime_reduct; /* REVOCATION_LIFETIME_REDUCTION (reduction of lifetime) */
27-
uint16_t gtk_request_imin; /* GTK_REQUEST_IMIN (seconds) */
28-
uint16_t gtk_request_imax; /* GTK_REQUEST_IMAX (seconds) */
29-
uint16_t gtk_max_mismatch; /* GTK_MAX_MISMATCH (seconds) */
30-
uint8_t gtk_new_install_req; /* GTK_NEW_INSTALL_REQUIRED (percent of GTK lifetime) */
31-
} sec_timer_cfg_t;
32-
3321
/**
3422
* ws_pae_timers_settings_init initializes timer settings structure
3523
*

source/Security/kmp/kmp_api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static void kmp_sec_prot_receive_disable(sec_prot_t *prot);
9999

100100
#define kmp_api_get_from_prot(prot) (kmp_api_t *)(((uint8_t *)prot) - offsetof(kmp_api_t, sec_prot));
101101

102-
kmp_api_t *kmp_api_create(kmp_service_t *service, kmp_type_e type, sec_prot_cfg_t *cfg)
102+
kmp_api_t *kmp_api_create(kmp_service_t *service, kmp_type_e type, sec_prot_cfg_t *prot_cfg, sec_timer_cfg_t *timer_cfg)
103103
{
104104
if (!service) {
105105
return 0;
@@ -151,7 +151,8 @@ kmp_api_t *kmp_api_create(kmp_service_t *service, kmp_type_e type, sec_prot_cfg_
151151
kmp->sec_prot.addr_get = kmp_sec_prot_eui64_addr_get;
152152
kmp->sec_prot.type_get = kmp_sec_prot_by_type_get;
153153
kmp->sec_prot.receive_disable = kmp_sec_prot_receive_disable;
154-
kmp->sec_prot.cfg = cfg;
154+
kmp->sec_prot.prot_cfg = prot_cfg;
155+
kmp->sec_prot.timer_cfg = timer_cfg;
155156

156157
if (sec_prot->init(&kmp->sec_prot) < 0) {
157158
ns_dyn_mem_free(kmp);

source/Security/kmp/kmp_api.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,13 @@ typedef void kmp_api_finished(kmp_api_t *kmp);
125125
*
126126
* \param service KMP service
127127
* \param type KMP type
128-
* \param cfg configuration
128+
* \param prot_cfg protocol configuration
129+
* \param timer_cfg timer configuration
129130
*
130131
* \return KMP instance or NULL
131132
*
132133
*/
133-
kmp_api_t *kmp_api_create(kmp_service_t *service, kmp_type_e type, sec_prot_cfg_t *cfg);
134+
kmp_api_t *kmp_api_create(kmp_service_t *service, kmp_type_e type, sec_prot_cfg_t *prot_cfg, sec_timer_cfg_t *timer_cfg);
134135

135136
/**
136137
* kmp_api_start start KMP api

source/Security/protocols/eap_tls_sec_prot/auth_eap_tls_sec_prot.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static int8_t auth_eap_tls_sec_prot_receive(sec_prot_t *prot, void *pdu, uint16_
189189
// Call state machine
190190
prot->state_machine(prot);
191191
// Resets trickle timer to give time for supplicant to answer
192-
sec_prot_timer_trickle_start(&data->common, &prot->cfg->sec_prot_trickle_params);
192+
sec_prot_timer_trickle_start(&data->common, &prot->prot_cfg->sec_prot_trickle_params);
193193
data->init_key_cnt++;
194194
}
195195
// Filters repeated initial EAPOL-key messages
@@ -297,7 +297,7 @@ static void auth_eap_tls_sec_prot_timer_timeout(sec_prot_t *prot, uint16_t ticks
297297
}
298298

299299
sec_prot_timer_timeout_handle(prot, &data->common,
300-
&prot->cfg->sec_prot_trickle_params, ticks);
300+
&prot->prot_cfg->sec_prot_trickle_params, ticks);
301301
}
302302

303303
static void auth_eap_tls_sec_prot_tls_create_indication(sec_prot_t *tls_prot)
@@ -421,7 +421,7 @@ static void auth_eap_tls_sec_prot_state_machine(sec_prot_t *prot)
421421
auth_eap_tls_sec_prot_message_send(prot, EAP_REQ, EAP_IDENTITY, EAP_TLS_EXCHANGE_NONE);
422422

423423
// Start trickle timer to re-send if no response
424-
sec_prot_timer_trickle_start(&data->common, &prot->cfg->sec_prot_trickle_params);
424+
sec_prot_timer_trickle_start(&data->common, &prot->prot_cfg->sec_prot_trickle_params);
425425

426426
sec_prot_state_set(prot, &data->common, EAP_TLS_STATE_RESPONSE_ID);
427427
break;
@@ -445,7 +445,7 @@ static void auth_eap_tls_sec_prot_state_machine(sec_prot_t *prot)
445445
auth_eap_tls_sec_prot_message_send(prot, EAP_REQ, EAP_TLS, EAP_TLS_EXCHANGE_START);
446446

447447
// Start trickle timer to re-send if no response
448-
sec_prot_timer_trickle_start(&data->common, &prot->cfg->sec_prot_trickle_params);
448+
sec_prot_timer_trickle_start(&data->common, &prot->prot_cfg->sec_prot_trickle_params);
449449

450450
sec_prot_state_set(prot, &data->common, EAP_TLS_STATE_RESPONSE_START);
451451
break;
@@ -527,7 +527,7 @@ static void auth_eap_tls_sec_prot_state_machine(sec_prot_t *prot)
527527
auth_eap_tls_sec_prot_message_send(prot, EAP_REQ, EAP_TLS, EAP_TLS_EXCHANGE_ONGOING);
528528

529529
// Start trickle timer to re-send if no response
530-
sec_prot_timer_trickle_start(&data->common, &prot->cfg->sec_prot_trickle_params);
530+
sec_prot_timer_trickle_start(&data->common, &prot->prot_cfg->sec_prot_trickle_params);
531531
} else {
532532
// TLS done, indicate success to peer
533533
if (data->tls_result == EAP_TLS_RESULT_HANDSHAKE_OVER) {

source/Security/protocols/eap_tls_sec_prot/supp_eap_tls_sec_prot.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ static void supp_eap_tls_sec_prot_state_machine(sec_prot_t *prot)
404404
}
405405

406406
// Set retry timeout based on network size
407-
data->common.ticks = prot->cfg->sec_prot_retry_timeout;
407+
data->common.ticks = prot->prot_cfg->sec_prot_retry_timeout;
408408

409409
// Store sequence ID
410410
supp_eap_tls_sec_prot_seq_id_update(prot);
@@ -449,7 +449,7 @@ static void supp_eap_tls_sec_prot_state_machine(sec_prot_t *prot)
449449
supp_eap_tls_sec_prot_seq_id_update(prot);
450450

451451
sec_prot_state_set(prot, &data->common, EAP_TLS_STATE_REQUEST);
452-
data->common.ticks = prot->cfg->sec_prot_retry_timeout;
452+
data->common.ticks = prot->prot_cfg->sec_prot_retry_timeout;
453453

454454
// Initialize TLS protocol
455455
if (supp_eap_tls_sec_prot_init_tls(prot) < 0) {
@@ -483,7 +483,7 @@ static void supp_eap_tls_sec_prot_state_machine(sec_prot_t *prot)
483483
// Store sequence ID
484484
if (supp_eap_tls_sec_prot_seq_id_update(prot)) {
485485
// When receiving a new sequence number, adds more time for re-send if no response
486-
data->common.ticks = prot->cfg->sec_prot_retry_timeout;
486+
data->common.ticks = prot->prot_cfg->sec_prot_retry_timeout;
487487
}
488488

489489
// All fragments received for a message

source/Security/protocols/fwh_sec_prot/auth_fwh_sec_prot.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ static int8_t auth_fwh_sec_prot_message_send(sec_prot_t *prot, fwh_sec_prot_msg_
313313
static void auth_fwh_sec_prot_timer_timeout(sec_prot_t *prot, uint16_t ticks)
314314
{
315315
fwh_sec_prot_int_t *data = fwh_sec_prot_get(prot);
316-
sec_prot_timer_timeout_handle(prot, &data->common, &prot->cfg->sec_prot_trickle_params, ticks);
316+
sec_prot_timer_timeout_handle(prot, &data->common, &prot->prot_cfg->sec_prot_trickle_params, ticks);
317317
}
318318

319319
static void auth_fwh_sec_prot_state_machine(sec_prot_t *prot)
@@ -350,7 +350,7 @@ static void auth_fwh_sec_prot_state_machine(sec_prot_t *prot)
350350
auth_fwh_sec_prot_message_send(prot, FWH_MESSAGE_1);
351351

352352
// Start trickle timer to re-send if no response
353-
sec_prot_timer_trickle_start(&data->common, &prot->cfg->sec_prot_trickle_params);
353+
sec_prot_timer_trickle_start(&data->common, &prot->prot_cfg->sec_prot_trickle_params);
354354

355355
sec_prot_state_set(prot, &data->common, FWH_STATE_MESSAGE_2);
356356
break;
@@ -378,7 +378,7 @@ static void auth_fwh_sec_prot_state_machine(sec_prot_t *prot)
378378
auth_fwh_sec_prot_message_send(prot, FWH_MESSAGE_3);
379379

380380
// Start trickle timer to re-send if no response
381-
sec_prot_timer_trickle_start(&data->common, &prot->cfg->sec_prot_trickle_params);
381+
sec_prot_timer_trickle_start(&data->common, &prot->prot_cfg->sec_prot_trickle_params);
382382

383383
sec_prot_state_set(prot, &data->common, FWH_STATE_MESSAGE_4);
384384
}
@@ -406,7 +406,7 @@ static void auth_fwh_sec_prot_state_machine(sec_prot_t *prot)
406406
// Reset PTK mismatch
407407
sec_prot_keys_ptk_mismatch_reset(prot->sec_keys);
408408
// Update PTK
409-
sec_prot_keys_ptk_write(prot->sec_keys, data->new_ptk);
409+
sec_prot_keys_ptk_write(prot->sec_keys, data->new_ptk, prot->timer_cfg->ptk_lifetime);
410410
sec_prot_keys_ptk_eui_64_write(prot->sec_keys, data->remote_eui64);
411411
sec_prot_state_set(prot, &data->common, FWH_STATE_FINISH);
412412
}

0 commit comments

Comments
 (0)