Skip to content

Commit

Permalink
Corrected defects
Browse files Browse the repository at this point in the history
  • Loading branch information
Mika Leppänen committed Feb 26, 2019
1 parent ac51ec5 commit 13e68c3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions source/6LoWPAN/ws/ws_pae_controller.c
Expand Up @@ -65,7 +65,7 @@ typedef struct {
uint8_t gtkhash[32]; /**< GTK hashes */
sec_prot_certs_t certs; /**< Certificates */
nw_key_t nw_key[4]; /**< Currently active network keys (on MAC) */
char network_name[33]; /**< Network name for GAK generation */
char *network_name; /**< Network name for GAK generation */
timer_settings_t timer_settings; /**< Timer settings */
protocol_interface_info_entry_t *interface_ptr; /**< List link entry */
ws_pae_controller_auth_completed *auth_completed; /**< Authentication completed callback, continue bootstrap */
Expand Down Expand Up @@ -238,7 +238,7 @@ int8_t ws_pae_controller_nw_info_set(protocol_interface_info_entry_t *interface_
return -1;
}

strncpy(controller->network_name, network_name, 32);
controller->network_name = network_name;

return ws_pae_supp_nw_info_set(interface_ptr, pan_id, network_name);
}
Expand Down Expand Up @@ -451,7 +451,6 @@ int8_t ws_pae_controller_init(protocol_interface_info_entry_t *interface_ptr)
memset(controller->br_eui_64, 0, 8);
memset(controller->gtkhash, 0, 32);
memset(controller->nw_key, 0, sizeof(controller->nw_key));
memset(controller->network_name, 0, sizeof(controller->network_name));
controller->target_pan_id = 0xffff;
controller->interface_ptr = interface_ptr;
controller->auth_completed = NULL;
Expand All @@ -471,6 +470,7 @@ int8_t ws_pae_controller_init(protocol_interface_info_entry_t *interface_ptr)
controller->key_index_set = false;
controller->nw_keys_init_done = false;
controller->gtk_index = -1;
controller->network_name = NULL;
sec_prot_keys_gtks_init(&controller->gtks);
sec_prot_keys_gtks_init(&controller->next_gtks);
sec_prot_certs_init(&controller->certs);
Expand Down Expand Up @@ -831,7 +831,9 @@ int8_t ws_pae_controller_gtk_time_settings_update(int8_t interface_id, uint8_t r

int8_t ws_pae_controller_node_keys_remove(int8_t interface_id, uint8_t *eui_64)
{
#ifndef HAVE_PAE_AUTH
(void) eui_64;
#endif

pae_controller_t *controller = ws_pae_controller_get_or_create(interface_id);
if (!controller) {
Expand Down

0 comments on commit 13e68c3

Please sign in to comment.