]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Testing capability for invalid Protocol Version in Network Intro
authorJouni Malinen <quic_jouni@quicinc.com>
Thu, 27 Jan 2022 16:42:54 +0000 (18:42 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 27 Jan 2022 16:44:07 +0000 (18:44 +0200)
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 <quic_jouni@quicinc.com>
src/ap/dpp_hostapd.c
src/common/dpp.h
wpa_supplicant/dpp_supplicant.c

index d956be92809f97d012df61523167cb050f0240d0..6239bebe5800004cbe8d9c4881650499187b30e2 100644 (file)
@@ -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);
index ca33fe35cd36e0b4ff8fe8a0e0a3d5da33d071f4..ca488f391587d52ee7e19981d7fe0fe4b996545f 100644 (file)
@@ -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;
index aab94cbf445ff0c149377ae54a4786e6adcb52bc..b8c7a671206a7483b670484b48af0da87842801b 100644 (file)
@@ -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);