From: Jouni Malinen Date: Mon, 7 Mar 2022 21:40:27 +0000 (+0200) Subject: DPP: Missing/invalid Protocol Version in Reconfig Auth Req X-Git-Tag: hostap_2_11~2184 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9551efe055e8dae4102e6fb4e8eee8da6d68205;p=thirdparty%2Fhostap.git DPP: Missing/invalid Protocol Version in Reconfig Auth Req Extend dpp_test testing functionality to allow the Protocol Version attribute to be removed or modified to invalid value in Reconfig Authentication Request. Signed-off-by: Jouni Malinen --- diff --git a/src/common/dpp.h b/src/common/dpp.h index 27377f6cf..7f6513ff3 100644 --- a/src/common/dpp.h +++ b/src/common/dpp.h @@ -515,6 +515,8 @@ enum dpp_test_behavior { DPP_TEST_NO_PROTOCOL_VERSION_PEER_DISC_RESP = 93, DPP_TEST_INVALID_PROTOCOL_VERSION_PEER_DISC_REQ = 94, DPP_TEST_INVALID_PROTOCOL_VERSION_PEER_DISC_RESP = 95, + DPP_TEST_INVALID_PROTOCOL_VERSION_RECONFIG_AUTH_REQ = 96, + DPP_TEST_NO_PROTOCOL_VERSION_RECONFIG_AUTH_REQ = 97, }; extern enum dpp_test_behavior dpp_test; diff --git a/src/common/dpp_reconfig.c b/src/common/dpp_reconfig.c index 7137bc5fd..452c50247 100644 --- a/src/common/dpp_reconfig.c +++ b/src/common/dpp_reconfig.c @@ -131,6 +131,7 @@ static struct wpabuf * dpp_reconfig_build_req(struct dpp_authentication *auth) { struct wpabuf *msg; size_t attr_len; + u8 ver = DPP_VERSION; /* Build DPP Reconfig Authentication Request frame attributes */ attr_len = 4 + 1 + 4 + 1 + 4 + os_strlen(auth->conf->connector) + @@ -144,10 +145,25 @@ static struct wpabuf * dpp_reconfig_build_req(struct dpp_authentication *auth) wpabuf_put_le16(msg, 1); wpabuf_put_u8(msg, auth->transaction_id); +#ifdef CONFIG_TESTING_OPTIONS + if (dpp_test == DPP_TEST_NO_PROTOCOL_VERSION_RECONFIG_AUTH_REQ) { + wpa_printf(MSG_INFO, "DPP: TESTING - no Protocol Version"); + goto skip_proto_ver; + } + if (dpp_test == DPP_TEST_INVALID_PROTOCOL_VERSION_RECONFIG_AUTH_REQ) { + wpa_printf(MSG_INFO, "DPP: TESTING - invalid Protocol Version"); + ver = 1; + } +#endif /* CONFIG_TESTING_OPTIONS */ + /* Protocol Version */ wpabuf_put_le16(msg, DPP_ATTR_PROTOCOL_VERSION); wpabuf_put_le16(msg, 1); - wpabuf_put_u8(msg, DPP_VERSION); + wpabuf_put_u8(msg, ver); + +#ifdef CONFIG_TESTING_OPTIONS +skip_proto_ver: +#endif /* CONFIG_TESTING_OPTIONS */ /* DPP Connector */ wpabuf_put_le16(msg, DPP_ATTR_CONNECTOR);