Skip to content

Commit 0880162

Browse files
author
Mika Leppänen
committed
Added target EUI-64 to authentication result callback
1 parent c110c19 commit 0880162

File tree

7 files changed

+18
-10
lines changed

7 files changed

+18
-10
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static void ws_bootstrap_nw_key_clear(protocol_interface_info_entry_t *cur, uint
9292
static void ws_bootstrap_nw_key_index_set(protocol_interface_info_entry_t *cur, uint8_t index);
9393
static void ws_bootstrap_nw_frame_counter_set(protocol_interface_info_entry_t *cur, uint32_t counter);
9494
static void ws_bootstrap_nw_frame_counter_read(protocol_interface_info_entry_t *cur, uint32_t *counter);
95-
static void ws_bootstrap_authentication_completed(protocol_interface_info_entry_t *cur, auth_result_e result);
95+
static void ws_bootstrap_authentication_completed(protocol_interface_info_entry_t *cur, auth_result_e result, uint8_t *target_eui_64);
9696
static void ws_bootstrap_pan_version_increment(protocol_interface_info_entry_t *cur);
9797
static ws_nud_table_entry_t *ws_nud_entry_discover(protocol_interface_info_entry_t *cur, void *neighbor);
9898
static void ws_nud_entry_remove(protocol_interface_info_entry_t *cur, mac_neighbor_table_entry_t *entry_ptr);
@@ -2196,8 +2196,10 @@ static void ws_bootstrap_nw_frame_counter_read(protocol_interface_info_entry_t *
21962196
mac_helper_link_frame_counter_read(cur->id, counter);
21972197
}
21982198

2199-
static void ws_bootstrap_authentication_completed(protocol_interface_info_entry_t *cur, auth_result_e result)
2199+
static void ws_bootstrap_authentication_completed(protocol_interface_info_entry_t *cur, auth_result_e result, uint8_t *target_eui_64)
22002200
{
2201+
(void) target_eui_64;
2202+
22012203
if (result == AUTH_RESULT_OK) {
22022204
tr_debug("authentication success");
22032205
ws_bootstrap_event_configuration_start(cur);

source/6LoWPAN/ws/ws_pae_controller.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@ int8_t ws_pae_controller_authenticate(protocol_interface_info_entry_t *interface
165165
ws_pae_controller_nw_key_check_and_insert(controller->interface_ptr, &controller->gtks);
166166
sec_prot_keys_gtks_updated_reset(&controller->gtks);
167167
}
168-
controller->auth_completed(interface_ptr, true);
168+
controller->auth_completed(interface_ptr, true, NULL);
169169
return 0;
170170
}
171171

172172
if (ws_pae_supp_authenticate(controller->interface_ptr, controller->target_pan_id, controller->target_eui_64) < 0) {
173-
controller->auth_completed(interface_ptr, false);
173+
controller->auth_completed(interface_ptr, false, controller->target_eui_64);
174174
}
175175

176176
#else

source/6LoWPAN/ws/ws_pae_controller.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,9 +493,10 @@ typedef void ws_pae_controller_nw_frame_counter_read(protocol_interface_info_ent
493493
*
494494
* \param interface_ptr interface
495495
* \param result result, either ok or failure reason
496+
* \param target_eui_64 EAPOL target in case of failure or NULL
496497
*
497498
*/
498-
typedef void ws_pae_controller_auth_completed(protocol_interface_info_entry_t *interface_ptr, auth_result_e result);
499+
typedef void ws_pae_controller_auth_completed(protocol_interface_info_entry_t *interface_ptr, auth_result_e result, uint8_t *target_eui_64);
499500

500501
/**
501502
* ws_pae_controller_pan_ver_increment PAN version increment callback

source/6LoWPAN/ws/ws_pae_supp.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ int8_t ws_pae_supp_authenticate(protocol_interface_info_entry_t *interface_ptr,
181181
}
182182

183183
if (ws_pae_supp_nw_keys_valid_check(pae_supp, dest_pan_id) >= 0) {
184-
pae_supp->auth_completed(interface_ptr, true);
184+
pae_supp->auth_completed(interface_ptr, true, NULL);
185185
return 0;
186186
}
187187

@@ -462,7 +462,11 @@ static void ws_pae_supp_authenticate_response(pae_supp_t *pae_supp, auth_result_
462462
pae_supp->auth_trickle_running = false;
463463
if (pae_supp->auth_requested && pae_supp->auth_completed) {
464464
pae_supp->auth_requested = false;
465-
pae_supp->auth_completed(pae_supp->interface_ptr, result);
465+
uint8_t *target_eui_64 = NULL;
466+
if (result != AUTH_RESULT_OK) {
467+
target_eui_64 = pae_supp->target_addr.eui_64;
468+
}
469+
pae_supp->auth_completed(pae_supp->interface_ptr, result, target_eui_64);
466470
}
467471
}
468472

source/6LoWPAN/ws/ws_pae_supp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,10 @@ typedef void ws_pae_supp_nw_key_index_set(protocol_interface_info_entry_t *inter
207207
*
208208
* \param interface_ptr interface
209209
* \param result result, either ok or failure reason
210+
* \param target_eui_64 EAPOL target in case of failure or NULL
210211
*
211212
*/
212-
typedef void ws_pae_supp_auth_completed(protocol_interface_info_entry_t *interface_ptr, auth_result_e result);
213+
typedef void ws_pae_supp_auth_completed(protocol_interface_info_entry_t *interface_ptr, auth_result_e result, uint8_t *target_eui_64);
213214

214215
/**
215216
* ws_pae_supp_nw_key_insert network key insert callback

source/Security/kmp/kmp_eapol_pdu_if.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static int8_t kmp_eapol_pdu_if_tx_status(protocol_interface_info_entry_t *interf
177177
}
178178

179179
kmp_tx_status_e kmp_tx_status;
180-
if (tx_status == EAPOL_PDU_TX_OK ) {
180+
if (tx_status == EAPOL_PDU_TX_OK) {
181181
kmp_tx_status = KMP_TX_OK;
182182
} else if (tx_status == EAPOL_PDU_TX_ERR_TX_NO_ACK) {
183183
kmp_tx_status = KMP_TX_ERR_TX_NO_ACK;

source/Security/protocols/key_sec_prot/key_sec_prot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ static int8_t key_sec_prot_tx_status_ind(sec_prot_t *prot, sec_prot_tx_status_e
319319
// Indicates TX failure
320320
if (tx_status == SEC_PROT_TX_ERR_TX_NO_ACK) {
321321
sec_prot_result_set(&data->common, KMP_RESULT_ERR_TX_NO_ACK);
322-
// Indicates other failure
323322
} else if (tx_status != SEC_PROT_TX_OK) {
323+
// Indicates other failure
324324
sec_prot_result_set(&data->common, KMP_RESULT_ERR_UNSPEC);
325325
}
326326
prot->state_machine_call(prot);

0 commit comments

Comments
 (0)