PASN: Use the assigned status code from IEEE P802.11az/D7.0

Use more specific status code values to report error cases.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
This commit is contained in:
Andrei Otcheretianski 2022-12-04 14:46:15 +02:00 committed by Jouni Malinen
parent 3d798ff2a4
commit af0ab435af
2 changed files with 7 additions and 4 deletions

View file

@ -209,6 +209,9 @@
#define WLAN_STATUS_DENIED_HE_NOT_SUPPORTED 124
#define WLAN_STATUS_SAE_HASH_TO_ELEMENT 126
#define WLAN_STATUS_SAE_PK 127
#define WLAN_STATUS_INVALID_PUBLIC_KEY 136
#define WLAN_STATUS_PASN_BASE_AKMP_FAILED 137
#define WLAN_STATUS_OCI_MISMATCH 138
/* Reason codes (IEEE Std 802.11-2016, 9.4.1.7, Table 9-45) */
#define WLAN_REASON_UNSPECIFIED 1

View file

@ -687,7 +687,7 @@ int handle_auth_pasn_1(struct pasn_data *pasn,
if (!pasn_params.pubkey || !pasn_params.pubkey_len) {
wpa_printf(MSG_DEBUG, "PASN: Invalid public key");
status = WLAN_STATUS_UNSPECIFIED_FAILURE;
status = WLAN_STATUS_INVALID_PARAMETERS;
goto send_resp;
}
@ -702,7 +702,7 @@ int handle_auth_pasn_1(struct pasn_data *pasn,
if (ret) {
wpa_printf(MSG_DEBUG, "PASN: Invalid comeback token");
status = WLAN_STATUS_UNSPECIFIED_FAILURE;
status = WLAN_STATUS_INVALID_PARAMETERS;
goto send_resp;
}
} else if (pasn->use_anti_clogging) {
@ -730,7 +730,7 @@ int handle_auth_pasn_1(struct pasn_data *pasn,
wpa_printf(MSG_DEBUG,
"PASN: Invalid first octet in pubkey=0x%x",
pasn_params.pubkey[0]);
status = WLAN_STATUS_UNSPECIFIED_FAILURE;
status = WLAN_STATUS_INVALID_PUBLIC_KEY;
goto send_resp;
}
@ -863,7 +863,7 @@ int handle_auth_pasn_1(struct pasn_data *pasn,
&pasn_params, wrapped_data, secret);
if (ret) {
wpa_printf(MSG_DEBUG, "PASN: Failed to derive keys");
status = WLAN_STATUS_UNSPECIFIED_FAILURE;
status = WLAN_STATUS_PASN_BASE_AKMP_FAILED;
goto send_resp;
}