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, Ayuj Verma <ayuj.verma@caviumnetworks.com>
Subject: [dpdk-dev] [PATCH 2/3] app/test-crypto-perf: fix check for auth key
Date: Fri, 14 Sep 2018 14:54:47 +0530	[thread overview]
Message-ID: <1536917088-5529-3-git-send-email-anoob.joseph@caviumnetworks.com> (raw)
In-Reply-To: <1536917088-5529-1-git-send-email-anoob.joseph@caviumnetworks.com>

Authentication key is not required for all algorithms. Making sure the
null check is done only when 'auth_key_sz' is non-zero.

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

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Signed-off-by: Ayuj Verma <ayuj.verma@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 c9f99a7..55d97c2 100644
--- a/app/test-crypto-perf/main.c
+++ b/app/test-crypto-perf/main.c
@@ -357,7 +357,9 @@ cperf_check_test_vector(struct cperf_options *opts,
 				return -1;
 			if (test_vec->plaintext.length < opts->max_buffer_size)
 				return -1;
-			if (test_vec->auth_key.data == NULL)
+			/* Auth key is only required for some algorithms */
+			if (opts->auth_key_sz &&
+					test_vec->auth_key.data == NULL)
 				return -1;
 			if (test_vec->auth_key.length != opts->auth_key_sz)
 				return -1;
-- 
2.7.4

  parent reply	other threads:[~2018-09-14  9:25 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 ` Anoob Joseph [this message]
2018-09-14  9:24 ` [dpdk-dev] [PATCH 3/3] app/test-crypto-perf: fix check for cipher IV Anoob Joseph
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-3-git-send-email-anoob.joseph@caviumnetworks.com \
    --to=anoob.joseph@caviumnetworks.com \
    --cc=akhil.goyal@nxp.com \
    --cc=ayuj.verma@caviumnetworks.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).