From: Jouni Malinen Date: Thu, 30 Nov 2017 20:01:10 +0000 (+0200) Subject: DPP: Extend dpp_test with invalid E-Nonce in Config Req X-Git-Tag: hostap_2_7~749 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0a383a9813f3425a8793185aacd527485ca23c2;p=thirdparty%2Fhostap.git DPP: Extend dpp_test with invalid E-Nonce in Config Req Allow an E-Nonce attribute with invalid length to be sent for protocol testing purposes. Signed-off-by: Jouni Malinen --- diff --git a/src/common/dpp.c b/src/common/dpp.c index d8cb45874..e3c2774f6 100644 --- a/src/common/dpp.c +++ b/src/common/dpp.c @@ -2211,6 +2211,13 @@ struct wpabuf * dpp_build_conf_req(struct dpp_authentication *auth, wpa_printf(MSG_INFO, "DPP: TESTING - no E-nonce"); goto skip_e_nonce; } + if (dpp_test == DPP_TEST_INVALID_E_NONCE_CONF_REQ) { + wpa_printf(MSG_INFO, "DPP: TESTING - invalid E-nonce"); + wpabuf_put_le16(clear, DPP_ATTR_ENROLLEE_NONCE); + wpabuf_put_le16(clear, nonce_len - 1); + wpabuf_put_data(clear, auth->e_nonce, nonce_len - 1); + goto skip_e_nonce; + } if (dpp_test == DPP_TEST_NO_WRAPPED_DATA_CONF_REQ) { wpa_printf(MSG_INFO, "DPP: TESTING - no Wrapped Data"); goto skip_wrapped_data; diff --git a/src/common/dpp.h b/src/common/dpp.h index 6ee3bee47..31176edfa 100644 --- a/src/common/dpp.h +++ b/src/common/dpp.h @@ -324,6 +324,7 @@ enum dpp_test_behavior { 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, + DPP_TEST_INVALID_E_NONCE_CONF_REQ = 83, }; extern enum dpp_test_behavior dpp_test;