app/test-crypto-perf: add checks for AEAD key
authorAnoob Joseph <anoob.joseph@caviumnetworks.com>
Fri, 14 Sep 2018 09:24:46 +0000 (14:54 +0530)
committerAkhil Goyal <akhil.goyal@nxp.com>
Tue, 25 Sep 2018 15:57:25 +0000 (17:57 +0200)
Adding validation checks for AEAD key.

Signed-off-by: Akash Saxena <akash.saxena@caviumnetworks.com>
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
app/test-crypto-perf/main.c

index 5c7dadb..c9f99a7 100644 (file)
@@ -421,6 +421,10 @@ cperf_check_test_vector(struct cperf_options *opts,
                        return -1;
                if (test_vec->ciphertext.length < opts->max_buffer_size)
                        return -1;
+               if (test_vec->aead_key.data == NULL)
+                       return -1;
+               if (test_vec->aead_key.length != opts->aead_key_sz)
+                       return -1;
                if (test_vec->aead_iv.data == NULL)
                        return -1;
                if (test_vec->aead_iv.length != opts->aead_iv_sz)