]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Extend dpp_test with invalid Transaction ID in Peer Disc Req
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 30 Nov 2017 19:56:19 +0000 (21:56 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 30 Nov 2017 19:56:19 +0000 (21:56 +0200)
Allow a Transaction ID attribute with invalid length to be sent for
protocol testing purposes.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/common/dpp.h
wpa_supplicant/dpp_supplicant.c

index b2b97614bc99a9d50ab515546f6463f34507d39b..6ee3bee4724e8cf4e8d4a20417acba1cf890b1a2 100644 (file)
@@ -323,6 +323,7 @@ enum dpp_test_behavior {
        DPP_TEST_INVALID_CONNECTOR_PEER_DISC_RESP = 79,
        DPP_TEST_INVALID_CONNECTOR_PEER_DISC_REQ = 80,
        DPP_TEST_INVALID_I_NONCE_AUTH_REQ = 81,
+       DPP_TEST_INVALID_TRANSACTION_ID_PEER_DISC_REQ = 82,
 };
 
 extern enum dpp_test_behavior dpp_test;
index a6b1a58d7152ee36204404c806c4bcb11d0f20e4..42c1028646bb1e8b2a5feacebf78195a8ce2ef23 100644 (file)
@@ -2268,6 +2268,12 @@ int wpas_dpp_check_connect(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
                wpa_printf(MSG_INFO, "DPP: TESTING - no Transaction ID");
                goto skip_trans_id;
        }
+       if (dpp_test == DPP_TEST_INVALID_TRANSACTION_ID_PEER_DISC_REQ) {
+               wpa_printf(MSG_INFO, "DPP: TESTING - invalid Transaction ID");
+               wpabuf_put_le16(msg, DPP_ATTR_TRANSACTION_ID);
+               wpabuf_put_le16(msg, 0);
+               goto skip_trans_id;
+       }
 #endif /* CONFIG_TESTING_OPTIONS */
 
        /* Transaction ID */