diff options
author | Vidya Sagar Velumuri <vvelumuri@marvell.com> | 2024-03-13 16:28:56 +0530 |
---|---|---|
committer | Akhil Goyal <gakhil@marvell.com> | 2024-03-14 19:05:53 +0100 |
commit | c7a068edaba37b38bd7bfe051bd032b08b706650 (patch) | |
tree | 0695430e6478589518f7de28990f508739cd9a32 /app | |
parent | d2379dd8f27f4ecb54b51b74529f2543b18cfd33 (diff) |
test/crypto: verify header corruption in TLS 1.3
Add unit tests to verify TLS-1.3 record with header corruption.
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.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 25777c1b1f..9f0a737913 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -12424,6 +12424,20 @@ test_dtls_1_2_record_proto_zero_len_non_app(void) return test_tls_record_proto_all(&flags); } +static int +test_tls_1_3_record_proto_corrupt_pkt(void) +{ + struct tls_record_test_flags flags = { + .pkt_corruption = 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); +} #endif static int @@ -17714,7 +17728,10 @@ static struct unit_test_suite tls13_record_proto_testsuite = { "Read record known vector CHACHA20-POLY1305", ut_setup_security, ut_teardown, test_tls_record_proto_known_vec_read, &tls13_test_data_chacha20_poly1305), - + TEST_CASE_NAMED_ST( + "TLS-1.3 record header corruption", + ut_setup_security, ut_teardown, + test_tls_1_3_record_proto_corrupt_pkt), TEST_CASES_END() /**< NULL terminate unit test array */ } }; |