01 Nov, 2011

1 commit


16 Jul, 2011

1 commit

  • When the driver wants to pre-program the TKIP
    RX phase 1 key, it needs to be able to obtain
    it for the peer's TA. Add API to allow it to
    generate it.

    The generation uses a dummy on-stack context
    since it doesn't know the RX queue.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

08 Jul, 2011

2 commits

  • In order to support pre-populating the P1K cache in
    iwlwifi hardware for WoWLAN, we need to calculate
    the P1K for the current IV32. Allow drivers to get
    the P1K for any given IV32 instead of for a given
    packet, but keep the packet-based version around as
    an inline.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • Our current TKIP code races against itself on TX
    since we can process multiple packets at the same
    time on different ACs, but they all share the TX
    context for TKIP. This can lead to bad IVs etc.

    Also, the crypto offload helper code just obtains
    the P1K/P2K from the cache, and can update it as
    well, but there's no guarantee that packets are
    really processed in order.

    To fix these issues, first introduce a spinlock
    that will protect the IV16/IV32 values in the TX
    context. This first step makes sure that we don't
    assign the same IV multiple times or get confused
    in other ways.

    Secondly, change the way the P1K cache works. I
    add a field "p1k_iv32" that stores the value of
    the IV32 when the P1K was last recomputed, and
    if different from the last time, then a new P1K
    is recomputed. This can cause the P1K computation
    to flip back and forth if packets are processed
    out of order. All this also happens under the new
    spinlock.

    Finally, because there are argument differences,
    split up the ieee80211_get_tkip_key() API into
    ieee80211_get_tkip_p1k() and ieee80211_get_tkip_p2k()
    and give them the correct arguments.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

05 Apr, 2011

1 commit

  • The only thing that using crypto_blkcipher with ecb does over just using
    arc4 directly is wrapping the encrypt/decrypt function into a for loop,
    looping over each individual character.
    To be able to do this, it pulls in around 40 kb worth of unnecessary
    kernel modules (at least on a MIPS embedded device).
    Using arc4 directly not only eliminates those dependencies, it also makes
    the code smaller.

    Signed-off-by: Felix Fietkau
    Signed-off-by: John W. Linville

    Felix Fietkau
     

09 Jul, 2010

1 commit

  • The current mac80211 code assumes that WEP is always available. If WEP
    fails to initialize, ieee80211_register_hw will always fail.

    In some cases (e.g. FIPS certification), the cryptography used by WEP is
    unavailable. However, in such cases there is no good reason why CCMP
    encryption (or even no link level encryption) cannot be used. So, this
    patch removes mac80211's assumption that WEP (and TKIP) will always be
    available for use.

    Signed-off-by: John W. Linville

    John W. Linville
     

23 Jan, 2010

1 commit


20 Jan, 2010

1 commit

  • When mac80211 asks a driver to encrypt a frame, it
    must assign the control.hw_key pointer for it to
    know which key to use etc. Currently, mac80211 does
    this whenever it would software-encrypt a frame.

    Change the logic of this code to assign the hw_key
    pointer when selecting the key, and later check it
    when deciding whether to encrypt the frame or let
    it be encrypted by the hardware. This allows us to
    later simply skip the encryption function since it
    no longer modifies the TX control.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

23 Dec, 2009

1 commit

  • The mac80211 tkip code won't call update_tkip_key, if rx packets
    are received without KEY_FLAG_UPLOADED_TO_HARDWARE. This can happen on
    first packet because the hardware key stuff is called asynchronously with
    todo workqueue.

    This patch workaround that by tracking if we sent the key to the driver.

    Signed-off-by: Gregor Kowski
    Signed-off-by: John W. Linville

    gregor kowski
     

19 Nov, 2009

1 commit

  • The netdev broadcast address cannot change from
    all-ones so there's no need to use it; we can
    instead hard-code it. Since we already have an
    instance in tkip.c, which will be shared if it
    is marked static const, doing this reduces text
    size at no data/bss cost.

    The real motivation for this is, of course, the
    desire to get rid of almost all uses of netdevs
    in mac80211 so that auditing their use becomes
    easier.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

