From d954825a242e16aeb8a920e40a06164f5120c5b3 Mon Sep 17 00:00:00 2001 From: Ankur Dwivedi Date: Wed, 6 May 2020 15:07:26 +0530 Subject: [PATCH] test/crypto: set null cipher IV length to zero For null cipher the iv length should be set to zero. Signed-off-by: Ankur Dwivedi Acked-by: Anoob Joseph Acked-by: Fiona Trahe --- app/test/test_cryptodev_blockcipher.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/test/test_cryptodev_blockcipher.c b/app/test/test_cryptodev_blockcipher.c index 473dad9629..909b615e81 100644 --- a/app/test/test_cryptodev_blockcipher.c +++ b/app/test/test_cryptodev_blockcipher.c @@ -379,7 +379,11 @@ iterate: cipher_xform->cipher.key.data = cipher_key; cipher_xform->cipher.key.length = tdata->cipher_key.len; cipher_xform->cipher.iv.offset = IV_OFFSET; - cipher_xform->cipher.iv.length = tdata->iv.len; + + if (tdata->crypto_algo == RTE_CRYPTO_CIPHER_NULL) + cipher_xform->cipher.iv.length = 0; + else + cipher_xform->cipher.iv.length = tdata->iv.len; sym_op->cipher.data.offset = tdata->cipher_offset; sym_op->cipher.data.length = tdata->ciphertext.len - -- 2.20.1