summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorVidya Sagar Velumuri <vvelumuri@marvell.com>2024-03-13 16:28:58 +0530
committerAkhil Goyal <gakhil@marvell.com>2024-03-14 19:05:54 +0100
commit8c1d6b050b50c5dc5c497c1f6d6a20c4e38d673f (patch)
tree24bc046f95021324609fb494d3467a957747781e /app
parent13ff0b347d076bf99ace68695c31b23a8dd5afc1 (diff)
test/crypto: verify TLS 1.3 zero length record
Add unit tests to verify TLS-1.3 record with zero length. Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com> Acked-by: Anoob Joseph <anoobj@marvell.com> Acked-by: Akhil Goyal <gakhil@marvell.com>
Diffstat (limited to 'app')
-rw-r--r--app/test/test_cryptodev.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index fe4fcfbfdb..8ad5033f32 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -12453,6 +12453,37 @@ test_tls_1_3_record_proto_custom_content_type(void)
return test_tls_record_proto_all(&flags);
}
+
+static int
+test_tls_1_3_record_proto_zero_len(void)
+{
+ struct tls_record_test_flags flags = {
+ .zero_len = 1,
+ .tls_version = RTE_SECURITY_VERSION_TLS_1_3
+ };
+ struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct rte_cryptodev_info dev_info;
+
+ rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+
+ return test_tls_record_proto_all(&flags);
+}
+
+static int
+test_tls_1_3_record_proto_zero_len_non_app(void)
+{
+ struct tls_record_test_flags flags = {
+ .zero_len = 1,
+ .content_type = TLS_RECORD_TEST_CONTENT_TYPE_HANDSHAKE,
+ .tls_version = RTE_SECURITY_VERSION_TLS_1_3
+ };
+ struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct rte_cryptodev_info dev_info;
+
+ rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+
+ return test_tls_record_proto_all(&flags);
+}
#endif
static int
@@ -17751,6 +17782,14 @@ static struct unit_test_suite tls13_record_proto_testsuite = {
"TLS-1.3 record header with custom content type",
ut_setup_security, ut_teardown,
test_tls_1_3_record_proto_custom_content_type),
+ TEST_CASE_NAMED_ST(
+ "TLS-1.3 record with zero len and content type as app",
+ ut_setup_security, ut_teardown,
+ test_tls_1_3_record_proto_zero_len),
+ TEST_CASE_NAMED_ST(
+ "TLS-1.3 record with zero len and content type as ctrl",
+ ut_setup_security, ut_teardown,
+ test_tls_1_3_record_proto_zero_len_non_app),
TEST_CASES_END() /**< NULL terminate unit test array */
}
};