[v4,17/21] test/crypto: test to verify custom content type in TLS

Message ID 20240313055030.1685039-18-asasidharan@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series Improvements and new test cases |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Aakash Sasidharan March 13, 2024, 5:50 a.m. UTC
  From: Vidya Sagar Velumuri <vvelumuri@marvell.com>

Add unit tests to verify TLS-1.3 record with content type as custom.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
---
 app/test/test_cryptodev.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
  

Patch

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 9f0a737913..fe4fcfbfdb 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -12438,6 +12438,21 @@  test_tls_1_3_record_proto_corrupt_pkt(void)
 
 	return test_tls_record_proto_all(&flags);
 }
+
+static int
+test_tls_1_3_record_proto_custom_content_type(void)
+{
+	struct tls_record_test_flags flags = {
+		.content_type = TLS_RECORD_TEST_CONTENT_TYPE_CUSTOM,
+		.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
@@ -17732,6 +17747,10 @@  static struct unit_test_suite tls13_record_proto_testsuite  = {
 			"TLS-1.3 record header corruption",
 			ut_setup_security, ut_teardown,
 			test_tls_1_3_record_proto_corrupt_pkt),
+		TEST_CASE_NAMED_ST(
+			"TLS-1.3 record header with custom content type",
+			ut_setup_security, ut_teardown,
+			test_tls_1_3_record_proto_custom_content_type),
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	}
 };