[1/3] app/test-crypto-perf: add checks for AEAD key
diff mbox series

Message ID 1536917088-5529-2-git-send-email-anoob.joseph@caviumnetworks.com
State Accepted, archived
Delegated to: akhil goyal
Headers show
Series
  • fix test vector checks
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Anoob Joseph Sept. 14, 2018, 9:24 a.m. UTC
Adding validation checks for AEAD key.

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

Patch
diff mbox series

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)