DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anoob Joseph <anoob.joseph@caviumnetworks.com>
To: Akhil Goyal <akhil.goyal@nxp.com>,
	Declan Doherty <declan.doherty@intel.com>,
	Pablo de Lara <pablo.de.lara.guarch@intel.com>
Cc: Anoob Joseph <anoob.joseph@caviumnetworks.com>,
	Jerin Jacob <jerin.jacob@caviumnetworks.com>,
	Narayana Prasad <narayanaprasad.athreya@caviumnetworks.com>,
	dev@dpdk.org, Akash Saxena <akash.saxena@caviumnetworks.com>
Subject: [dpdk-dev] [PATCH 3/3] app/test-crypto-perf: fix check for cipher IV
Date: Fri, 14 Sep 2018 14:54:48 +0530	[thread overview]
Message-ID: <1536917088-5529-4-git-send-email-anoob.joseph@caviumnetworks.com> (raw)
In-Reply-To: <1536917088-5529-1-git-send-email-anoob.joseph@caviumnetworks.com>

IV is not required for all ciphers. Making sure the null check is done
only when 'cipher_iv_sz' is non-zero.

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")

Signed-off-by: Akash Saxena <akash.saxena@caviumnetworks.com>
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
---
 app/test-crypto-perf/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c
index 55d97c2..953e058 100644
--- a/app/test-crypto-perf/main.c
+++ b/app/test-crypto-perf/main.c
@@ -342,7 +342,9 @@ cperf_check_test_vector(struct cperf_options *opts,
 				return -1;
 			if (test_vec->ciphertext.length < opts->max_buffer_size)
 				return -1;
-			if (test_vec->cipher_iv.data == NULL)
+			/* Cipher IV is only required for some algorithms */
+			if (opts->cipher_iv_sz &&
+					test_vec->cipher_iv.data == NULL)
 				return -1;
 			if (test_vec->cipher_iv.length != opts->cipher_iv_sz)
 				return -1;
-- 
2.7.4

  parent reply	other threads:[~2018-09-14  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-14  9:24 [dpdk-dev] [PATCH 0/3] fix test vector checks Anoob Joseph
2018-09-14  9:24 ` [dpdk-dev] [PATCH 1/3] app/test-crypto-perf: add checks for AEAD key Anoob Joseph
2018-09-14  9:24 ` [dpdk-dev] [PATCH 2/3] app/test-crypto-perf: fix check for auth key Anoob Joseph
2018-09-14  9:24 ` Anoob Joseph [this message]
2018-09-25 14:23 ` [dpdk-dev] [PATCH 0/3] fix test vector checks Akhil Goyal
2018-09-26 12:26 ` Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1536917088-5529-4-git-send-email-anoob.joseph@caviumnetworks.com \
    --to=anoob.joseph@caviumnetworks.com \
    --cc=akash.saxena@caviumnetworks.com \
    --cc=akhil.goyal@nxp.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=narayanaprasad.athreya@caviumnetworks.com \
    --cc=pablo.de.lara.guarch@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).