[Madwifi-cvs] revision 2147 committed
Status: Beta
Brought to you by:
otaku
From: Pavel R. <svn...@ma...> - 2007-02-23 02:48:10
|
Project : madwifi Revision : 2147 Author : proski (Pavel Roskin) Date : 2007-02-23 03:48:05 +0100 (Fri, 23 Feb 2007) Log Message : Update for Linux 2.6.21 crypto API Affected Files: * branches/madwifi-old-openhal/net80211/ieee80211_crypto_ccmp.c updated Modified: branches/madwifi-old-openhal/net80211/ieee80211_crypto_ccmp.c =================================================================== --- branches/madwifi-old-openhal/net80211/ieee80211_crypto_ccmp.c 2007-02-23 02:30:48 UTC (rev 2146) +++ branches/madwifi-old-openhal/net80211/ieee80211_crypto_ccmp.c 2007-02-23 02:48:05 UTC (rev 2147) @@ -55,13 +55,15 @@ #define AES_BLOCK_LEN 16 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) -#define crypto_cipher_cast(c) (c) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +#define crypto_cipher crypto_tfm +#define crypto_alloc_cipher(name,type,mask) crypto_alloc_tfm(name,type) +#define crypto_free_cipher(cipher) crypto_free_tfm(cipher) #endif struct ccmp_ctx { struct ieee80211com *cc_ic; /* for diagnostics */ - struct crypto_tfm *cc_tfm; + struct crypto_cipher *cc_tfm; }; static void *ccmp_attach(struct ieee80211com *, struct ieee80211_key *); @@ -109,7 +111,7 @@ } ctx->cc_ic = ic; - ctx->cc_tfm = crypto_alloc_tfm("aes", 0); + ctx->cc_tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); if (ctx->cc_tfm == NULL) { FREE(ctx, M_DEVBUF); _MOD_DEC_USE(THIS_MODULE); @@ -124,7 +126,7 @@ struct ccmp_ctx *ctx = k->wk_private; if (ctx->cc_tfm != NULL) - crypto_free_tfm(ctx->cc_tfm); + crypto_free_cipher(ctx->cc_tfm); FREE(ctx, M_DEVBUF); _MOD_DEC_USE(THIS_MODULE); @@ -142,8 +144,7 @@ return 0; } if (k->wk_flags & IEEE80211_KEY_SWCRYPT) - crypto_cipher_setkey(crypto_cipher_cast(ctx->cc_tfm), - k->wk_key, k->wk_keylen); + crypto_cipher_setkey(ctx->cc_tfm, k->wk_key, k->wk_keylen); return 1; } @@ -289,10 +290,10 @@ } static void -rijndael_encrypt(struct crypto_tfm *tfm, const void *src, void *dst) +rijndael_encrypt(struct crypto_cipher *tfm, const void *src, void *dst) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) - crypto_cipher_encrypt_one(crypto_cipher_cast(tfm), dst, src); + crypto_cipher_encrypt_one(tfm, dst, src); #else struct scatterlist sg_src; struct scatterlist sg_dst; @@ -323,7 +324,7 @@ */ static void -ccmp_init_blocks(struct crypto_tfm *tfm, struct ieee80211_frame *wh, +ccmp_init_blocks(struct crypto_cipher *tfm, struct ieee80211_frame *wh, u_int64_t pn, size_t dlen, u8 *b0, u8 *aad, u8 *auth, u8 *s0) { #define IS_4ADDRESS(wh) \ |