Skip to content

Commit 34c751b

Browse files
author
Mika Leppänen
committed
Corrected triggering of next GTK handshake on authenticator
Authenticator now triggers GTK handshake for all keys in case there are more than two GTKs. Corrected freed memory access that occurred on GTK state machine.
1 parent 4fad826 commit 34c751b

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

source/6LoWPAN/ws/ws_pae_auth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,12 +919,12 @@ static void ws_pae_auth_next_kmp_trigger(pae_auth_t *pae_auth, supp_entry_t *sup
919919

920920
kmp_api_t *api = ws_pae_lib_kmp_list_type_get(&supp_entry->kmp_list, next_type);
921921
if (api != NULL) {
922+
/* For other types than GTK, only one ongoing negotiation at the same time,
923+
for GTK there can be previous terminating and the new one for next key index */
922924
if (next_type != IEEE_802_11_GKH) {
923925
tr_info("KMP already ongoing; ignored, eui-64: %s", trace_array(supp_entry->addr.eui_64, 8));
924926
return;
925927
}
926-
// Delete KMP
927-
ws_pae_lib_kmp_list_delete(&supp_entry->kmp_list, api);
928928
}
929929
}
930930

source/6LoWPAN/ws/ws_pae_lib.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ int8_t ws_pae_lib_kmp_list_delete(kmp_list_t *kmp_list, kmp_api_t *kmp)
7777
kmp_api_t *ws_pae_lib_kmp_list_type_get(kmp_list_t *kmp_list, kmp_type_e type)
7878
{
7979
ns_list_foreach(kmp_entry_t, cur, kmp_list) {
80-
if (kmp_api_type_get(cur->kmp) == type) {
80+
/* If type matches and receiving of messages has not been disabled for the kmp
81+
(kmp is not in terminating phase) */
82+
if (kmp_api_type_get(cur->kmp) == type && !kmp_api_receive_disable(cur->kmp)) {
8183
return cur->kmp;
8284
}
8385
}

source/Security/kmp/kmp_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,11 @@ kmp_type_e kmp_api_type_get(kmp_api_t *kmp)
314314
return kmp->type;
315315
}
316316

317+
bool kmp_api_receive_disable(kmp_api_t *kmp)
318+
{
319+
return kmp->receive_disable;
320+
}
321+
317322
kmp_type_e kmp_api_type_from_id_get(uint8_t kmp_id)
318323
{
319324
switch (kmp_id) {

source/Security/kmp/kmp_api.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,16 @@ void kmp_api_delete(kmp_api_t *kmp);
152152
*/
153153
kmp_type_e kmp_api_type_get(kmp_api_t *kmp);
154154

155+
/**
156+
* kmp_api_type_get get receive disabled status
157+
*
158+
* \param kmp instance
159+
*
160+
* \return true/false true when receiving has been disabled
161+
*
162+
*/
163+
bool kmp_api_receive_disable(kmp_api_t *kmp);
164+
155165
/**
156166
* kmp_api_type_from_id_get get KMP type from KMP id
157167
*

0 commit comments

Comments
 (0)