]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - wpa_supplicant/ibss_rsn.c
Introduce and add key_flag
[thirdparty/hostap.git] / wpa_supplicant / ibss_rsn.c
index f1e3ecdb2394ed41d0db08b7d729dda50526946b..37368c4cb388146802ddd33dc9ddc393d3b2b0ff 100644 (file)
@@ -146,7 +146,7 @@ static void ibss_check_rsn_completed(struct ibss_rsn_peer *peer)
 static int supp_set_key(void *ctx, enum wpa_alg alg,
                        const u8 *addr, int key_idx, int set_tx,
                        const u8 *seq, size_t seq_len,
-                       const u8 *key, size_t key_len)
+                       const u8 *key, size_t key_len, enum key_flag key_flag)
 {
        struct ibss_rsn_peer *peer = ctx;
 
@@ -173,7 +173,7 @@ static int supp_set_key(void *ctx, enum wpa_alg alg,
        if (is_broadcast_ether_addr(addr))
                addr = peer->addr;
        return wpa_drv_set_key(peer->ibss_rsn->wpa_s, alg, addr, key_idx,
-                              set_tx, seq, seq_len, key, key_len);
+                              set_tx, seq, seq_len, key, key_len, key_flag);
 }
 
 
@@ -293,6 +293,10 @@ static int auth_send_eapol(void *ctx, const u8 *addr, const u8 *data,
                   "encrypt=%d)",
                   __func__, MAC2STR(addr), (unsigned long) data_len, encrypt);
 
+       if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_CONTROL_PORT)
+               return wpa_drv_tx_control_port(wpa_s, addr, ETH_P_EAPOL,
+                                              data, data_len, !encrypt);
+
        if (wpa_s->l2)
                return l2_packet_send(wpa_s->l2, addr, ETH_P_EAPOL, data,
                                      data_len);
@@ -302,7 +306,8 @@ static int auth_send_eapol(void *ctx, const u8 *addr, const u8 *data,
 
 
 static int auth_set_key(void *ctx, int vlan_id, enum wpa_alg alg,
-                       const u8 *addr, int idx, u8 *key, size_t key_len)
+                       const u8 *addr, int idx, u8 *key, size_t key_len,
+                       enum key_flag key_flag)
 {
        struct ibss_rsn *ibss_rsn = ctx;
        u8 seq[6];
@@ -341,7 +346,7 @@ static int auth_set_key(void *ctx, int vlan_id, enum wpa_alg alg,
        }
 
        return wpa_drv_set_key(ibss_rsn->wpa_s, alg, addr, idx,
-                              1, seq, 6, key, key_len);
+                              1, seq, 6, key, key_len, key_flag);
 }
 
 
@@ -854,7 +859,7 @@ static void ibss_rsn_handle_auth_1_of_2(struct ibss_rsn *ibss_rsn,
                wpa_printf(MSG_DEBUG, "RSN: Clear pairwise key for peer "
                           MACSTR, MAC2STR(addr));
                wpa_drv_set_key(ibss_rsn->wpa_s, WPA_ALG_NONE, addr, 0, 0,
-                               NULL, 0, NULL, 0);
+                               NULL, 0, NULL, 0, KEY_FLAG_PAIRWISE);
        }
 
        if (peer &&