AP: Use valid status code in wpa_ft_send_rrb_auth_resp()

The return value from this function may be used in an outgoing message,
so use a valid status code instead of -1.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
This commit is contained in:
Ilan Peer 2016-10-27 15:18:30 +03:00 committed by Jouni Malinen
parent e4b48b7b0f
commit 0a63635ed0

View file

@ -1145,7 +1145,7 @@ u16 wpa_ft_validate_reassoc(struct wpa_state_machine *sm, const u8 *ies,
ftie->snonce, WPA_NONCE_LEN); ftie->snonce, WPA_NONCE_LEN);
wpa_hexdump(MSG_DEBUG, "FT: Expected SNonce", wpa_hexdump(MSG_DEBUG, "FT: Expected SNonce",
sm->SNonce, WPA_NONCE_LEN); sm->SNonce, WPA_NONCE_LEN);
return -1; return WLAN_STATUS_INVALID_FTIE;
} }
if (os_memcmp(ftie->anonce, sm->ANonce, WPA_NONCE_LEN) != 0) { if (os_memcmp(ftie->anonce, sm->ANonce, WPA_NONCE_LEN) != 0) {
@ -1154,13 +1154,13 @@ u16 wpa_ft_validate_reassoc(struct wpa_state_machine *sm, const u8 *ies,
ftie->anonce, WPA_NONCE_LEN); ftie->anonce, WPA_NONCE_LEN);
wpa_hexdump(MSG_DEBUG, "FT: Expected ANonce", wpa_hexdump(MSG_DEBUG, "FT: Expected ANonce",
sm->ANonce, WPA_NONCE_LEN); sm->ANonce, WPA_NONCE_LEN);
return -1; return WLAN_STATUS_INVALID_FTIE;
} }
if (parse.r0kh_id == NULL) { if (parse.r0kh_id == NULL) {
wpa_printf(MSG_DEBUG, "FT: No R0KH-ID subelem in FTIE"); wpa_printf(MSG_DEBUG, "FT: No R0KH-ID subelem in FTIE");
return -1; return WLAN_STATUS_INVALID_FTIE;
} }
if (parse.r0kh_id_len != sm->r0kh_id_len || if (parse.r0kh_id_len != sm->r0kh_id_len ||
@ -1172,12 +1172,12 @@ u16 wpa_ft_validate_reassoc(struct wpa_state_machine *sm, const u8 *ies,
parse.r0kh_id, parse.r0kh_id_len); parse.r0kh_id, parse.r0kh_id_len);
wpa_hexdump(MSG_DEBUG, "FT: The current R0KH-ID", wpa_hexdump(MSG_DEBUG, "FT: The current R0KH-ID",
sm->r0kh_id, sm->r0kh_id_len); sm->r0kh_id, sm->r0kh_id_len);
return -1; return WLAN_STATUS_INVALID_FTIE;
} }
if (parse.r1kh_id == NULL) { if (parse.r1kh_id == NULL) {
wpa_printf(MSG_DEBUG, "FT: No R1KH-ID subelem in FTIE"); wpa_printf(MSG_DEBUG, "FT: No R1KH-ID subelem in FTIE");
return -1; return WLAN_STATUS_INVALID_FTIE;
} }
if (os_memcmp_const(parse.r1kh_id, sm->wpa_auth->conf.r1_key_holder, if (os_memcmp_const(parse.r1kh_id, sm->wpa_auth->conf.r1_key_holder,
@ -1188,7 +1188,7 @@ u16 wpa_ft_validate_reassoc(struct wpa_state_machine *sm, const u8 *ies,
parse.r1kh_id, FT_R1KH_ID_LEN); parse.r1kh_id, FT_R1KH_ID_LEN);
wpa_hexdump(MSG_DEBUG, "FT: Expected R1KH-ID", wpa_hexdump(MSG_DEBUG, "FT: Expected R1KH-ID",
sm->wpa_auth->conf.r1_key_holder, FT_R1KH_ID_LEN); sm->wpa_auth->conf.r1_key_holder, FT_R1KH_ID_LEN);
return -1; return WLAN_STATUS_INVALID_FTIE;
} }
if (parse.rsn_pmkid == NULL || if (parse.rsn_pmkid == NULL ||
@ -1196,7 +1196,7 @@ u16 wpa_ft_validate_reassoc(struct wpa_state_machine *sm, const u8 *ies,
{ {
wpa_printf(MSG_DEBUG, "FT: No matching PMKR1Name (PMKID) in " wpa_printf(MSG_DEBUG, "FT: No matching PMKR1Name (PMKID) in "
"RSNIE (pmkid=%d)", !!parse.rsn_pmkid); "RSNIE (pmkid=%d)", !!parse.rsn_pmkid);
return -1; return WLAN_STATUS_INVALID_PMKID;
} }
count = 3; count = 3;
@ -1206,7 +1206,7 @@ u16 wpa_ft_validate_reassoc(struct wpa_state_machine *sm, const u8 *ies,
wpa_printf(MSG_DEBUG, "FT: Unexpected IE count in MIC " wpa_printf(MSG_DEBUG, "FT: Unexpected IE count in MIC "
"Control: received %u expected %u", "Control: received %u expected %u",
ftie->mic_control[1], count); ftie->mic_control[1], count);
return -1; return WLAN_STATUS_UNSPECIFIED_FAILURE;
} }
if (wpa_ft_mic(sm->PTK.kck, sm->PTK.kck_len, sm->addr, if (wpa_ft_mic(sm->PTK.kck, sm->PTK.kck_len, sm->addr,