07 May, 2009

1 commit

  • In order to later add tracing or verifications to the driver
    calls mac80211 makes, this patch adds static inline wrappers
    for all operations.

    All calls are now written as

    drv_(local, ...);

    instead of

    local->ops->(&local->hw, ...);

    Where necessary, the wrappers also do existence checking and
    return default values as appropriate.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

28 Oct, 2008

1 commit


16 Sep, 2008

1 commit

  • This patch changes mac80211 to share some more data about
    stations with drivers. Should help iwlwifi and ath9k when
    they get around to updating, and might also help with
    implementing rate control algorithms without internals.

    Signed-off-by: Johannes Berg
    Cc: Sujith Manoharan
    Signed-off-by: John W. Linville

    Johannes Berg
     

27 Jun, 2008

2 commits


15 Jun, 2008

3 commits


22 May, 2008

4 commits


15 May, 2008

1 commit


01 May, 2008

1 commit

  • Looks like 5d2cdcd4e85c5187db30a6b29f79fbbe59f39f78 ("mac80211: get a
    TKIP phase key from skb") got the shifts wrong.

    Noticed by sparse:
    net/mac80211/tkip.c:234:25: warning: right shift by bigger than source value
    net/mac80211/tkip.c:235:25: warning: right shift by bigger than source value
    net/mac80211/tkip.c:236:25: warning: right shift by bigger than source value

    Signed-off-by: Harvey Harrison
    Signed-off-by: John W. Linville

    Harvey Harrison
     

09 Apr, 2008

1 commit


26 Mar, 2008

2 commits

  • This patch makes mac80211 able to send a phase1 key for TKIP
    decryption.
    This is needed for drivers that don't do the rekeying by themselves
    (i.e. iwlwifi). Upon IV16 wrap around, the packet is decrypted in SW,
    if decryption is ok, mac80211 calls to update_tkip_key with a new
    phase 1 RX key.

    Signed-off-by: Emmanuel Grumbach
    Signed-off-by: Tomas Winkler
    Signed-off-by: John W. Linville

    Emmanuel Grumbach
     
  • This patch makes mac80211 able to compute a TKIP key from an skb.
    The requested key can be a phase 1 or a phase 2 key.
    This is useful for drivers who need to provide tkip key to their
    HW to enable HW encryption.

    Signed-off-by: Emmanuel Grumbach
    Signed-off-by: Tomas Winkler
    Signed-off-by: John W. Linville

    Emmanuel Grumbach
     

11 Oct, 2007

3 commits

  • The TKIP IV should be updated only after MMIC verification,
    this patch changes it to be at that spot.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • This is nicer than the MAC_FMT stuff.

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     
  • This patch embeds the struct ieee80211_key_conf into struct ieee80211_key
    and thus avoids allocations and having data present twice.

    This required some more changes:
    1) The removal of the IEEE80211_KEY_DEFAULT_TX_KEY key flag.
    This flag isn't used by drivers nor should it be since
    we have a set_key_idx() callback. Maybe that callback needs
    to be extended to include the key conf, but only a driver that
    requires it will tell.
    2) The removal of the IEEE80211_KEY_DEFAULT_WEP_ONLY key flag.
    This flag is global, so it shouldn't be passed in the key
    conf structure. Pass it to the function instead.

    Also, this patch removes the AID parameter to the set_key() callback
    because it is currently unused and the hardware currently cannot know
    about the AID anyway. I suspect this was used with some hardware that
    actually selected the AID itself, but that functionality was removed.

    Additionally, I've removed the ALG_NULL key algorithm since we have
    ALG_NONE.

    Signed-off-by: Johannes Berg
    Acked-by: Michael Wu
    Signed-off-by: John W. Linville
    Signed-off-by: David S. Miller

    Johannes Berg
     

06 May, 2007

1 commit