Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F175264867
D57556.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
10 KB
Referenced Files
None
Subscribers
None
D57556.diff
View Options
diff --git a/sys/dev/iwx/if_iwx.c b/sys/dev/iwx/if_iwx.c
--- a/sys/dev/iwx/if_iwx.c
+++ b/sys/dev/iwx/if_iwx.c
@@ -5796,7 +5796,7 @@
} else if (k->wk_cipher->ic_cipher == IEEE80211_CIPHER_AES_CCM) {
k->wk_keytsc++;
} else {
- k->wk_cipher->ic_encap(k, m);
+ k->wk_cipher->ic_encap(k, ni, m);
/* 802.11 headers may have moved */
wh = mtod(m, struct ieee80211_frame *);
diff --git a/sys/dev/usb/wlan/if_rum.c b/sys/dev/usb/wlan/if_rum.c
--- a/sys/dev/usb/wlan/if_rum.c
+++ b/sys/dev/usb/wlan/if_rum.c
@@ -1512,7 +1512,7 @@
return (ENOENT);
if ((k->wk_flags & IEEE80211_KEY_SWCRYPT) &&
- !k->wk_cipher->ic_encap(k, m0))
+ !k->wk_cipher->ic_encap(k, ni, m0))
return (ENOBUFS);
wh = mtod(m0, struct ieee80211_frame *);
@@ -1656,7 +1656,7 @@
return (ENOENT);
}
if ((k->wk_flags & IEEE80211_KEY_SWCRYPT) &&
- !k->wk_cipher->ic_encap(k, m0)) {
+ !k->wk_cipher->ic_encap(k, ni, m0)) {
m_freem(m0);
return (ENOBUFS);
}
diff --git a/sys/net80211/ieee80211_crypto.h b/sys/net80211/ieee80211_crypto.h
--- a/sys/net80211/ieee80211_crypto.h
+++ b/sys/net80211/ieee80211_crypto.h
@@ -225,8 +225,10 @@
void (*ic_detach)(struct ieee80211_key *);
int (*ic_setkey)(struct ieee80211_key *);
void (*ic_setiv)(struct ieee80211_key *, uint8_t *);
- int (*ic_encap)(struct ieee80211_key *, struct mbuf *);
- int (*ic_decap)(struct ieee80211_key *, struct mbuf *, int);
+ int (*ic_encap)(struct ieee80211_key *,
+ const struct ieee80211_node *, struct mbuf *);
+ int (*ic_decap)(struct ieee80211_key *,
+ const struct ieee80211_node *, struct mbuf *, int);
/*
* ic_enmic() and ic_demic() are currently only used by TKIP.
* Please see ieee80211_crypto_enmic() and ieee80211_crypto_demic()
diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c
--- a/sys/net80211/ieee80211_crypto.c
+++ b/sys/net80211/ieee80211_crypto.c
@@ -734,7 +734,7 @@
if ((k = ieee80211_crypto_get_txkey(ni, m)) != NULL) {
cip = k->wk_cipher;
- return (cip->ic_encap(k, m) ? k : NULL);
+ return (cip->ic_encap(k, ni, m) ? k : NULL);
}
return NULL;
@@ -845,7 +845,7 @@
* If we fail then don't return the key - return NULL
* and an error.
*/
- if (cip->ic_decap(k, m, hdrlen)) {
+ if (cip->ic_decap(k, ni, m, hdrlen)) {
/* success */
*key = k;
return (1);
diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c
--- a/sys/net80211/ieee80211_crypto_ccmp.c
+++ b/sys/net80211/ieee80211_crypto_ccmp.c
@@ -67,8 +67,10 @@
static void ccmp_detach(struct ieee80211_key *);
static int ccmp_setkey(struct ieee80211_key *);
static void ccmp_setiv(struct ieee80211_key *, uint8_t *);
-static int ccmp_encap(struct ieee80211_key *, struct mbuf *);
-static int ccmp_decap(struct ieee80211_key *, struct mbuf *, int);
+static int ccmp_encap(struct ieee80211_key *, const struct ieee80211_node *,
+ struct mbuf *);
+static int ccmp_decap(struct ieee80211_key *, const struct ieee80211_node *,
+ struct mbuf *, int);
static int ccmp_enmic(struct ieee80211_key *, struct mbuf *, int);
static int ccmp_demic(struct ieee80211_key *, struct mbuf *, int);
@@ -106,9 +108,11 @@
.ic_demic = ccmp_demic,
};
-static int ccmp_encrypt(struct ieee80211_key *, struct mbuf *, int hdrlen);
-static int ccmp_decrypt(struct ieee80211_key *, u_int64_t pn,
- struct mbuf *, int hdrlen);
+static int ccmp_encrypt(struct ieee80211_key *,
+ const struct ieee80211_node *, struct mbuf *, int hdrlen);
+static int ccmp_decrypt(struct ieee80211_key *,
+ const struct ieee80211_node *, u_int64_t pn, struct mbuf *,
+ int hdrlen);
/* number of references from net80211 layer */
static int nrefs = 0;
@@ -235,7 +239,8 @@
* Add privacy headers appropriate for the specified key.
*/
static int
-ccmp_encap(struct ieee80211_key *k, struct mbuf *m)
+ccmp_encap(struct ieee80211_key *k, const struct ieee80211_node *ni,
+ struct mbuf *m)
{
const struct ieee80211_frame *wh;
struct ccmp_ctx *ctx = k->wk_private;
@@ -275,7 +280,7 @@
* Finally, do software encrypt if needed.
*/
if ((k->wk_flags & IEEE80211_KEY_SWENCRYPT) &&
- !ccmp_encrypt(k, m, hdrlen))
+ !ccmp_encrypt(k, ni, m, hdrlen))
return 0;
return 1;
@@ -305,7 +310,8 @@
* is also verified.
*/
static int
-ccmp_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen)
+ccmp_decap(struct ieee80211_key *k, const struct ieee80211_node *ni,
+ struct mbuf *m, int hdrlen)
{
const struct ieee80211_rx_stats *rxs;
struct ccmp_ctx *ctx = k->wk_private;
@@ -357,7 +363,7 @@
* decryption work.
*/
if ((k->wk_flags & IEEE80211_KEY_SWDECRYPT) &&
- !ccmp_decrypt(k, pn, m, hdrlen))
+ !ccmp_decrypt(k, ni, pn, m, hdrlen))
return 0;
finish:
@@ -553,7 +559,8 @@
} while (0)
static int
-ccmp_encrypt(struct ieee80211_key *key, struct mbuf *m0, int hdrlen)
+ccmp_encrypt(struct ieee80211_key *key, const struct ieee80211_node *ni,
+ struct mbuf *m0, int hdrlen)
{
struct ccmp_ctx *ctx = key->wk_private;
struct ieee80211_frame *wh;
@@ -699,7 +706,8 @@
} while (0)
static int
-ccmp_decrypt(struct ieee80211_key *key, u_int64_t pn, struct mbuf *m, int hdrlen)
+ccmp_decrypt(struct ieee80211_key *key, const struct ieee80211_node *ni,
+ u_int64_t pn, struct mbuf *m, int hdrlen)
{
const struct ieee80211_rx_stats *rxs;
struct ccmp_ctx *ctx = key->wk_private;
diff --git a/sys/net80211/ieee80211_crypto_gcmp.c b/sys/net80211/ieee80211_crypto_gcmp.c
--- a/sys/net80211/ieee80211_crypto_gcmp.c
+++ b/sys/net80211/ieee80211_crypto_gcmp.c
@@ -74,8 +74,10 @@
static void gcmp_detach(struct ieee80211_key *);
static int gcmp_setkey(struct ieee80211_key *);
static void gcmp_setiv(struct ieee80211_key *, uint8_t *);
-static int gcmp_encap(struct ieee80211_key *, struct mbuf *);
-static int gcmp_decap(struct ieee80211_key *, struct mbuf *, int);
+static int gcmp_encap(struct ieee80211_key *, const struct ieee80211_node *,
+ struct mbuf *);
+static int gcmp_decap(struct ieee80211_key *, const struct ieee80211_node *,
+ struct mbuf *, int);
static int gcmp_enmic(struct ieee80211_key *, struct mbuf *, int);
static int gcmp_demic(struct ieee80211_key *, struct mbuf *, int);
@@ -216,7 +218,8 @@
* Add privacy headers appropriate for the specified key.
*/
static int
-gcmp_encap(struct ieee80211_key *k, struct mbuf *m)
+gcmp_encap(struct ieee80211_key *k, const struct ieee80211_node *ni,
+ struct mbuf *m)
{
const struct ieee80211_frame *wh;
struct gcmp_ctx *ctx = k->wk_private;
@@ -285,7 +288,8 @@
* is also verified.
*/
static int
-gcmp_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen)
+gcmp_decap(struct ieee80211_key *k, const struct ieee80211_node *ni,
+ struct mbuf *m, int hdrlen)
{
const struct ieee80211_rx_stats *rxs;
struct gcmp_ctx *ctx = k->wk_private;
diff --git a/sys/net80211/ieee80211_crypto_none.c b/sys/net80211/ieee80211_crypto_none.c
--- a/sys/net80211/ieee80211_crypto_none.c
+++ b/sys/net80211/ieee80211_crypto_none.c
@@ -50,8 +50,10 @@
static void none_detach(struct ieee80211_key *);
static int none_setkey(struct ieee80211_key *);
static void none_setiv(struct ieee80211_key *, uint8_t *);
-static int none_encap(struct ieee80211_key *, struct mbuf *);
-static int none_decap(struct ieee80211_key *, struct mbuf *, int);
+static int none_encap(struct ieee80211_key *,
+ const struct ieee80211_node *, struct mbuf *);
+static int none_decap(struct ieee80211_key *,
+ const struct ieee80211_node *, struct mbuf *, int);
static int none_enmic(struct ieee80211_key *, struct mbuf *, int);
static int none_demic(struct ieee80211_key *, struct mbuf *, int);
@@ -96,7 +98,8 @@
}
static int
-none_encap(struct ieee80211_key *k, struct mbuf *m)
+none_encap(struct ieee80211_key *k, const struct ieee80211_node *ni,
+ struct mbuf *m)
{
struct ieee80211vap *vap = k->wk_private;
#ifdef IEEE80211_DEBUG
@@ -117,7 +120,8 @@
}
static int
-none_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen)
+none_decap(struct ieee80211_key *k, const struct ieee80211_node *ni,
+ struct mbuf *m, int hdrlen)
{
struct ieee80211vap *vap = k->wk_private;
#ifdef IEEE80211_DEBUG
diff --git a/sys/net80211/ieee80211_crypto_tkip.c b/sys/net80211/ieee80211_crypto_tkip.c
--- a/sys/net80211/ieee80211_crypto_tkip.c
+++ b/sys/net80211/ieee80211_crypto_tkip.c
@@ -55,9 +55,11 @@
static void tkip_detach(struct ieee80211_key *);
static int tkip_setkey(struct ieee80211_key *);
static void tkip_setiv(struct ieee80211_key *, uint8_t *);
-static int tkip_encap(struct ieee80211_key *, struct mbuf *);
+static int tkip_encap(struct ieee80211_key *, const struct ieee80211_node *,
+ struct mbuf *);
static int tkip_enmic(struct ieee80211_key *, struct mbuf *, int);
-static int tkip_decap(struct ieee80211_key *, struct mbuf *, int);
+static int tkip_decap(struct ieee80211_key *, const struct ieee80211_node *,
+ struct mbuf *, int);
static int tkip_demic(struct ieee80211_key *, struct mbuf *, int);
static const struct ieee80211_cipher tkip = {
@@ -172,7 +174,8 @@
* Add privacy headers and do any s/w encryption required.
*/
static int
-tkip_encap(struct ieee80211_key *k, struct mbuf *m)
+tkip_encap(struct ieee80211_key *k, const struct ieee80211_node *ni,
+ struct mbuf *m)
{
struct tkip_ctx *ctx = k->wk_private;
struct ieee80211vap *vap = ctx->tc_vap;
@@ -284,7 +287,8 @@
* the specified key.
*/
static int
-tkip_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen)
+tkip_decap(struct ieee80211_key *k, const struct ieee80211_node *ni,
+ struct mbuf *m, int hdrlen)
{
const struct ieee80211_rx_stats *rxs;
struct tkip_ctx *ctx = k->wk_private;
diff --git a/sys/net80211/ieee80211_crypto_wep.c b/sys/net80211/ieee80211_crypto_wep.c
--- a/sys/net80211/ieee80211_crypto_wep.c
+++ b/sys/net80211/ieee80211_crypto_wep.c
@@ -51,8 +51,10 @@
static void wep_detach(struct ieee80211_key *);
static int wep_setkey(struct ieee80211_key *);
static void wep_setiv(struct ieee80211_key *, uint8_t *);
-static int wep_encap(struct ieee80211_key *, struct mbuf *);
-static int wep_decap(struct ieee80211_key *, struct mbuf *, int);
+static int wep_encap(struct ieee80211_key *, const struct ieee80211_node *,
+ struct mbuf *);
+static int wep_decap(struct ieee80211_key *, const struct ieee80211_node *,
+ struct mbuf *, int);
static int wep_enmic(struct ieee80211_key *, struct mbuf *, int);
static int wep_demic(struct ieee80211_key *, struct mbuf *, int);
@@ -176,7 +178,8 @@
* Add privacy headers appropriate for the specified key.
*/
static int
-wep_encap(struct ieee80211_key *k, struct mbuf *m)
+wep_encap(struct ieee80211_key *k, const struct ieee80211_node *ni,
+ struct mbuf *m)
{
struct wep_ctx *ctx = k->wk_private;
struct ieee80211com *ic = ctx->wc_ic;
@@ -235,7 +238,8 @@
* the specified key.
*/
static int
-wep_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen)
+wep_decap(struct ieee80211_key *k, const struct ieee80211_node *ni,
+ struct mbuf *m, int hdrlen)
{
struct wep_ctx *ctx = k->wk_private;
struct ieee80211vap *vap = ctx->wc_vap;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 10, 1:51 PM (18 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40546506
Default Alt Text
D57556.diff (10 KB)
Attached To
Mode
D57556: net80211: add node to the crypto encap/decap functions
Attached
Detach File
Event Timeline
Log In to Comment