2007-12-17 10:31:23

by Herbert Xu

[permalink] [raw]
Subject: [PATCH 5/8] [CRYPTO] aead: Fix crypto_aead_setkey on geniv algorithms

[CRYPTO] aead: Fix crypto_aead_setkey on geniv algorithms

We need to call the setkey function with the base pointer.

Signed-off-by: Herbert Xu <[email protected]>
---

include/linux/crypto.h | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 4219b48..0aba104 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -778,7 +778,9 @@ static inline void crypto_aead_clear_flags(struct crypto_aead *tfm, u32 flags)
static inline int crypto_aead_setkey(struct crypto_aead *tfm, const u8 *key,
unsigned int keylen)
{
- return crypto_aead_crt(tfm)->setkey(tfm, key, keylen);
+ struct aead_tfm *crt = crypto_aead_crt(tfm);
+
+ return crt->setkey(crt->base, key, keylen);
}

int crypto_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize);