summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFiona Trahe <fiona.trahe@intel.com>2018-08-22 18:07:40 -0700
committerYongseok Koh <yskoh@mellanox.com>2018-08-22 18:07:40 -0700
commitcb29c15e9f1053ddc1879ce324f280e4aa07dbfc (patch)
tree3234a03115c50c70f7e6a36c97f0a7138beda2c9
parent4706df6afb912cbf306d0c0be41be2d6a6273ab2 (diff)
downloaddpdk-stable-cb29c15e9f1053ddc1879ce324f280e4aa07dbfc.zip
dpdk-stable-cb29c15e9f1053ddc1879ce324f280e4aa07dbfc.tar.gz
dpdk-stable-cb29c15e9f1053ddc1879ce324f280e4aa07dbfc.tar.xz
crypto/qat: fix checks for 3GPP algo bit params
[ backported from upstream commit 64cb90f882704df2cc18e49437ddfdba088dd898 ] QAT driver checks byte alignment for KASUMI/SNOW 3G/ZUC algorithms using cipher/auth_param, which are not initialized at this moment yet. Use operation params instead. Fixes: a59ffe7eb952 ("cryptodev: add bit-wise handling for SNOW 3G") Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
-rw-r--r--drivers/crypto/qat/qat_crypto.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c
index acd979d..85a9ba0 100644
--- a/drivers/crypto/qat/qat_crypto.c
+++ b/drivers/crypto/qat/qat_crypto.c
@@ -1292,9 +1292,8 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg,
ICP_QAT_HW_CIPHER_ALGO_ZUC_3G_128_EEA3) {
if (unlikely(
- (cipher_param->cipher_length % BYTE_LENGTH != 0)
- || (cipher_param->cipher_offset
- % BYTE_LENGTH != 0))) {
+ (op->sym->cipher.data.length % BYTE_LENGTH != 0) ||
+ (op->sym->cipher.data.offset % BYTE_LENGTH != 0))) {
PMD_DRV_LOG(ERR,
"SNOW3G/KASUMI/ZUC in QAT PMD only supports byte aligned values");
op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
@@ -1327,8 +1326,9 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg,
ctx->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_KASUMI_F9 ||
ctx->qat_hash_alg ==
ICP_QAT_HW_AUTH_ALGO_ZUC_3G_128_EIA3) {
- if (unlikely((auth_param->auth_off % BYTE_LENGTH != 0)
- || (auth_param->auth_len % BYTE_LENGTH != 0))) {
+ if (unlikely(
+ (op->sym->auth.data.offset % BYTE_LENGTH != 0) ||
+ (op->sym->auth.data.length % BYTE_LENGTH != 0))) {
PMD_DRV_LOG(ERR,
"For SNOW3G/KASUMI/ZUC, QAT PMD only supports byte aligned values");
op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;