Skip to content

Commit 3f68552

Browse files
committed
crypto: tegra - Use HMAC fallback when keyslots are full
jira LE-4159 Rebuild_History Non-Buildable kernel-5.14.0-570.41.1.el9_6 commit-author Akhil R <akhilrajeev@nvidia.com> commit f80a2e2 The intermediate results for HMAC is stored in the allocated keyslot by the hardware. Dynamic allocation of keyslot during an operation is hence not possible. As the number of keyslots are limited in the hardware, fallback to the HMAC software implementation if keyslots are not available Fixes: 0880bb3 ("crypto: tegra - Add Tegra Security Engine driver") Signed-off-by: Akhil R <akhilrajeev@nvidia.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> (cherry picked from commit f80a2e2) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 03b0d53 commit 3f68552

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/crypto/tegra/tegra-se-hash.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,13 +632,18 @@ static int tegra_hmac_setkey(struct crypto_ahash *tfm, const u8 *key,
632632
unsigned int keylen)
633633
{
634634
struct tegra_sha_ctx *ctx = crypto_ahash_ctx(tfm);
635+
int ret;
635636

636637
if (aes_check_keylen(keylen))
637638
return tegra_hmac_fallback_setkey(ctx, key, keylen);
638639

640+
ret = tegra_key_submit(ctx->se, key, keylen, ctx->alg, &ctx->key_id);
641+
if (ret)
642+
return tegra_hmac_fallback_setkey(ctx, key, keylen);
643+
639644
ctx->fallback = false;
640645

641-
return tegra_key_submit(ctx->se, key, keylen, ctx->alg, &ctx->key_id);
646+
return 0;
642647
}
643648

644649
static int tegra_sha_init(struct ahash_request *req)

0 commit comments

Comments
 (0)