@@ -108,7 +108,7 @@ typedef struct {
108108 bool gtk_new_act_time_exp : 1 ; /**< GTK new activation time expired */
109109} pae_auth_t ;
110110
111- static int8_t ws_pae_auth_network_keys_from_gtks_set (pae_auth_t * pae_auth );
111+ static int8_t ws_pae_auth_network_keys_from_gtks_set (pae_auth_t * pae_auth , bool force_install );
112112static int8_t ws_pae_auth_active_gtk_set (pae_auth_t * pae_auth , uint8_t index );
113113static int8_t ws_pae_auth_network_key_index_set (pae_auth_t * pae_auth , uint8_t index );
114114static void ws_pae_auth_free (pae_auth_t * pae_auth );
@@ -345,7 +345,7 @@ void ws_pae_auth_start(protocol_interface_info_entry_t *interface_ptr)
345345 pae_auth -> nw_info_updated (pae_auth -> interface_ptr );
346346
347347 // Inserts keys and updates GTK hash on stack
348- ws_pae_auth_network_keys_from_gtks_set (pae_auth );
348+ ws_pae_auth_network_keys_from_gtks_set (pae_auth , false );
349349
350350 // Sets active key index
351351 ws_pae_auth_network_key_index_set (pae_auth , index );
@@ -362,7 +362,7 @@ void ws_pae_auth_gtks_updated(protocol_interface_info_entry_t *interface_ptr)
362362 return ;
363363 }
364364
365- ws_pae_auth_network_keys_from_gtks_set (pae_auth );
365+ ws_pae_auth_network_keys_from_gtks_set (pae_auth , false );
366366}
367367
368368int8_t ws_pae_auth_nw_key_index_update (protocol_interface_info_entry_t * interface_ptr , uint8_t index )
@@ -470,7 +470,7 @@ int8_t ws_pae_auth_node_access_revoke_start(protocol_interface_info_entry_t *int
470470
471471 // Adds new GTK
472472 ws_pae_auth_gtk_key_insert (pae_auth );
473- ws_pae_auth_network_keys_from_gtks_set (pae_auth );
473+ ws_pae_auth_network_keys_from_gtks_set (pae_auth , false );
474474
475475 // Update keys to NVM as needed
476476 pae_auth -> nw_info_updated (pae_auth -> interface_ptr );
@@ -535,8 +535,11 @@ int8_t ws_pae_auth_nw_info_set(protocol_interface_info_entry_t *interface_ptr, u
535535 }
536536 pae_auth -> pan_id = pan_id ;
537537
538+ bool force_install = false;
538539 if (strlen ((char * ) & pae_auth -> network_name ) > 0 && strcmp ((char * ) & pae_auth -> network_name , network_name ) != 0 ) {
539540 update_keys = true;
541+ // Force GTK install to update the new network name to GAK
542+ force_install = true;
540543 }
541544 strcpy ((char * ) & pae_auth -> network_name , network_name );
542545
@@ -548,7 +551,7 @@ int8_t ws_pae_auth_nw_info_set(protocol_interface_info_entry_t *interface_ptr, u
548551 pae_auth -> nw_keys_remove (pae_auth -> interface_ptr );
549552 }
550553
551- ws_pae_auth_network_keys_from_gtks_set (pae_auth );
554+ ws_pae_auth_network_keys_from_gtks_set (pae_auth , force_install );
552555
553556 int8_t index = sec_prot_keys_gtk_status_active_get (pae_auth -> sec_keys_nw_info -> gtks );
554557 if (index >= 0 ) {
@@ -559,7 +562,7 @@ int8_t ws_pae_auth_nw_info_set(protocol_interface_info_entry_t *interface_ptr, u
559562 return 0 ;
560563}
561564
562- static int8_t ws_pae_auth_network_keys_from_gtks_set (pae_auth_t * pae_auth )
565+ static int8_t ws_pae_auth_network_keys_from_gtks_set (pae_auth_t * pae_auth , bool force_install )
563566{
564567 // Authenticator keys are always fresh
565568 sec_prot_keys_gtk_status_all_fresh_set (pae_auth -> sec_keys_nw_info -> gtks );
@@ -571,7 +574,7 @@ static int8_t ws_pae_auth_network_keys_from_gtks_set(pae_auth_t *pae_auth)
571574 }
572575
573576 if (pae_auth -> nw_key_insert ) {
574- pae_auth -> nw_key_insert (pae_auth -> interface_ptr , pae_auth -> sec_keys_nw_info -> gtks );
577+ pae_auth -> nw_key_insert (pae_auth -> interface_ptr , pae_auth -> sec_keys_nw_info -> gtks , force_install );
575578 }
576579
577580 return 0 ;
@@ -716,7 +719,7 @@ void ws_pae_auth_slow_timer(uint16_t seconds)
716719 if (second_index < 0 ) {
717720 tr_info ("GTK new install required active index: %i, time: %" PRIu32 ", system time: %" PRIu32 "" , active_index , timer_seconds , protocol_core_monotonic_time / 10 );
718721 ws_pae_auth_gtk_key_insert (pae_auth );
719- ws_pae_auth_network_keys_from_gtks_set (pae_auth );
722+ ws_pae_auth_network_keys_from_gtks_set (pae_auth , false );
720723 // Update keys to NVM as needed
721724 pae_auth -> nw_info_updated (pae_auth -> interface_ptr );
722725 } else {
@@ -744,7 +747,7 @@ void ws_pae_auth_slow_timer(uint16_t seconds)
744747 if (timer_seconds == 0 ) {
745748 tr_info ("GTK expired index: %i, system time: %" PRIu32 "" , i , protocol_core_monotonic_time / 10 );
746749 ws_pae_auth_gtk_clear (pae_auth , i );
747- ws_pae_auth_network_keys_from_gtks_set (pae_auth );
750+ ws_pae_auth_network_keys_from_gtks_set (pae_auth , false );
748751 // Update keys to NVM as needed
749752 pae_auth -> nw_info_updated (pae_auth -> interface_ptr );
750753 }
0 commit comments