aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/ibss_rsn.c
diff options
context:
space:
mode:
authorMarkus Theil <markus.theil@tu-ilmenau.de>2020-01-03 15:17:42 (GMT)
committerJouni Malinen <j@w1.fi>2020-01-05 18:34:50 (GMT)
commita79ed068719776ff06e4eb271bdeab55fdb14540 (patch)
tree4fbbac878a1ef442f32984eca07cc147dc34bdef /wpa_supplicant/ibss_rsn.c
parent144314eaa7e09374b7f9a3708263a298e05cbfd6 (diff)
downloadhostap-a79ed068719776ff06e4eb271bdeab55fdb14540.zip
hostap-a79ed068719776ff06e4eb271bdeab55fdb14540.tar.gz
hostap-a79ed068719776ff06e4eb271bdeab55fdb14540.tar.bz2
Add no_encrypt flag for control port TX
In order to correctly encrypt rekeying frames, wpa_supplicant now checks if a PTK is currently installed and sets the corresponding encrypt option for tx_control_port(). Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
Diffstat (limited to 'wpa_supplicant/ibss_rsn.c')
-rw-r--r--wpa_supplicant/ibss_rsn.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c
index 0aba8cb..f1e3ecd 100644
--- a/wpa_supplicant/ibss_rsn.c
+++ b/wpa_supplicant/ibss_rsn.c
@@ -64,13 +64,16 @@ static int supp_ether_send(void *ctx, const u8 *dest, u16 proto, const u8 *buf,
{
struct ibss_rsn_peer *peer = ctx;
struct wpa_supplicant *wpa_s = peer->ibss_rsn->wpa_s;
+ int encrypt = peer->authentication_status & IBSS_RSN_REPORTED_PTK;
- wpa_printf(MSG_DEBUG, "SUPP: %s(dest=" MACSTR " proto=0x%04x "
- "len=%lu)",
- __func__, MAC2STR(dest), proto, (unsigned long) len);
+ wpa_printf(MSG_DEBUG, "SUPP: %s(dest=" MACSTR
+ " proto=0x%04x len=%lu no_encrypt=%d)",
+ __func__, MAC2STR(dest), proto, (unsigned long) len,
+ !encrypt);
if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_CONTROL_PORT)
- return wpa_drv_tx_control_port(wpa_s, dest, proto, buf, len);
+ return wpa_drv_tx_control_port(wpa_s, dest, proto, buf, len,
+ !encrypt);
if (wpa_s->l2)
return l2_packet_send(wpa_s->l2, dest, proto, buf, len);