diff options
author | sam <sam@FreeBSD.org> | 2005-06-10 16:11:24 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-06-10 16:11:24 +0000 |
commit | 6ee6d8891675b656ba92d6c73aa98b03a975c2fe (patch) | |
tree | 0391865cf0d816fd8505a8fd066ed529a159383e /sys/net80211/ieee80211_crypto.c | |
parent | 53aa8b7547fb9b83ef5c1565f6c2a45b0cf8c9b1 (diff) | |
download | FreeBSD-src-6ee6d8891675b656ba92d6c73aa98b03a975c2fe.zip FreeBSD-src-6ee6d8891675b656ba92d6c73aa98b03a975c2fe.tar.gz |
o fix wpa w/ wme: don't strip the QoS header on recv as tkip requires
it; instead pass the space occupied by the header down into the
crypto modules (except in the demic case which needs it only when
doing int in s/w)
o while here fix defrag to strip the header from 2nd and later frames
o teach decap code how to handle 4-address frames
Diffstat (limited to 'sys/net80211/ieee80211_crypto.c')
-rw-r--r-- | sys/net80211/ieee80211_crypto.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c index d6678c6..d68ca47 100644 --- a/sys/net80211/ieee80211_crypto.c +++ b/sys/net80211/ieee80211_crypto.c @@ -522,7 +522,7 @@ ieee80211_crypto_encap(struct ieee80211com *ic, */ struct ieee80211_key * ieee80211_crypto_decap(struct ieee80211com *ic, - struct ieee80211_node *ni, struct mbuf *m) + struct ieee80211_node *ni, struct mbuf *m, int hdrlen) { #define IEEE80211_WEP_HDRLEN (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN) #define IEEE80211_WEP_MINLEN \ @@ -533,7 +533,6 @@ ieee80211_crypto_decap(struct ieee80211com *ic, const struct ieee80211_cipher *cip; const u_int8_t *ivp; u_int8_t keyid; - int hdrlen; /* NB: this minimum size data frame could be bigger */ if (m->m_pkthdr.len < IEEE80211_WEP_MINLEN) { @@ -551,7 +550,6 @@ ieee80211_crypto_decap(struct ieee80211com *ic, * the key id in the header is meaningless (typically 0). */ wh = mtod(m, struct ieee80211_frame *); - hdrlen = ieee80211_hdrsize(wh); ivp = mtod(m, const u_int8_t *) + hdrlen; /* XXX contig */ keyid = ivp[IEEE80211_WEP_IVLEN]; if (IEEE80211_IS_MULTICAST(wh->i_addr1) || @@ -573,7 +571,7 @@ ieee80211_crypto_decap(struct ieee80211com *ic, return 0; } - return (cip->ic_decap(k, m) ? k : NULL); + return (cip->ic_decap(k, m, hdrlen) ? k : NULL); #undef IEEE80211_WEP_MINLEN #undef IEEE80211_WEP_HDRLEN } |