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 <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2020-01-29 00:58:33 +02:00 committed by Jouni Malinen
parent 505797b458
commit 5e98998ec1

View file

@ -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);