diff options
author | sam <sam@FreeBSD.org> | 2005-06-06 04:04:38 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-06-06 04:04:38 +0000 |
commit | 5bab97118df0d5f84ea23868b88458025e0ef63d (patch) | |
tree | 28249a3b67979d4d2dd47b1a007558af83869d4d /sys/net80211/ieee80211_crypto_tkip.c | |
parent | 64ebe3db6831d8a3e1384c0e431c98da5509ec22 (diff) | |
download | FreeBSD-src-5bab97118df0d5f84ea23868b88458025e0ef63d.zip FreeBSD-src-5bab97118df0d5f84ea23868b88458025e0ef63d.tar.gz |
add force flag to enmic/demic crypto api for use in xmit fragmentation
and h/w mic verification
Reviewed by: avatar
Diffstat (limited to 'sys/net80211/ieee80211_crypto_tkip.c')
-rw-r--r-- | sys/net80211/ieee80211_crypto_tkip.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/net80211/ieee80211_crypto_tkip.c b/sys/net80211/ieee80211_crypto_tkip.c index 303d88c..ebafda8 100644 --- a/sys/net80211/ieee80211_crypto_tkip.c +++ b/sys/net80211/ieee80211_crypto_tkip.c @@ -59,9 +59,9 @@ static void *tkip_attach(struct ieee80211com *, struct ieee80211_key *); static void tkip_detach(struct ieee80211_key *); static int tkip_setkey(struct ieee80211_key *); static int tkip_encap(struct ieee80211_key *, struct mbuf *m, u_int8_t keyid); -static int tkip_enmic(struct ieee80211_key *, struct mbuf *); +static int tkip_enmic(struct ieee80211_key *, struct mbuf *, int); static int tkip_decap(struct ieee80211_key *, struct mbuf *); -static int tkip_demic(struct ieee80211_key *, struct mbuf *); +static int tkip_demic(struct ieee80211_key *, struct mbuf *, int); static const struct ieee80211_cipher tkip = { .ic_name = "TKIP", @@ -209,11 +209,11 @@ tkip_encap(struct ieee80211_key *k, struct mbuf *m, u_int8_t keyid) * Add MIC to the frame as needed. */ static int -tkip_enmic(struct ieee80211_key *k, struct mbuf *m) +tkip_enmic(struct ieee80211_key *k, struct mbuf *m, int force) { struct tkip_ctx *ctx = k->wk_private; - if (k->wk_flags & IEEE80211_KEY_SWMIC) { + if (force || (k->wk_flags & IEEE80211_KEY_SWMIC)) { struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); struct ieee80211com *ic = ctx->tc_ic; int hdrlen; @@ -321,11 +321,11 @@ tkip_decap(struct ieee80211_key *k, struct mbuf *m) * Verify and strip MIC from the frame. */ static int -tkip_demic(struct ieee80211_key *k, struct mbuf *m) +tkip_demic(struct ieee80211_key *k, struct mbuf *m, int force) { struct tkip_ctx *ctx = k->wk_private; - if (k->wk_flags & IEEE80211_KEY_SWMIC) { + if (force || (k->wk_flags & IEEE80211_KEY_SWMIC)) { struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); int hdrlen = ieee80211_hdrsize(wh); u8 mic[IEEE80211_WEP_MICLEN]; |