Parcourir la source

WPS NFC: Send M2D with config error 20 on pkhash mismatch

Instead of terminating the WPS protocol immediately, go through an M2D
exchange to notify Enrollee of the public key hash mismatch.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Jouni Malinen il y a 12 ans
Parent
commit
ff40cd6dd1
2 fichiers modifiés avec 7 ajouts et 2 suppressions
  1. 3 1
      src/wps/wps_defs.h
  2. 4 1
      src/wps/wps_registrar.c

+ 3 - 1
src/wps/wps_defs.h

@@ -215,7 +215,9 @@ enum wps_config_error {
 	WPS_CFG_SETUP_LOCKED = 15,
 	WPS_CFG_MSG_TIMEOUT = 16,
 	WPS_CFG_REG_SESS_TIMEOUT = 17,
-	WPS_CFG_DEV_PASSWORD_AUTH_FAILURE = 18
+	WPS_CFG_DEV_PASSWORD_AUTH_FAILURE = 18,
+	WPS_CFG_60G_CHAN_NOT_SUPPORTED = 19,
+	WPS_CFG_PUBLIC_KEY_HASH_MISMATCH = 20
 };
 
 /* Vendor specific Error Indication for WPS event messages */

+ 4 - 1
src/wps/wps_registrar.c

@@ -2558,7 +2558,10 @@ static enum wps_process_res wps_process_m1(struct wps_data *wps,
 				      WPS_OOB_PUBKEY_HASH_LEN) != 0) {
 				wpa_printf(MSG_ERROR, "WPS: Public Key hash "
 					   "mismatch");
-				return WPS_FAILURE;
+				wps->state = SEND_M2D;
+				wps->config_error =
+					WPS_CFG_PUBLIC_KEY_HASH_MISMATCH;
+				return WPS_CONTINUE;
 			}
 		}
 	}