From 769139c490754b1963e86e5edf70760cb7350112 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 4 May 2020 13:11:00 +0300 Subject: [PATCH] DPP2: Do not include Protocol Version in Auth Req when testing v1 When DPP v2 implementation is hardcoded to behave as v1 for testing purposes, leave out the Protocol Version attribute form Authentication Request instead of including it there with indication for v1. Signed-off-by: Jouni Malinen --- src/common/dpp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/dpp.c b/src/common/dpp.c index 8a7ed4bcc..0d6dcd1fb 100644 --- a/src/common/dpp.c +++ b/src/common/dpp.c @@ -1853,9 +1853,11 @@ static struct wpabuf * dpp_auth_build_req(struct dpp_authentication *auth, #ifdef CONFIG_DPP2 /* Protocol Version */ - wpabuf_put_le16(msg, DPP_ATTR_PROTOCOL_VERSION); - wpabuf_put_le16(msg, 1); - wpabuf_put_u8(msg, DPP_VERSION); + if (DPP_VERSION > 1) { + wpabuf_put_le16(msg, DPP_ATTR_PROTOCOL_VERSION); + wpabuf_put_le16(msg, 1); + wpabuf_put_u8(msg, DPP_VERSION); + } #endif /* CONFIG_DPP2 */ #ifdef CONFIG_TESTING_OPTIONS