Skip to content

Commit 6d68d43

Browse files
author
Radhey Shyam Pandey
committed
Revert "crypto: zynqmp-aes-gcm: Initialise key source before use"
This reverts commit d9fe55e. zynqmp-aes-gcm self-test fails with below kernel warning. So for now revert the key source initialization to fix zynqmp regressions. zynqmp-aes zynqmp-aes.0: ERROR: Wrong KeySrc, enable secure mode alg: aead: zynqmp-aes-gcm encryption failed on test vector 1; expected_error=0, actual_error=-19, cfg="in-place (one sglist)" alg: self-tests for gcm(aes) using zynqmp-aes-gcm failed (rc=-19) ------------[ cut here ]------------ alg: self-tests for gcm(aes) using zynqmp-aes-gcm failed (rc=-19) WARNING: CPU: 2 PID: 80 at crypto/testmgr.c:5943 alg_test+0x43c/0x54c Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> Message-ID: <20241028111311.1238477-1-radhey.shyam.pandey@amd.com>
1 parent d14445f commit 6d68d43

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/crypto/xilinx/zynqmp-aes-gcm.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,12 @@ static int versal_aes_aead_setkey(struct crypto_aead *aead, const u8 *key,
510510
memcpy(tfm_ctx->key, key, keylen);
511511
}
512512
}
513+
514+
if (tfm_ctx->keysrc < VERSAL_AES_EFUSE_USER_KEY_0 ||
515+
tfm_ctx->keysrc > VERSAL_AES_USER_KEY_7 ||
516+
tfm_ctx->keysrc == VERSAL_AES_KUP_KEY) {
517+
tfm_ctx->keysrc = VERSAL_AES_USER_KEY_0;
518+
}
513519
}
514520

515521
tfm_ctx->fbk_cipher->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK;
@@ -576,7 +582,7 @@ static int aes_aead_init(struct crypto_aead *aead)
576582
__func__, drv_ctx->aead.base.base.cra_name);
577583
return PTR_ERR(tfm_ctx->fbk_cipher);
578584
}
579-
tfm_ctx->keysrc = VERSAL_AES_USER_KEY_0;
585+
580586
crypto_aead_set_reqsize(aead,
581587
max(sizeof(struct zynqmp_aead_req_ctx),
582588
sizeof(struct aead_request) +

0 commit comments

Comments
 (0)