Re: [PATCH v6 06/17] wpa_supplicant: Set the correct key_type for key installs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 15, 2019 at 10:08:26PM +0200, Alexander Wetzel wrote:
> diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
> @@ -200,7 +202,8 @@ int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,
>  	/* TODO: should actually remember the previously used seq#, both for TX
>  	 * and RX from each STA.. */
>  
> -	ret = wpa_drv_set_key(wpa_s, alg, NULL, 0, 1, seq, 6, key, keylen, 0);
> +	ret = wpa_drv_set_key(wpa_s, alg, NULL, 0, 1, seq, 6, key, keylen,
> +			      KEY_TYPE_BROADCAST);

Is this really KEY_TYPE_BROADCAST instead of KEY_TYPE_DEFAULT? As noted
in the beginning of this function, only one key is used for both
receiving and sending unicast and multicast frames.

> diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c
> @@ -341,7 +342,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, 0)) {
> +			    pmk_len, KEY_TYPE_BROADCAST)) {

WPA_ALG_PMK is not for a cipher, it is for offloading 4-way handshake to
the driver. As such, KEY_TYPE_BROADCAST looks strange here. Maybe we
should have KEY_TYPE_OTHER (etc.) for this special case(?)

-- 
Jouni Malinen                                            PGP id EFC895FA

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux