mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-18 02:44:03 -05:00
DPP: Add the crypto suite field to the frames
This additional field was added to DPP Public Action frames in DPP tech spec v0.2.3 to support cryptographic agility in the future. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
22a0147557
commit
8c19ea3f21
@ -1204,18 +1204,24 @@ hostapd_dpp_rx_pkex_commit_reveal_resp(struct hostapd_data *hapd, const u8 *src,
|
|||||||
void hostapd_dpp_rx_action(struct hostapd_data *hapd, const u8 *src,
|
void hostapd_dpp_rx_action(struct hostapd_data *hapd, const u8 *src,
|
||||||
const u8 *buf, size_t len, unsigned int freq)
|
const u8 *buf, size_t len, unsigned int freq)
|
||||||
{
|
{
|
||||||
|
u8 crypto_suite;
|
||||||
enum dpp_public_action_frame_type type;
|
enum dpp_public_action_frame_type type;
|
||||||
|
|
||||||
if (len < 1)
|
if (len < 2)
|
||||||
return;
|
return;
|
||||||
type = buf[0];
|
crypto_suite = *buf++;
|
||||||
buf++;
|
type = *buf++;
|
||||||
len--;
|
len -= 2;
|
||||||
|
|
||||||
wpa_printf(MSG_DEBUG,
|
wpa_printf(MSG_DEBUG,
|
||||||
"DPP: Received DPP Public Action frame type %d from "
|
"DPP: Received DPP Public Action frame crypto suite %u type %d from "
|
||||||
MACSTR " freq=%u",
|
MACSTR " freq=%u",
|
||||||
type, MAC2STR(src), freq);
|
crypto_suite, type, MAC2STR(src), freq);
|
||||||
|
if (crypto_suite != 1) {
|
||||||
|
wpa_printf(MSG_DEBUG, "DPP: Unsupported crypto suite %u",
|
||||||
|
crypto_suite);
|
||||||
|
return;
|
||||||
|
}
|
||||||
wpa_hexdump(MSG_MSGDUMP, "DPP: Received message attributes", buf, len);
|
wpa_hexdump(MSG_MSGDUMP, "DPP: Received message attributes", buf, len);
|
||||||
if (dpp_check_attrs(buf, len) < 0)
|
if (dpp_check_attrs(buf, len) < 0)
|
||||||
return;
|
return;
|
||||||
|
@ -484,13 +484,14 @@ struct wpabuf * dpp_alloc_msg(enum dpp_public_action_frame_type type,
|
|||||||
{
|
{
|
||||||
struct wpabuf *msg;
|
struct wpabuf *msg;
|
||||||
|
|
||||||
msg = wpabuf_alloc(7 + len);
|
msg = wpabuf_alloc(8 + len);
|
||||||
if (!msg)
|
if (!msg)
|
||||||
return NULL;
|
return NULL;
|
||||||
wpabuf_put_u8(msg, WLAN_ACTION_PUBLIC);
|
wpabuf_put_u8(msg, WLAN_ACTION_PUBLIC);
|
||||||
wpabuf_put_u8(msg, WLAN_PA_VENDOR_SPECIFIC);
|
wpabuf_put_u8(msg, WLAN_PA_VENDOR_SPECIFIC);
|
||||||
wpabuf_put_be24(msg, OUI_WFA);
|
wpabuf_put_be24(msg, OUI_WFA);
|
||||||
wpabuf_put_u8(msg, DPP_OUI_TYPE);
|
wpabuf_put_u8(msg, DPP_OUI_TYPE);
|
||||||
|
wpabuf_put_u8(msg, 1); /* Crypto Suite */
|
||||||
wpabuf_put_u8(msg, type);
|
wpabuf_put_u8(msg, type);
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
@ -1587,18 +1587,24 @@ wpas_dpp_rx_pkex_commit_reveal_resp(struct wpa_supplicant *wpa_s, const u8 *src,
|
|||||||
void wpas_dpp_rx_action(struct wpa_supplicant *wpa_s, const u8 *src,
|
void wpas_dpp_rx_action(struct wpa_supplicant *wpa_s, const u8 *src,
|
||||||
const u8 *buf, size_t len, unsigned int freq)
|
const u8 *buf, size_t len, unsigned int freq)
|
||||||
{
|
{
|
||||||
|
u8 crypto_suite;
|
||||||
enum dpp_public_action_frame_type type;
|
enum dpp_public_action_frame_type type;
|
||||||
|
|
||||||
if (len < 1)
|
if (len < 2)
|
||||||
return;
|
return;
|
||||||
type = buf[0];
|
crypto_suite = *buf++;
|
||||||
buf++;
|
type = *buf++;
|
||||||
len--;
|
len -= 2;
|
||||||
|
|
||||||
wpa_printf(MSG_DEBUG,
|
wpa_printf(MSG_DEBUG,
|
||||||
"DPP: Received DPP Public Action frame type %d from "
|
"DPP: Received DPP Public Action frame crypto suite %u type %d from "
|
||||||
MACSTR " freq=%u",
|
MACSTR " freq=%u",
|
||||||
type, MAC2STR(src), freq);
|
crypto_suite, type, MAC2STR(src), freq);
|
||||||
|
if (crypto_suite != 1) {
|
||||||
|
wpa_printf(MSG_DEBUG, "DPP: Unsupported crypto suite %u",
|
||||||
|
crypto_suite);
|
||||||
|
return;
|
||||||
|
}
|
||||||
wpa_hexdump(MSG_MSGDUMP, "DPP: Received message attributes", buf, len);
|
wpa_hexdump(MSG_MSGDUMP, "DPP: Received message attributes", buf, len);
|
||||||
if (dpp_check_attrs(buf, len) < 0)
|
if (dpp_check_attrs(buf, len) < 0)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user