[ar71xx] fix dir-825-b1 default network config after r21905
[openwrt.git] / package / madwifi / patches / 123-ccmp_checks.patch
1 --- a/net80211/ieee80211_crypto_ccmp.c
2 +++ b/net80211/ieee80211_crypto_ccmp.c
3 @@ -115,6 +115,7 @@ ccmp_attach(struct ieee80211vap *vap, st
4 /* This function (crypto_alloc_foo might sleep. Therefore:
5 * Context: process
6 */
7 +#ifdef CONFIG_CRYPTO
8 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
9 ctx->cc_tfm = crypto_alloc_tfm("aes", 0);
10 #else
11 @@ -123,7 +124,8 @@ ccmp_attach(struct ieee80211vap *vap, st
12 if (IS_ERR(ctx->cc_tfm))
13 ctx->cc_tfm = NULL;
14 #endif
15 -
16 +#endif
17 +
18 if (ctx->cc_tfm == NULL) {
19 IEEE80211_DPRINTF(vap, IEEE80211_MSG_CRYPTO,
20 "%s: unable to load kernel AES crypto support\n",
21 @@ -138,12 +140,14 @@ ccmp_detach(struct ieee80211_key *k)
22 {
23 struct ccmp_ctx *ctx = k->wk_private;
24
25 +#ifdef CONFIG_CRYPTO
26 if (ctx->cc_tfm != NULL)
27 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
28 crypto_free_tfm(ctx->cc_tfm);
29 #else
30 crypto_free_cipher(ctx->cc_tfm);
31 #endif
32 +#endif
33 FREE(ctx, M_DEVBUF);
34
35 _MOD_DEC_USE(THIS_MODULE);
36 @@ -169,7 +173,9 @@ ccmp_setkey(struct ieee80211_key *k)
37 return 0;
38 }
39
40 +#ifdef CONFIG_CRYPTO
41 crypto_cipher_setkey(ctx->cc_tfm, k->wk_key, k->wk_keylen);
42 +#endif
43 }
44
45 return 1;
46 @@ -324,6 +330,7 @@ xor_block(u8 *b, const u8 *a, size_t len
47 static void
48 rijndael_encrypt(struct crypto_cipher *tfm, const void *src, void *dst)
49 {
50 +#ifdef CONFIG_CRYPTO
51 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
52 crypto_cipher_encrypt_one(tfm, dst, src);
53 #else
54 @@ -339,6 +346,7 @@ rijndael_encrypt(struct crypto_cipher *t
55 sg_dst.length = AES_BLOCK_LEN;
56 crypto_cipher_encrypt(tfm, &sg_dst, &sg_src, AES_BLOCK_LEN);
57 #endif
58 +#endif
59 }
60
61 /*
62 @@ -475,6 +483,9 @@ ccmp_encrypt(struct ieee80211_key *key,
63 uint8_t *mic, *pos;
64 u_int space;
65
66 + if (ctx->cc_tfm == NULL)
67 + return 0;
68 +
69 ctx->cc_vap->iv_stats.is_crypto_ccmp++;
70
71 skb = skb0;
72 @@ -589,6 +600,9 @@ ccmp_decrypt(struct ieee80211_key *key,
73 uint8_t *pos, *mic;
74 u_int space;
75
76 + if (ctx->cc_tfm == NULL)
77 + return 0;
78 +
79 ctx->cc_vap->iv_stats.is_crypto_ccmp++;
80
81 skb = skb0;
82 --- a/Makefile
83 +++ b/Makefile
84 @@ -192,11 +192,4 @@ endif
85 exit 1; \
86 fi
87
88 - @# check crypto support is enabled
89 - @if [ -z "$(CONFIG_CRYPTO)" ]; then \
90 - echo "FAILED"; \
91 - echo "Please enable crypto API."; \
92 - exit 1; \
93 - fi
94 -
95 @echo "ok."
This page took 0.05652 seconds and 5 git commands to generate.