crypto/qat: fix cleanup function default behaviour
Checks
Commit Message
Full cookie data should be cleared by default if not algorithm
specified. This is protection in case algorithm specific cleanup
is not implemented.
Fixes: 3b78aa7b2317 ("crypto/qat: refactor asymmetric crypto functions")
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
drivers/crypto/qat/qat_asym.c | 4 ++++
1 file changed, 4 insertions(+)
Comments
> -----Original Message-----
> From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Sent: Wednesday, June 15, 2022 6:58 AM
> To: dev@dpdk.org
> Cc: gakhil@marvell.com; Zhang, Roy Fan <roy.fan.zhang@intel.com>; Kusztal,
> ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Subject: [PATCH] crypto/qat: fix cleanup function default behaviour
>
> Full cookie data should be cleared by default if not algorithm
> specified. This is protection in case algorithm specific cleanup
> is not implemented.
>
> Fixes: 3b78aa7b2317 ("crypto/qat: refactor asymmetric crypto functions")
>
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
> drivers/crypto/qat/qat_asym.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c
> index e4ab4bf33d..6e43a6cac8 100644
> --- a/drivers/crypto/qat/qat_asym.c
> +++ b/drivers/crypto/qat/qat_asym.c
> @@ -144,6 +144,10 @@ cleanup(struct qat_asym_op_cookie *cookie,
> cleanup_arrays(cookie,
> QAT_ASYM_RSA_NUM_IN_PARAMS,
> QAT_ASYM_RSA_NUM_OUT_PARAMS,
> alg_size);
> }
> + } else {
> + cleanup_arrays(cookie, QAT_ASYM_MAX_PARAMS,
> + QAT_ASYM_MAX_PARAMS,
> + QAT_PKE_MAX_LN_SIZE);
> }
> }
>
> --
> 2.13.6
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
> > Full cookie data should be cleared by default if not algorithm
> > specified. This is protection in case algorithm specific cleanup
> > is not implemented.
> >
> > Fixes: 3b78aa7b2317 ("crypto/qat: refactor asymmetric crypto functions")
> >
> > Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> > ---
> Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Applied to dpdk-next-crypto
Thanks.
@@ -144,6 +144,10 @@ cleanup(struct qat_asym_op_cookie *cookie,
cleanup_arrays(cookie, QAT_ASYM_RSA_NUM_IN_PARAMS,
QAT_ASYM_RSA_NUM_OUT_PARAMS, alg_size);
}
+ } else {
+ cleanup_arrays(cookie, QAT_ASYM_MAX_PARAMS,
+ QAT_ASYM_MAX_PARAMS,
+ QAT_PKE_MAX_LN_SIZE);
}
}