Skip to content

Commit 7ec9ef1

Browse files
author
Mika Leppänen
committed
Corrected supplicant and controller authentication result causes
1 parent f5a00a0 commit 7ec9ef1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

source/6LoWPAN/ws/ws_pae_controller.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,20 +165,20 @@ 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, NULL);
168+
controller->auth_completed(interface_ptr, AUTH_RESULT_OK, 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, controller->target_eui_64);
173+
controller->auth_completed(interface_ptr, AUTH_RESULT_ERR_UNSPEC, controller->target_eui_64);
174174
}
175175

176176
#else
177177
ws_pae_controller_test_keys_set(&controller->gtks);
178178
ws_pae_controller_nw_key_check_and_insert(interface_ptr, &controller->gtks);
179179
ws_pae_controller_nw_key_index_check_and_set(interface_ptr, 0);
180180

181-
controller->auth_completed(interface_ptr, true);
181+
controller->auth_completed(interface_ptr, AUTH_RESULT_OK);
182182
#endif
183183

184184
return 0;

source/6LoWPAN/ws/ws_pae_supp.c

Lines changed: 6 additions & 6 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, NULL);
184+
pae_supp->auth_completed(interface_ptr, AUTH_RESULT_OK, NULL);
185185
return 0;
186186
}
187187

@@ -792,7 +792,7 @@ void ws_pae_supp_fast_timer(uint16_t ticks)
792792
if (!pae_supp->initial_key_timer && !pae_supp->auth_trickle_running && !running) {
793793
tr_debug("PAE idle");
794794
// If not already completed, restart bootstrap
795-
ws_pae_supp_authenticate_response(pae_supp, false);
795+
ws_pae_supp_authenticate_response(pae_supp, AUTH_RESULT_ERR_UNSPEC);
796796

797797
ws_pae_supp_timer_stop(pae_supp);
798798
}
@@ -812,7 +812,7 @@ void ws_pae_supp_slow_timer(uint16_t seconds)
812812
}
813813
// Maximum number of trickle expires, authentication fails
814814
if (!trickle_running(&pae_supp->auth_trickle_timer, &pae_supp->auth_trickle_params)) {
815-
ws_pae_supp_authenticate_response(pae_supp, false);
815+
ws_pae_supp_authenticate_response(pae_supp, AUTH_RESULT_ERR_UNSPEC);
816816
}
817817
}
818818

@@ -1091,7 +1091,7 @@ static void ws_pae_supp_kmp_api_create_confirm(kmp_api_t *kmp, kmp_result_e resu
10911091

10921092
// KMP-CREATE.request has failed, authentication error
10931093
if (result != KMP_RESULT_OK) {
1094-
ws_pae_supp_authenticate_response(pae_supp, false);
1094+
ws_pae_supp_authenticate_response(pae_supp, AUTH_RESULT_ERR_UNSPEC);
10951095
}
10961096
}
10971097

@@ -1127,14 +1127,14 @@ static void ws_pae_supp_kmp_api_finished_indication(kmp_api_t *kmp, kmp_result_e
11271127
pae_supp->nw_key_insert(pae_supp->interface_ptr, keys->gtks);
11281128
}
11291129

1130-
ws_pae_supp_authenticate_response(pae_supp, result);
1130+
ws_pae_supp_authenticate_response(pae_supp, AUTH_RESULT_OK);
11311131
}
11321132

11331133
/* If initial EAPOL-key message sending fails to tx no acknowledge, indicates failure so
11341134
that bootstrap can decide if EAPOL target should be changed */
11351135
else if (type > IEEE_802_1X_INITIAL_KEY && result == KMP_RESULT_ERR_TX_NO_ACK) {
11361136
tr_info("Initial EAPOL-Key TX failure, target: %s", trace_array(kmp_address_eui_64_get(&pae_supp->entry.addr), 8));
1137-
ws_pae_supp_authenticate_response(pae_supp, result);
1137+
ws_pae_supp_authenticate_response(pae_supp, AUTH_RESULT_ERR_TX_NO_ACK);
11381138
}
11391139

11401140
}

0 commit comments

Comments
 (0)