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: f8be1786b1 ("app/crypto-perf: introduce performance test application")
Cc: stable@dpdk.org

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Signed-off-by: Ayuj Verma <ayuj.verma@caviumnetworks.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
This commit is contained in:
Anoob Joseph 2018-09-14 14:54:47 +05:30 committed by Akhil Goyal
parent 109924e9f3
commit c864167ce9

View File

@ -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;