[PATCH v2 1/7] test/crypto: unit tests for padding for TLS-1.3
Aakash Sasidharan
asasidharan at marvell.com
Thu Jun 20 16:50:50 CEST 2024
From: Vidya Sagar Velumuri <vvelumuri at marvell.com>
Add unit tests to verify the padding for TLS-1.3.
Signed-off-by: Vidya Sagar Velumuri <vvelumuri at marvell.com>
---
app/test/test_cryptodev.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 94438c587a..61ee43327a 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -12740,6 +12740,25 @@ test_tls_1_3_record_proto_zero_len_non_app(void)
return test_tls_record_proto_all(&flags);
}
+
+static int
+test_tls_1_3_record_proto_dm_opt_padding(void)
+{
+ return test_tls_record_proto_opt_padding(6, 0, RTE_SECURITY_VERSION_TLS_1_3);
+}
+
+static int
+test_tls_1_3_record_proto_sg_opt_padding(void)
+{
+ return test_tls_record_proto_opt_padding(25, 5, RTE_SECURITY_VERSION_TLS_1_3);
+}
+
+static int
+test_tls_1_3_record_proto_sg_opt_padding_1(void)
+{
+ return test_tls_record_proto_opt_padding(25, 4, RTE_SECURITY_VERSION_TLS_1_3);
+}
+
#endif
static int
@@ -18168,6 +18187,18 @@ static struct unit_test_suite tls13_record_proto_testsuite = {
"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_CASE_NAMED_ST(
+ "TLS-1.3 record DM mode with optional padding",
+ ut_setup_security, ut_teardown,
+ test_tls_1_3_record_proto_dm_opt_padding),
+ TEST_CASE_NAMED_ST(
+ "TLS-1.3 record SG mode with optional padding - 1",
+ ut_setup_security, ut_teardown,
+ test_tls_1_3_record_proto_sg_opt_padding),
+ TEST_CASE_NAMED_ST(
+ "TLS-1.3 record SG mode with optional padding",
+ ut_setup_security, ut_teardown,
+ test_tls_1_3_record_proto_sg_opt_padding_1),
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
--
2.25.1
More information about the dev
mailing list