Skip to content

Commit 4f0129d

Browse files
raveenpherbertx
authored andcommitted
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: 9d12ba8 ("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>
1 parent ecd6d5c commit 4f0129d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/crypto/bcm/cipher.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4652,12 +4652,16 @@ static int spu_register_ahash(struct iproc_alg_s *driver_alg)
46524652
hash->halg.statesize = sizeof(struct spu_hash_export_s);
46534653

46544654
if (driver_alg->auth_info.mode != HASH_MODE_HMAC) {
4655-
hash->setkey = ahash_setkey;
46564655
hash->init = ahash_init;
46574656
hash->update = ahash_update;
46584657
hash->final = ahash_final;
46594658
hash->finup = ahash_finup;
46604659
hash->digest = ahash_digest;
4660+
if ((driver_alg->auth_info.alg == HASH_ALG_AES) &&
4661+
((driver_alg->auth_info.mode == HASH_MODE_XCBC) ||
4662+
(driver_alg->auth_info.mode == HASH_MODE_CMAC))) {
4663+
hash->setkey = ahash_setkey;
4664+
}
46614665
} else {
46624666
hash->setkey = ahash_hmac_setkey;
46634667
hash->init = ahash_hmac_init;

0 commit comments

Comments
 (0)