DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 0/3] fixes and addition of aes ctr test vectors
@ 2025-06-18 12:54 Nithinsen Kaithakadan
  2025-06-18 12:54 ` [PATCH 1/3] test/crypto: add ctr test cases and vectors Nithinsen Kaithakadan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nithinsen Kaithakadan @ 2025-06-18 12:54 UTC (permalink / raw)
  To: dev, stable; +Cc: adwivedi, anoobj, ktejasree, gakhil, fanzhang.oss

Include AES CTR test cases and resolve test failures

Nithinsen Kaithakadan (3):
  test/crypto: add ctr test cases and vectors
  test/crypto: set iv len to 32B for auth and cipher
  test/crypto: set ptr to null post crypto op free

 app/test/test_cryptodev.c                     |  36 +-
 app/test/test_cryptodev.h                     |   6 +-
 ...st_cryptodev_security_ipsec_test_vectors.h | 316 ++++++++++++++++++
 3 files changed, 356 insertions(+), 2 deletions(-)

-- 
2.48.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] test/crypto: add ctr test cases and vectors
  2025-06-18 12:54 [PATCH 0/3] fixes and addition of aes ctr test vectors Nithinsen Kaithakadan
@ 2025-06-18 12:54 ` Nithinsen Kaithakadan
  2025-06-18 12:54 ` [PATCH 2/3] test/crypto: set iv len to 32B for auth and cipher Nithinsen Kaithakadan
  2025-06-18 12:54 ` [PATCH 3/3] test/crypto: set ptr to null post crypto op free Nithinsen Kaithakadan
  2 siblings, 0 replies; 4+ messages in thread
From: Nithinsen Kaithakadan @ 2025-06-18 12:54 UTC (permalink / raw)
  To: dev, stable; +Cc: adwivedi, anoobj, ktejasree, gakhil, fanzhang.oss

Add test cases for AES-CTR along with the
corresponding vectors.

