DPP: Missing/invalid Protocol Version in Reconfig Auth Req

Extend dpp_test testing functionality to allow the Protocol Version
attribute to be removed or modified to invalid value in Reconfig
Authentication Request.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
Jouni Malinen 2022-03-07 23:40:27 +02:00 committed by Jouni Malinen
parent fc78c13550
commit e9551efe05
2 changed files with 19 additions and 1 deletions

View file

@ -515,6 +515,8 @@ enum dpp_test_behavior {
DPP_TEST_NO_PROTOCOL_VERSION_PEER_DISC_RESP = 93, 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_REQ = 94,
DPP_TEST_INVALID_PROTOCOL_VERSION_PEER_DISC_RESP = 95, DPP_TEST_INVALID_PROTOCOL_VERSION_PEER_DISC_RESP = 95,
DPP_TEST_INVALID_PROTOCOL_VERSION_RECONFIG_AUTH_REQ = 96,
DPP_TEST_NO_PROTOCOL_VERSION_RECONFIG_AUTH_REQ = 97,
}; };
extern enum dpp_test_behavior dpp_test; extern enum dpp_test_behavior dpp_test;

View file

@ -131,6 +131,7 @@ static struct wpabuf * dpp_reconfig_build_req(struct dpp_authentication *auth)
{ {
struct wpabuf *msg; struct wpabuf *msg;
size_t attr_len; size_t attr_len;
u8 ver = DPP_VERSION;
/* Build DPP Reconfig Authentication Request frame attributes */ /* Build DPP Reconfig Authentication Request frame attributes */
attr_len = 4 + 1 + 4 + 1 + 4 + os_strlen(auth->conf->connector) + attr_len = 4 + 1 + 4 + 1 + 4 + os_strlen(auth->conf->connector) +
@ -144,10 +145,25 @@ static struct wpabuf * dpp_reconfig_build_req(struct dpp_authentication *auth)
wpabuf_put_le16(msg, 1); wpabuf_put_le16(msg, 1);
wpabuf_put_u8(msg, auth->transaction_id); wpabuf_put_u8(msg, auth->transaction_id);
#ifdef CONFIG_TESTING_OPTIONS
if (dpp_test == DPP_TEST_NO_PROTOCOL_VERSION_RECONFIG_AUTH_REQ) {
wpa_printf(MSG_INFO, "DPP: TESTING - no Protocol Version");
goto skip_proto_ver;
}
if (dpp_test == DPP_TEST_INVALID_PROTOCOL_VERSION_RECONFIG_AUTH_REQ) {
wpa_printf(MSG_INFO, "DPP: TESTING - invalid Protocol Version");
ver = 1;
}
#endif /* CONFIG_TESTING_OPTIONS */
/* Protocol Version */ /* Protocol Version */
wpabuf_put_le16(msg, DPP_ATTR_PROTOCOL_VERSION); wpabuf_put_le16(msg, DPP_ATTR_PROTOCOL_VERSION);
wpabuf_put_le16(msg, 1); wpabuf_put_le16(msg, 1);
wpabuf_put_u8(msg, DPP_VERSION); wpabuf_put_u8(msg, ver);
#ifdef CONFIG_TESTING_OPTIONS
skip_proto_ver:
#endif /* CONFIG_TESTING_OPTIONS */
/* DPP Connector */ /* DPP Connector */
wpabuf_put_le16(msg, DPP_ATTR_CONNECTOR); wpabuf_put_le16(msg, DPP_ATTR_CONNECTOR);