From d02c0502079f863450fb2b2c3713a451e564eafe Mon Sep 17 00:00:00 2001 From: Manish Bhardwaj Date: Mon, 20 Mar 2023 08:59:51 +0000 Subject: [PATCH] crypto: use 4 byte keyhandle for tsec operation TSEC operation is using 4 byte keyhandle only, whereas other operations are using 16 byte keyhandle. Bug 4031715 Bug 4030215 Change-Id: I19e2ca6afaef903824b6a0e99f94e6e68e533af7 Signed-off-by: Manish Bhardwaj Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2873636 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/crypto/tegra-hv-vse-safety.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/tegra-hv-vse-safety.c b/drivers/crypto/tegra-hv-vse-safety.c index ef0fd472..a5d03b32 100644 --- a/drivers/crypto/tegra-hv-vse-safety.c +++ b/drivers/crypto/tegra-hv-vse-safety.c @@ -342,7 +342,7 @@ struct tegra_virtual_tsec_args { /** * Keyslot index for keyslot containing TSEC key */ - uint8_t keyslot[KEYSLOT_SIZE_BYTES]; + uint32_t keyslot; /** * Size of input buffer in bytes. @@ -2150,7 +2150,7 @@ static int tegra_hv_vse_safety_tsec_sv_op(struct ahash_request *req) ivc_tx->tsec.src_addr = src_buf_addr; ivc_tx->tsec.src_buf_size = req->nbytes; - memcpy(ivc_tx->tsec.keyslot, cmac_ctx->aes_keyslot, KEYSLOT_SIZE_BYTES); + ivc_tx->tsec.keyslot = *((uint32_t *)cmac_ctx->aes_keyslot); if (cmac_req_data->request_type == CMAC_SIGN) { ivc_tx->cmd = TEGRA_VIRTUAL_SE_CMD_TSEC_SIGN;