From: Jouni Malinen Date: Thu, 27 Jan 2022 16:42:54 +0000 (+0200) Subject: DPP: Testing capability for invalid Protocol Version in Network Intro X-Git-Tag: hostap_2_11~2276 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1822bd3789c559538e2a97d466488297f56b33e5;p=thirdparty%2Fhostap.git DPP: Testing capability for invalid Protocol Version in Network Intro This extends dpp_test functionality to allow DPP Network Introduction exchanges to use an incorrect value in the Protocol Version attribute. Signed-off-by: Jouni Malinen --- diff --git a/src/ap/dpp_hostapd.c b/src/ap/dpp_hostapd.c index d956be928..6239bebe5 100644 --- a/src/ap/dpp_hostapd.c +++ b/src/ap/dpp_hostapd.c @@ -1833,6 +1833,13 @@ skip_connector: } #endif /* CONFIG_DPP3 */ +#ifdef CONFIG_TESTING_OPTIONS + if (dpp_test == DPP_TEST_INVALID_PROTOCOL_VERSION_PEER_DISC_RESP) { + 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); diff --git a/src/common/dpp.h b/src/common/dpp.h index ca33fe35c..ca488f391 100644 --- a/src/common/dpp.h +++ b/src/common/dpp.h @@ -500,6 +500,8 @@ enum dpp_test_behavior { DPP_TEST_REJECT_CONFIG = 91, DPP_TEST_NO_PROTOCOL_VERSION_PEER_DISC_REQ = 92, 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, }; extern enum dpp_test_behavior dpp_test; diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c index aab94cbf4..b8c7a6712 100644 --- a/wpa_supplicant/dpp_supplicant.c +++ b/wpa_supplicant/dpp_supplicant.c @@ -3369,6 +3369,13 @@ skip_connector: } #endif /* CONFIG_DPP3 */ +#ifdef CONFIG_TESTING_OPTIONS + if (dpp_test == DPP_TEST_INVALID_PROTOCOL_VERSION_PEER_DISC_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);