Signed-off-by: Nithinsen Kaithakadan <nkaithakadan@marvell.com>
---
 app/test/test_cryptodev.c                     |  33 +-
 ...st_cryptodev_security_ipsec_test_vectors.h | 316 ++++++++++++++++++
 2 files changed, 348 insertions(+), 1 deletion(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index bee1dfcdba..7535ef6974 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -10572,7 +10572,8 @@ test_ipsec_proto_process(const struct ipsec_test_data td[],
 		.protocol = RTE_SECURITY_PROTOCOL_IPSEC,
 	};
 
-	if (td[0].aead || td[0].aes_gmac) {
+	if (td[0].aead || td[0].aes_gmac ||
+		       (td[0].xform.chain.cipher.cipher.algo == RTE_CRYPTO_CIPHER_AES_CTR)) {
 		salt_len = RTE_MIN(sizeof(ipsec_xform.salt), td[0].salt.len);
 		memcpy(&ipsec_xform.salt, td[0].salt.data, salt_len);
 	}
@@ -17946,6 +17947,36 @@ static struct unit_test_suite ipsec_proto_testsuite  = {
 			ut_setup_security, ut_teardown,
 			test_ipsec_proto_known_vec,
 			&pkt_aes_128_cbc_md5),
+		TEST_CASE_NAMED_WITH_DATA(
+			"Outbound known vector (ESP tunnel mode IPv4 AES-CTR 128 HMAC-SHA256 [16B ICV])",
+			ut_setup_security, ut_teardown,
+			test_ipsec_proto_known_vec,
+			&pkt_aes_128_ctr_hmac_sha256),
+		TEST_CASE_NAMED_WITH_DATA(
+			"Outbound known vector (ESP tunnel mode IPv4 AES-CTR 128 HMAC-SHA384 [16B ICV])",
+			ut_setup_security, ut_teardown,
+			test_ipsec_proto_known_vec,
+			&pkt_aes_128_ctr_hmac_sha384),
+		TEST_CASE_NAMED_WITH_DATA(
+			"Outbound known vector (ESP tunnel mode IPv4 AES-CTR 128 HMAC-SHA512 [16B ICV])",
+			ut_setup_security, ut_teardown,
+			test_ipsec_proto_known_vec,
+			&pkt_aes_128_ctr_hmac_sha512),
+		TEST_CASE_NAMED_WITH_DATA(
+			"Inbound known vector (ESP tunnel mode IPv4 AES-CTR 128 HMAC-SHA256 [16B ICV])",
+			ut_setup_security, ut_teardown,
+			test_ipsec_proto_known_vec_inb,
+			&pkt_aes_128_ctr_hmac_sha256),
+		TEST_CASE_NAMED_WITH_DATA(
+			"Inbound known vector (ESP tunnel mode IPv4 AES-CTR 128 HMAC-SHA384 [16B ICV])",
+			ut_setup_security, ut_teardown,
+			test_ipsec_proto_known_vec_inb,
+			&pkt_aes_128_ctr_hmac_sha384),
+		TEST_CASE_NAMED_WITH_DATA(
+			"Inbound known vector (ESP tunnel mode IPv4 AES-CTR 128 HMAC-SHA512 [16B ICV])",
+			ut_setup_security, ut_teardown,
+			test_ipsec_proto_known_vec_inb,
+			&pkt_aes_128_ctr_hmac_sha512),
 		TEST_CASE_NAMED_WITH_DATA(
 			"Outbound known vector (ESP tunnel mode IPv4 AES-CBC 128 HMAC-SHA256 [16B ICV])",
 			ut_setup_security, ut_teardown,
diff --git a/app/test/test_cryptodev_security_ipsec_test_vectors.h b/app/test/test_cryptodev_security_ipsec_test_vectors.h
index 6e60e32b9d..17353a2201 100644
--- a/app/test/test_cryptodev_security_ipsec_test_vectors.h
+++ b/app/test/test_cryptodev_security_ipsec_test_vectors.h
@@ -1718,6 +1718,322 @@ struct ipsec_test_data pkt_des_cbc_hmac_sha512 = {
 	},
 };
 
+struct ipsec_test_data pkt_aes_128_ctr_hmac_sha256 = {
+	.key = {
+		.data = {
+			0x43, 0x39, 0x31, 0x4B, 0x55, 0x52, 0x39, 0x47,
+			0x59, 0x4D, 0x6D, 0x35, 0x47, 0x66, 0x6B, 0x45,
+		},
+	},
+	.auth_key = {
+		.data = {
+			0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
+			0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70,
+			0x61, 0x62, 0x63, 0x64, 0x61, 0x62, 0x63, 0x64,
+			0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C,
+		},
+	},
+	.input_text = {
+		.data = {
+			0x45, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,
+			0x3E, 0x11, 0x6D, 0xAA, 0x0D, 0x00, 0x00, 0x02,
+			0x02, 0x00, 0x00, 0x02, 0x10, 0xE1, 0x04, 0xD2,
+			0x00, 0x48, 0xA7, 0x62, 0x00, 0x01, 0x02, 0x03,
+			0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
+			0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13,
+			0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B,
+			0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23,
+		},
+		.len = 64,
+	},
+	.output_text = {
+		.data = {
+			0x45, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00,
+			0xFE, 0x32, 0x39, 0x00, 0xC0, 0xA8, 0x01, 0x01,
+			0xC0, 0xA8, 0x01, 0x02, 0x00, 0x00, 0x00, 0x64,
+			0x00, 0x00, 0x00, 0x01, 0x6C, 0x02, 0x5C, 0x41,
+			0xD5, 0x18, 0xE5, 0xF9, 0x87, 0xF0, 0x07, 0x54,
+			0xA2, 0x66, 0x28, 0x6E, 0x2C, 0xB4, 0xF9, 0x9A,
+			0x2D, 0xC7, 0x42, 0x36, 0x11, 0xE7, 0x63, 0x38,
+			0xD9, 0xD2, 0x6E, 0x45, 0x9C, 0x7C, 0xB5, 0x4B,
+			0xC7, 0x78, 0x81, 0x49, 0x73, 0xC7, 0x13, 0x44,
+			0xA7, 0x77, 0xB4, 0x56, 0xC6, 0xC7, 0xBD, 0x77,
+			0x7B, 0xFD, 0x3C, 0x67, 0x38, 0xCA, 0xB5, 0x2B,
+			0x67, 0xDB, 0xDF, 0xCB, 0x24, 0x5D, 0xA2, 0xAE,
+			0xD2, 0x15, 0x99, 0x39, 0x20, 0x70, 0xCF, 0x7B,
+			0xEE, 0x17, 0x05, 0xCF, 0x4A, 0xC5, 0xD0, 0x44,
+			0xC9, 0x81, 0xDC, 0xCB, 0xDD, 0xBC, 0x7C, 0x2F,
+		},
+		.len = 120,
+	},
+
+	.iv = {
+		.data = {
+			0x6C, 0x02, 0x5C, 0x41, 0xD5, 0x18, 0xE5, 0xF9,
+		},
+	},
+	.salt = {
+		.data = {
+			0xde, 0xad, 0xbe, 0xef,
+		},
+		.len = 4,
+	},
+
+	.ipsec_xform = {
+		.spi = 100,
+		.options.esn = 0,
+		.options.udp_encap = 0,
+		.options.copy_dscp = 0,
+		.options.copy_flabel = 0,
+		.options.copy_df = 0,
+		.options.dec_ttl = 0,
+		.options.ecn = 0,
+		.options.stats = 0,
+		.options.tunnel_hdr_verify = 0,
+		.direction = RTE_SECURITY_IPSEC_SA_DIR_EGRESS,
+		.proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
+		.mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
+		.tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4,
+		.replay_win_sz = 0,
+	},
+
+	.aead = false,
+
+	.xform = {
+		.chain.cipher = {
+			.next = NULL,
+			.type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+			.cipher = {
+				.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT,
+				.algo = RTE_CRYPTO_CIPHER_AES_CTR,
+				.key.length = 16,
+				.iv.length = 12,
+			},
+		},
+		.chain.auth = {
+			.next = NULL,
+			.type = RTE_CRYPTO_SYM_XFORM_AUTH,
+			.auth = {
+				.op = RTE_CRYPTO_AUTH_OP_GENERATE,
+				.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
+				.key.length = 32,
+				.digest_length = 16,
+			},
+		},
+	},
+};
+
+struct ipsec_test_data pkt_aes_128_ctr_hmac_sha384 = {
+	.key = {
+		.data = {
+			0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
+			0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70,
+		},
+	},
+	.auth_key = {
+		.data = {
+			0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
+			0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70,
+			0x61, 0x62, 0x63, 0x64, 0x61, 0x62, 0x63, 0x64,
+			0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C,
+			0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
+			0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70,
+		},
+	},
+	.input_text = {
+		.data = {
+			0x45, 0x00, 0x00, 0x2E, 0x00, 0x01, 0x00, 0x00,
+			0x3F, 0x11, 0x1C, 0x8A, 0xAC, 0x10, 0x03, 0x0A,
+			0xAC, 0x10, 0x04, 0x0A, 0xC0, 0x00, 0xC0, 0x00,
+			0x00, 0x1A, 0x1A, 0x84, 0x00, 0x00, 0x00, 0x00,
+			0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+			0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+		},
+		.len = 46,
+	},
+	.output_text = {
+		.data = {
+			0x45, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00,
+			0xFF, 0x32, 0x38, 0x0C, 0xC0, 0xA8, 0x01, 0x01,
+			0xC0, 0xA8, 0x01, 0x02, 0x00, 0x00, 0x00, 0x64,
+			0x00, 0x00, 0x00, 0x01, 0xD2, 0xC4, 0xD3, 0xFE,
+			0x1D, 0x7D, 0xEA, 0xBB, 0x92, 0x26, 0xDC, 0x11,
+			0x3D, 0x7B, 0x17, 0x0E, 0x9C, 0x8B, 0x09, 0xA9,
+			0x73, 0xDC, 0xBF, 0xC5, 0x0E, 0x02, 0x31, 0xAA,
+			0xAF, 0x9C, 0x21, 0x81, 0x15, 0x83, 0x22, 0x87,
+			0xB3, 0x93, 0x94, 0x35, 0xAB, 0xB9, 0x43, 0x77,
+			0x4D, 0x18, 0x95, 0xA9, 0x55, 0x0B, 0xD6, 0x8E,
+			0xBA, 0x86, 0x0C, 0x93, 0x67, 0x65, 0x85, 0x7D,
+			0x5E, 0x74, 0x2F, 0xE5, 0x8C, 0x72, 0x60, 0xE3,
+			0x91, 0xB2, 0x83, 0x74, 0x84, 0xAD, 0x19, 0x26,
+			0x26, 0x5D, 0x30, 0x89,
+		},
+		.len = 108,
+	},
+
+	.iv = {
+		.data = {
+			0xD2, 0xC4, 0xD3, 0xFE, 0x1D, 0x7D, 0xEA, 0xBB,
+		},
+	},
+	.salt = {
+		.data = {
+			0xde, 0xad, 0xbe, 0xef,
+		},
+		.len = 4,
+	},
+
+	.ipsec_xform = {
+		.spi = 100,
+		.options.esn = 0,
+		.options.udp_encap = 0,
+		.options.copy_dscp = 0,
+		.options.copy_flabel = 0,
+		.options.copy_df = 0,
+		.options.dec_ttl = 0,
+		.options.ecn = 0,
+		.options.stats = 0,
+		.options.tunnel_hdr_verify = 0,
+		.direction = RTE_SECURITY_IPSEC_SA_DIR_EGRESS,
+		.proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
+		.mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
+		.tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4,
+		.replay_win_sz = 0,
+	},
+
+	.aead = false,
+
+	.xform = {
+		.chain.cipher = {
+			.next = NULL,
+			.type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+			.cipher = {
+				.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT,
+				.algo = RTE_CRYPTO_CIPHER_AES_CTR,
+				.key.length = 16,
+				.iv.length = 12,
+			},
+		},
+		.chain.auth = {
+			.next = NULL,
+			.type = RTE_CRYPTO_SYM_XFORM_AUTH,
+			.auth = {
+				.op = RTE_CRYPTO_AUTH_OP_GENERATE,
+				.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
+				.key.length = 48,
+				.digest_length = 24,
+			},
+		},
+	},
+};
+
+struct ipsec_test_data pkt_aes_128_ctr_hmac_sha512 = {
+	.key = {
+		.data = {
+			0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
+			0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70,
+		},
+	},
+	.auth_key = {
+		.data = {
+			0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
+			0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70,
+			0x61, 0x62, 0x63, 0x64, 0x61, 0x62, 0x63, 0x64,
+			0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C,
+			0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
+			0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70,
+			0x61, 0x62, 0x63, 0x64, 0x61, 0x62, 0x63, 0x64,
+			0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C,
+		},
+	},
+	.input_text = {
+		.data = {
+			0x45, 0x00, 0x00, 0x2E, 0x00, 0x01, 0x00, 0x00,
+			0x3F, 0x11, 0x1C, 0x8A, 0xAC, 0x10, 0x03, 0x0A,
+			0xAC, 0x10, 0x04, 0x0A, 0xC0, 0x00, 0xC0, 0x00,
+			0x00, 0x1A, 0x1A, 0x84, 0x00, 0x00, 0x00, 0x00,
+			0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+			0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+		},
+		.len = 46,
+	},
+	.output_text = {
+		.data = {
+			0x45, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00,
+			0xFF, 0x32, 0x38, 0x04, 0xC0, 0xA8, 0x01, 0x01,
+			0xC0, 0xA8, 0x01, 0x02, 0x00, 0x00, 0x00, 0x64,
+			0x00, 0x00, 0x00, 0x01, 0x65, 0xEB, 0x54, 0xB1,
+			0x76, 0x20, 0xF1, 0x31, 0xC2, 0x78, 0xF5, 0xB2,
+			0x63, 0x8D, 0x6F, 0xA4, 0x28, 0xB4, 0xF6, 0xAA,
+			0x21, 0x94, 0xD9, 0x6D, 0x44, 0x71, 0x94, 0xBD,
+			0xBA, 0xE7, 0xEC, 0xEF, 0xB5, 0x8B, 0xA9, 0xCC,
+			0xA7, 0x9D, 0xB7, 0x70, 0x4F, 0x39, 0xD0, 0x3E,
+			0x77, 0x5C, 0xEE, 0x8F, 0xC1, 0x46, 0x38, 0x27,
+			0x10, 0x11, 0x09, 0x2C, 0x32, 0xA3, 0xBE, 0xB2,
+			0x3F, 0xB9, 0x01, 0x9B, 0x1C, 0x74, 0x6F, 0xF8,
+			0xBE, 0x9C, 0xE7, 0xBA, 0x02, 0x0C, 0xC5, 0xD3,
+			0x05, 0x4A, 0xF3, 0x9B, 0x34, 0x8A, 0xF2, 0xE4,
+			0x1B, 0x72, 0x47, 0xBB,
+		},
+		.len = 116,
+	},
+
+	.iv = {
+		.data = {
+			0x65, 0xEB, 0x54, 0xB1, 0x76, 0x20, 0xF1, 0x31
+		},
+	},
+	.salt = {
+		.data = {
+			0xde, 0xad, 0xbe, 0xef,
+		},
+		.len = 4,
+	},
+
+	.ipsec_xform = {
+		.spi = 100,
+		.options.esn = 0,
+		.options.udp_encap = 0,
+		.options.copy_dscp = 0,
+		.options.copy_flabel = 0,
+		.options.copy_df = 0,
+		.options.dec_ttl = 0,
+		.options.ecn = 0,
+		.options.stats = 0,
+		.options.tunnel_hdr_verify = 0,
+		.direction = RTE_SECURITY_IPSEC_SA_DIR_EGRESS,
+		.proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
+		.mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
+		.tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4,
+		.replay_win_sz = 0,
+	},
+
+	.aead = false,
+
+	.xform = {
+		.chain.cipher = {
+			.next = NULL,
+			.type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+			.cipher = {
+				.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT,
+				.algo = RTE_CRYPTO_CIPHER_AES_CTR,
+				.key.length = 16,
+				.iv.length = 12,
+			},
+		},
+		.chain.auth = {
+			.next = NULL,
+			.type = RTE_CRYPTO_SYM_XFORM_AUTH,
+			.auth = {
+				.op = RTE_CRYPTO_AUTH_OP_GENERATE,
+				.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
+				.key.length = 64,
+				.digest_length = 32,
+			},
+		},
+	},
+};
+
 struct ipsec_test_data pkt_aes_128_cbc_hmac_sha256_v6 = {
 	.key = {
 		.data = {
-- 
2.48.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/3] test/crypto: set iv len to 32B for auth and cipher
  2025-06-18 12:54 [PATCH 0/3] fixes and addition of aes ctr test vectors Nithinsen Kaithakadan
  2025-06-18 12:54 ` [PATCH 1/3] test/crypto: add ctr test cases and vectors Nithinsen Kaithakadan
@ 2025-06-18 12:54 ` Nithinsen Kaithakadan
  2025-06-18 12:54 ` [PATCH 3/3] test/crypto: set ptr to null post crypto op free Nithinsen Kaithakadan
  2 siblings, 0 replies; 4+ messages in thread
From: Nithinsen Kaithakadan @ 2025-06-18 12:54 UTC (permalink / raw)
  To: dev, stable; +Cc: adwivedi, anoobj, ktejasree, gakhil, fanzhang.oss

Set maximum IV length to 32 bytes to include both auth IV
and cipher IV.

Fixes: fd01a9be38d5 ("test/crypto: move IV to crypto op private data")

Signed-off-by: Nithinsen Kaithakadan <nkaithakadan@marvell.com>
---
 app/test/test_cryptodev.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/app/test/test_cryptodev.h b/app/test/test_cryptodev.h
index a80c11baf4..e243cf945a 100644
--- a/app/test/test_cryptodev.h
+++ b/app/test/test_cryptodev.h
@@ -40,7 +40,11 @@
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA384		(24)
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA512		(32)
 
-#define MAXIMUM_IV_LENGTH				(16)
+/*
+ * maximum IV length need to include both the
+ * auth IV length (16 bytes) and the cipher IV length (16 bytes)
+ */
+#define MAXIMUM_IV_LENGTH				(32)
 #define AES_GCM_J0_LENGTH				(16)
 
 #define IV_OFFSET			(sizeof(struct rte_crypto_op) + \
-- 
2.48.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/3] test/crypto: set ptr to null post crypto op free
  2025-06-18 12:54 [PATCH 0/3] fixes and addition of aes ctr test vectors Nithinsen Kaithakadan
  2025-06-18 12:54 ` [PATCH 1/3] test/crypto: add ctr test cases and vectors Nithinsen Kaithakadan
  2025-06-18 12:54 ` [PATCH 2/3] test/crypto: set iv len to 32B for auth and cipher Nithinsen Kaithakadan
@ 2025-06-18 12:54 ` Nithinsen Kaithakadan
  2 siblings, 0 replies; 4+ messages in thread
From: Nithinsen Kaithakadan @ 2025-06-18 12:54 UTC (permalink / raw)
  To: dev, stable; +Cc: adwivedi, anoobj, ktejasree, gakhil, fanzhang.oss

Set pointer to NULL post rte_crypto_op_free operation.

Fixes: 3bf0db60f5d2 ("test/crypto: add queue pair depth used count")
Fixes: 202d375c60bc ("app/test: add cryptodev unit and performance tests")
Fixes: ffbe3be0d4b5 ("app/test: add libcrypto")

Signed-off-by: Nithinsen Kaithakadan <nkaithakadan@marvell.com>
---
 app/test/test_cryptodev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 7535ef6974..5229ac2bf6 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -2625,6 +2625,7 @@ test_queue_pair_descriptor_count(void)
 
 		rte_pktmbuf_free(ops_deq[i]->sym->m_src);
 		rte_crypto_op_free(ops_deq[i]);
+		ops_deq[i] = NULL;
 	}
 
 	return TEST_SUCCESS;
@@ -14789,6 +14790,7 @@ test_multi_session(void)
 
 		/* free crypto operation structure */
 		rte_crypto_op_free(ut_params->op);
+		ut_params->op = NULL;
 
 		/*
 		 * free mbuf - both obuf and ibuf are usually the same,
@@ -14933,6 +14935,7 @@ test_multi_session_random_usage(void)
 					ut_paramz[j].iv);
 
 		rte_crypto_op_free(ut_paramz[j].ut_params.op);
+		ut_paramz[j].ut_params.op = NULL;
 
 		/*
 		 * free mbuf - both obuf and ibuf are usually the same,
-- 
2.48.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-06-18 12:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-18 12:54 [PATCH 0/3] fixes and addition of aes ctr test vectors Nithinsen Kaithakadan
2025-06-18 12:54 ` [PATCH 1/3] test/crypto: add ctr test cases and vectors Nithinsen Kaithakadan
2025-06-18 12:54 ` [PATCH 2/3] test/crypto: set iv len to 32B for auth and cipher Nithinsen Kaithakadan
2025-06-18 12:54 ` [PATCH 3/3] test/crypto: set ptr to null post crypto op free Nithinsen Kaithakadan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).