From c864167ce97d91ed95c68f8f85cf2dbaaae212d3 Mon Sep 17 00:00:00 2001 From: Anoob Joseph Date: Fri, 14 Sep 2018 14:54:47 +0530 Subject: [PATCH] app/test-crypto-perf: fix check for auth key 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") Cc: stable@dpdk.org Signed-off-by: Anoob Joseph Signed-off-by: Ayuj Verma Acked-by: Akhil Goyal --- 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 c9f99a76d8..55d97c26b6 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.20.1