Skip to content

Commit 7d2f967

Browse files
author
Mika Leppänen
committed
Corrected setting of test GTK on supplicant
1 parent 454faf6 commit 7d2f967

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

source/6LoWPAN/ws/ws_pae_controller.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ int8_t ws_pae_controller_authenticate(protocol_interface_info_entry_t *interface
164164
if (sec_prot_keys_gtks_are_updated(&controller->gtks)) {
165165
ws_pae_controller_nw_key_check_and_insert(controller->interface_ptr, &controller->gtks);
166166
sec_prot_keys_gtks_updated_reset(&controller->gtks);
167+
ws_pae_supp_gtks_set(controller->interface_ptr, &controller->gtks);
167168
}
168169
controller->auth_completed(interface_ptr, AUTH_RESULT_OK, NULL);
169170
return 0;
@@ -989,6 +990,7 @@ int8_t ws_pae_controller_gtk_update(int8_t interface_id, uint8_t *gtk[4])
989990
uint32_t lifetime = sec_prot_keys_gtk_install_order_last_lifetime_get(&controller->gtks);
990991
lifetime += controller->timer_settings.gtk_expire_offset;
991992
if (sec_prot_keys_gtk_set(&controller->gtks, i, gtk[i], lifetime) >= 0) {
993+
controller->gtks_set = true;
992994
tr_info("GTK set index: %i, lifetime %"PRIu32", system time: %"PRIu32"", i, lifetime, protocol_core_monotonic_time / 10);
993995
}
994996
}

source/6LoWPAN/ws/ws_pae_supp.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,18 @@ int8_t ws_pae_supp_nw_key_index_update(protocol_interface_info_entry_t *interfac
356356
return 0;
357357
}
358358

359+
int8_t ws_pae_supp_gtks_set(protocol_interface_info_entry_t *interface_ptr, sec_prot_gtk_keys_t *gtks)
360+
{
361+
pae_supp_t *pae_supp = ws_pae_supp_get(interface_ptr);
362+
if (!pae_supp) {
363+
return -1;
364+
}
365+
366+
pae_supp->gtks = *gtks;
367+
368+
return 0;
369+
}
370+
359371
int8_t ws_pae_supp_eapol_target_remove(protocol_interface_info_entry_t *interface_ptr)
360372
{
361373
pae_supp_t *pae_supp = ws_pae_supp_get(interface_ptr);

source/6LoWPAN/ws/ws_pae_supp.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,18 @@ int8_t ws_pae_supp_gtk_hash_update(protocol_interface_info_entry_t *interface_pt
182182
*/
183183
int8_t ws_pae_supp_nw_key_index_update(protocol_interface_info_entry_t *interface_ptr, uint8_t index);
184184

185+
/**
186+
* ws_pae_supp_gtks_set set supplicant GTKs
187+
*
188+
* \param interface_ptr interface
189+
* \param gtks GTKs
190+
*
191+
* \return < 0 failure
192+
* \return >= 0 success
193+
*
194+
*/
195+
int8_t ws_pae_supp_gtks_set(protocol_interface_info_entry_t *interface_ptr, sec_prot_gtk_keys_t *gtks);
196+
185197
/**
186198
* ws_pae_supp_eapol_target_remove remove EAPOL target set using authentication start
187199
*
@@ -250,6 +262,7 @@ void ws_pae_supp_cb_register(protocol_interface_info_entry_t *interface_ptr, ws_
250262
#define ws_pae_supp_border_router_addr_read NULL
251263
#define ws_pae_supp_gtk_hash_update NULL
252264
#define ws_pae_supp_nw_key_index_update NULL
265+
#define ws_pae_supp_gtks_set(interface_ptr, gtks)
253266
#define ws_pae_supp_eapol_target_remove(interface_ptr)
254267

255268
#endif

0 commit comments

Comments
 (0)