From: Jouni Malinen Date: Tue, 28 Jan 2020 22:58:33 +0000 (+0200) Subject: DPP2: Add Protocol Version attr to Auth Resp only if peer is R2 or newer X-Git-Tag: hostap_2_10~1904 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e98998ec11f09918621018ad47a3ca2af6987b1;p=thirdparty%2Fhostap.git DPP2: Add Protocol Version attr to Auth Resp only if peer is R2 or newer There is no need for the Protocol Version attribute in Authentication Response if the peer is a DPP R1 device since such device would not know how to use this attribute. To reduce risk for interoperability issues, add this new attribute only if the peer included it in Authentication Request. Signed-off-by: Jouni Malinen --- diff --git a/src/common/dpp.c b/src/common/dpp.c index 80b6e1767..ab1111c5a 100644 --- a/src/common/dpp.c +++ b/src/common/dpp.c @@ -1920,9 +1920,11 @@ static struct wpabuf * dpp_auth_build_resp(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, 2); + if (auth->peer_version >= 2) { + wpabuf_put_le16(msg, DPP_ATTR_PROTOCOL_VERSION); + wpabuf_put_le16(msg, 1); + wpabuf_put_u8(msg, 2); + } #endif /* CONFIG_DPP2 */ attr_end = wpabuf_put(msg, 0);