Search Linux Wireless

Re: [PATCH 1/5] mac80211: allows driver to request a Phase 2 key

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

 



On Wed, 2008-03-12 at 17:05 -0700, Reinette Chatre wrote:
> From: Emmanuel Grumbach <emmanuel.grumbach@xxxxxxxxx>
> 
> This patch makes the mac80211 able to send a ready phase2 key to the low
> level driver for TKIP encryption. Iwlwifi needs to get a phase2 key to
> encrypt TX packets in HW.

> --- a/include/net/mac80211.h
> +++ b/include/net/mac80211.h
> @@ -287,6 +287,7 @@ struct ieee80211_tx_control {
>  	u8 iv_len;		/* length of the IV field in octets */
>  	u8 queue;		/* hardware queue to use for this frame;
>  				 * 0 = highest, hw->queues-1 = lowest */
> +	u8 tkip_key[16];	/* generated phase2/phase1 key for hw TKIP */

I have to admit that I'm rather uncomfortable with adding this code to
the stack. Not only because that is a rather large field that most other
drivers will not use, but also because it doesn't cover the use case the
Broadcom driver needs (only phase 1 key generated). Also, I don't think
we should take the "push" model to the extreme, that will just
complicate things in the future.

As for the transmit path here, we can trivially export
ieee80211_tkip_gen_rc4key() and, because key_conf is embedded in struct
ieee80211_key, give it a key_conf parameter that the driver knows about
from set_key(). That way, the driver can call that function for each
packet instead of having the stack do that, it only has to keep track of
the keys which it will most likely anyway.

Also, looking at what you do here, I found this comment:
        /* FIXME: need to differenciate between static and dynamic key
         * in the level of mac80211 */
        static_key = !iwl4965_is_associated(priv);

I think that is pretty bogus because there isn't really a distinction
between dynamic and static keys, what's the reason for differentiating
in the driver? Also, the driver will do rather odd things when
 * associate
 * set a key
 * disassociate
 * delete the key

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


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