Search Linux Wireless

Re: [PATCH v2 1/2] mac80211: add option to generate CCMP IVs only for mgmt frames

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

 



On Wed, 2014-04-09 at 10:57 +0200, Marek Kwaczynski wrote:
> Some chips can encrypt managment frames in HW, but
> require generated IV in the frame. Add a key flag
> that allows us to achieve this.

> + * @IEEE80211_KEY_FLAG_GENERATE_MGMT_IV_TX: This flag should be set by the
> + *	driver for a CCMP key to indicate that is requires IV generation
> + *	only for managment frames (MFP).

Maybe IEEE80211_KEY_FLAG_GENERATE_IV_MGMT would be better and matching
the IEEE80211_KEY_FLAG_GENERATE_IV better?

>   */
>  enum ieee80211_key_flags {
> -	IEEE80211_KEY_FLAG_GENERATE_IV	= 1<<1,
> +	IEEE80211_KEY_FLAG_GENERATE_IV		= 1<<1,

Since you're touching all these, please convert them all to BIT().

> @@ -625,8 +625,9 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
>  				tx->key = NULL;
>  			else
>  				skip_hw = (tx->key->conf.flags &
> -					   IEEE80211_KEY_FLAG_SW_MGMT_TX) &&
> -					ieee80211_is_mgmt(hdr->frame_control);
> +				   (IEEE80211_KEY_FLAG_SW_MGMT_TX |
> +				    IEEE80211_KEY_FLAG_GENERATE_MGMT_IV_TX)) &&
> +				    ieee80211_is_mgmt(hdr->frame_control);

This seems wrong, you don't want to skip_hw in this case, you just want
to have the IV generated.

> +	/* hwaccel - with software CCMP header or the HW needs
> +	 * generated the IV
> +	 */
> +	if (info->control.hw_key ||
> +	    (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MGMT_IV_TX))
>  		return 0;

This seems equally wrong, and it looks like maybe in this case two
wrongs make a right, but I think you should probably put it in the
place(s) where IEEE80211_KEY_FLAG_GENERATE_IV is checked.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux