summaryrefslogtreecommitdiff
path: root/crypto/authenc.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2008-08-31 22:21:09 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2008-12-25 11:01:33 +1100
commita152bf973ef158c79f29388facf16857afd71083 (patch)
treed32aaa4a4c3c46b6963f7454e7485cb1e114a078 /crypto/authenc.c
parentbacd8cf0d688bec61b6ae44c11c4a37a952cae02 (diff)
downloadlinux-crypto-a152bf973ef158c79f29388facf16857afd71083.tar.gz
linux-crypto-a152bf973ef158c79f29388facf16857afd71083.zip
crypto: hash - Export shash through hash
This patch allows shash algorithms to be used through the old hash interface. This is a transitional measure so we can convert the underlying algorithms to shash before converting the users across. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/authenc.c')
-rw-r--r--crypto/authenc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/authenc.c b/crypto/authenc.c
index fd9f06c6..40b6e9ec 100644
--- a/crypto/authenc.c
+++ b/crypto/authenc.c
@@ -11,6 +11,7 @@
*/
#include <crypto/aead.h>
+#include <crypto/internal/hash.h>
#include <crypto/internal/skcipher.h>
#include <crypto/authenc.h>
#include <crypto/scatterwalk.h>
@@ -431,6 +432,8 @@ static struct crypto_instance *crypto_authenc_alloc(struct rtattr **tb)
inst->alg.cra_aead.ivsize = enc->cra_ablkcipher.ivsize;
inst->alg.cra_aead.maxauthsize = auth->cra_type == &crypto_hash_type ?
auth->cra_hash.digestsize :
+ auth->cra_type ?
+ __crypto_shash_alg(auth)->digestsize :
auth->cra_digest.dia_digestsize;
inst->alg.cra_ctxsize = sizeof(struct crypto_authenc_ctx);