Adding validation checks for AEAD key.

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

diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c
index 5c7dadb..c9f99a7 100644
--- a/app/test-crypto-perf/main.c
+++ b/app/test-crypto-perf/main.c
@@ -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)
-- 
2.7.4

Reply via email to