]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Protocol testing capability to send invalid I-Nonce in Auth Req
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 22 Nov 2017 14:23:42 +0000 (16:23 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 22 Nov 2017 14:23:42 +0000 (16:23 +0200)
Extend dpp_test to cover one more invalid behavior.

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

index 51502239d85060334eb94be9b5f76d9b5f734c5a..dc975a5dead78de8afc2dc45e40042a07e6287af 100644 (file)
@@ -1547,6 +1547,16 @@ static struct wpabuf * dpp_auth_build_req(struct dpp_authentication *auth,
                wpa_printf(MSG_INFO, "DPP: TESTING - no I-nonce");
                goto skip_i_nonce;
        }
+       if (dpp_test == DPP_TEST_INVALID_I_NONCE_AUTH_REQ) {
+               wpa_printf(MSG_INFO, "DPP: TESTING - invalid I-nonce");
+               WPA_PUT_LE16(pos, DPP_ATTR_I_NONCE);
+               pos += 2;
+               WPA_PUT_LE16(pos, nonce_len - 1);
+               pos += 2;
+               os_memcpy(pos, auth->i_nonce, nonce_len - 1);
+               pos += nonce_len - 1;
+               goto skip_i_nonce;
+       }
 #endif /* CONFIG_TESTING_OPTIONS */
 
        /* I-nonce */
index ee78f790674e60a54ae5728ff48f634899deef83..235e8ffb441a35aef21af15302758c3ff843d29e 100644 (file)
@@ -310,6 +310,7 @@ enum dpp_test_behavior {
        DPP_TEST_INVALID_STATUS_PEER_DISC_RESP = 78,
        DPP_TEST_INVALID_CONNECTOR_PEER_DISC_RESP = 79,
        DPP_TEST_INVALID_CONNECTOR_PEER_DISC_REQ = 80,
+       DPP_TEST_INVALID_I_NONCE_AUTH_REQ = 81,
 };
 
 extern enum dpp_test_behavior dpp_test;