summaryrefslogtreecommitdiff
path: root/drivers/crypto/bcm
diff options
context:
space:
mode:
authorRaveendra Padasalagi <raveendra.padasalagi@broadcom.com>2018-11-06 13:58:58 +0530
committerHerbert Xu <herbert@gondor.apana.org.au>2018-11-16 14:09:40 +0800
commit4f0129d13e69bad0363fd75553fb22897b32c379 (patch)
tree16a5ab59940ede910d86ba4943d7c16d6821b226 /drivers/crypto/bcm
parentecd6d5c9cba5fc6053ba21e3f8a4c536f65ea27a (diff)
downloadlinux-4f0129d13e69bad0363fd75553fb22897b32c379.tar.gz
crypto: bcm - fix normal/non key hash algorithm failure
Remove setkey() callback handler for normal/non key hash algorithms and keep it for AES-CBC/CMAC which needs key. Fixes: 9d12ba86f818 ("crypto: brcm - Add Broadcom SPU driver") Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/bcm')
-rw-r--r--drivers/crypto/bcm/cipher.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c
index 2d1f1db9f807..4d67e22a4664 100644
--- a/drivers/crypto/bcm/cipher.c
+++ b/drivers/crypto/bcm/cipher.c
@@ -4652,12 +4652,16 @@ static int spu_register_ahash(struct iproc_alg_s *driver_alg)
hash->halg.statesize = sizeof(struct spu_hash_export_s);
if (driver_alg->auth_info.mode != HASH_MODE_HMAC) {
- hash->setkey = ahash_setkey;
hash->init = ahash_init;
hash->update = ahash_update;
hash->final = ahash_final;
hash->finup = ahash_finup;
hash->digest = ahash_digest;
+ if ((driver_alg->auth_info.alg == HASH_ALG_AES) &&
+ ((driver_alg->auth_info.mode == HASH_MODE_XCBC) ||
+ (driver_alg->auth_info.mode == HASH_MODE_CMAC))) {
+ hash->setkey = ahash_setkey;
+ }
} else {
hash->setkey = ahash_hmac_setkey;
hash->init = ahash_hmac_init;