From 21345d1652e54640c8a244f7f75717f7078e5a01 Mon Sep 17 00:00:00 2001 From: avatar Date: Sun, 2 Oct 2005 04:29:08 +0000 Subject: Fixing WEP bustage in hostap mode since 5.2-RELEASE. - WEP TX fix: The original code called software crypto, ieee80211_crypto_encap(), which never worked since IEEE80211_KEY_SWCRYPT was never flagged due to ieee80211_crypto_newkey() assumes that wi always supports hardware based crypto regardless of operational mode(by virtue of IEEE80211_C_WEP). This fix works around that issue by adding wi_key_alloc() to force the use of s/w crypto. Also if anyone ever decides to cleanup ioctl handling where key changes wouldn't cause a call to wi_init() every time, we'll need wi_key_alloc() to DTRT. In addition to that, this fix also adds code to wi_write_wep() to force existing keys to be switched between h/w and s/w crypto such that an operation mode change(sta <-> hostap) will flag IEEE80211_KEY_SWCRYPT properly. - WEP RX fix: Clear IEEE80211_F_DROPUNENC even in hostap mode. Quote from Sam: "This is really gross but I don't see an easy way around it. By doing it we lose the ability to independently drop unencode frames (and support mixed wep/!wep use). We should really be setting the EXCLUDE_UNENCRYPTED flag written in wi_write_wep based on IEEE80211_F_DROPUNENC but with our clearing it we can't depend on it being set properly." Reported by: Holm Tiffe Submitted by: sam MFC after: 3 days --- sys/dev/wi/if_wivar.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/dev/wi/if_wivar.h') diff --git a/sys/dev/wi/if_wivar.h b/sys/dev/wi/if_wivar.h index be90399..a00dd33 100644 --- a/sys/dev/wi/if_wivar.h +++ b/sys/dev/wi/if_wivar.h @@ -66,6 +66,9 @@ struct wi_softc { struct ieee80211com sc_ic; int (*sc_newstate)(struct ieee80211com *, enum ieee80211_state, int); + int (*sc_key_alloc)(struct ieee80211com *, + const struct ieee80211_key *, + ieee80211_keyix *, ieee80211_keyix *); device_t sc_dev; #if __FreeBSD_version >= 500000 struct mtx sc_mtx; @@ -121,6 +124,7 @@ struct wi_softc { u_int16_t sc_roaming_mode; u_int16_t sc_microwave_oven; u_int16_t sc_authtype; + u_int16_t sc_encryption; int sc_nodelen; char sc_nodename[IEEE80211_NWID_LEN]; -- cgit v1.1