aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2017-11-30 20:01:10 (GMT)
committerJouni Malinen <j@w1.fi>2017-11-30 20:01:10 (GMT)
commitf0a383a9813f3425a8793185aacd527485ca23c2 (patch)
tree5dc4c08ce220b4a12660d6f1903cd064a6748c58
parent087f494140331abdbcedc00fdfda4ee2e27b4790 (diff)
downloadhostap-f0a383a9813f3425a8793185aacd527485ca23c2.zip
hostap-f0a383a9813f3425a8793185aacd527485ca23c2.tar.gz
hostap-f0a383a9813f3425a8793185aacd527485ca23c2.tar.bz2
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 <jouni@qca.qualcomm.com>
-rw-r--r--src/common/dpp.c7
-rw-r--r--src/common/dpp.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/common/dpp.c b/src/common/dpp.c
index d8cb458..e3c2774 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 6ee3bee..31176ed 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;