]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
PASN: Use the assigned status code from IEEE P802.11az/D7.0
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Sun, 4 Dec 2022 12:46:15 +0000 (14:46 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 16 Dec 2022 20:36:10 +0000 (22:36 +0200)
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>
src/common/ieee802_11_defs.h
src/pasn/pasn_responder.c

index be251d0e4d1901519b26b6c7d9833582d05d2bd0..5408ae576a3aa43b2c480941c28d4de533295e9a 100644 (file)
 #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
index ea2737c0f3afe255c163f59eac19a6e6c52c910b..e36aa39b809673a69af252ebce403b49bb091016 100644 (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;
        }