]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - wpa_supplicant/wpas_glue.c
Introduce and add key_flag
[thirdparty/hostap.git] / wpa_supplicant / wpas_glue.c
index 240d6109925047beb2c7199907fab24972eb1ba0..9d5d3560798b81aa1aeaf74d50f970343ba63133 100644 (file)
@@ -250,7 +250,9 @@ static int wpa_eapol_set_wep_key(void *ctx, int unicast, int keyidx,
        }
        return wpa_drv_set_key(wpa_s, WPA_ALG_WEP,
                               unicast ? wpa_s->bssid : NULL,
-                              keyidx, unicast, NULL, 0, key, keylen);
+                              keyidx, unicast, NULL, 0, key, keylen,
+                              unicast ? KEY_FLAG_PAIRWISE_RX_TX :
+                              KEY_FLAG_GROUP_RX_TX_DEFAULT);
 }
 
 
@@ -349,7 +351,7 @@ static void wpa_supplicant_eapol_cb(struct eapol_sm *eapol,
                        "handshake", pmk, pmk_len);
 
        if (wpa_drv_set_key(wpa_s, WPA_ALG_PMK, NULL, 0, 0, NULL, 0, pmk,
-                           pmk_len)) {
+                           pmk_len, KEY_FLAG_PMK)) {
                wpa_printf(MSG_DEBUG, "Failed to set PMK to the driver");
        }
 
@@ -500,7 +502,8 @@ static int wpa_supplicant_get_bssid(void *ctx, u8 *bssid)
 static int wpa_supplicant_set_key(void *_wpa_s, 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 wpa_supplicant *wpa_s = _wpa_s;
        if (alg == WPA_ALG_TKIP && key_idx == 0 && key_len == 32) {
@@ -525,7 +528,7 @@ static int wpa_supplicant_set_key(void *_wpa_s, enum wpa_alg alg,
        }
 #endif /* CONFIG_TESTING_OPTIONS */
        return wpa_drv_set_key(wpa_s, alg, addr, key_idx, set_tx, seq, seq_len,
-                              key, key_len);
+                              key, key_len, key_flag);
 }
 
 
@@ -1169,7 +1172,7 @@ static int wpa_supplicant_key_mgmt_set_pmk(void *ctx, const u8 *pmk,
        if (wpa_s->conf->key_mgmt_offload &&
            (wpa_s->drv_flags & WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD))
                return wpa_drv_set_key(wpa_s, WPA_ALG_PMK, NULL, 0, 0,
-                                      NULL, 0, pmk, pmk_len);
+                                      NULL, 0, pmk, pmk_len, KEY_FLAG_PMK);
        else
                return 0;
 }