From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DCE29A09E7; Wed, 19 Oct 2022 18:54:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 451D342C07; Wed, 19 Oct 2022 18:54:29 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 7BDBE42C07 for ; Wed, 19 Oct 2022 18:54:27 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29J8B5NN010696; Wed, 19 Oct 2022 09:54:26 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=365Z7UY0u93aBTxqzpm01jowow1ah/G61rvVNlGM+2U=; b=D0iebf+KatGwo47ND4vpqH6j+yFuzRofdkp/YS0MyiPGiWLCZOvL6VmPTvQAnOyUGR0+ tOlhn4dBepoaqC746UwMQdP/PLttU1Ce3DKCwkNpRMuSOydX4xzqGLdba+ae83UIGMpm qcT0nFP9wDPkBpo6D0gPGbDLDk3Nruy7PVt21ur9/GOa67t48BfrMm2b3jTIW8F3Atra XO0hxQPgIuEfASm7PDy3/Sw72G4ESrsYg4A0TIpdhW79QugTvEnbh67jkwvY4mhiAifN ZvjZBc45goNGDE5cGNvIRQ2PhioP0mhkU8AsebFHf9sypF9gw3RO798c+74pvRWf+y8O nQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3kadg5a7bh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 19 Oct 2022 09:54:26 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 19 Oct 2022 09:54:24 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 19 Oct 2022 09:54:24 -0700 Received: from hyd1554.marvell.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 442533F709C; Wed, 19 Oct 2022 09:54:22 -0700 (PDT) From: Tejasree Kondoj To: Akhil Goyal , Fan Zhang , Ciara Power CC: Vidya Sagar Velumuri , Anoob Joseph , Subject: [PATCH 1/6] test/security: add unit tests for DES and 3DES Date: Wed, 19 Oct 2022 22:24:13 +0530 Message-ID: <20221019165418.1970445-2-ktejasree@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221019165418.1970445-1-ktejasree@marvell.com> References: <20221019165418.1970445-1-ktejasree@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: Zx40jI-gu3x_Nd17iyXuVBUGuAtyVRi2 X-Proofpoint-ORIG-GUID: Zx40jI-gu3x_Nd17iyXuVBUGuAtyVRi2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-19_09,2022-10-19_04,2022-06-22_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Vidya Sagar Velumuri Add unit test cases and test vecotrs for DES-CBC and 3DES-CBC. Signed-off-by: Vidya Sagar Velumuri --- app/test/test_cryptodev_security_ipsec.h | 12 + ...st_cryptodev_security_ipsec_test_vectors.h | 876 ++++++++++++++++++ app/test/test_security_inline_proto.c | 89 ++ 3 files changed, 977 insertions(+) diff --git a/app/test/test_cryptodev_security_ipsec.h b/app/test/test_cryptodev_security_ipsec.h index 67b783e637..95e86a05e0 100644 --- a/app/test/test_cryptodev_security_ipsec.h +++ b/app/test/test_cryptodev_security_ipsec.h @@ -150,6 +150,18 @@ static const struct crypto_param cipher_list[] = { .key_length = 0, .iv_length = 0, }, + { + .type = RTE_CRYPTO_SYM_XFORM_CIPHER, + .alg.cipher = RTE_CRYPTO_CIPHER_DES_CBC, + .key_length = 8, + .iv_length = 8, + }, + { + .type = RTE_CRYPTO_SYM_XFORM_CIPHER, + .alg.cipher = RTE_CRYPTO_CIPHER_3DES_CBC, + .key_length = 24, + .iv_length = 8, + }, { .type = RTE_CRYPTO_SYM_XFORM_CIPHER, .alg.cipher = RTE_CRYPTO_CIPHER_AES_CBC, diff --git a/app/test/test_cryptodev_security_ipsec_test_vectors.h b/app/test/test_cryptodev_security_ipsec_test_vectors.h index 5f775a241a..18ffceddce 100644 --- a/app/test/test_cryptodev_security_ipsec_test_vectors.h +++ b/app/test/test_cryptodev_security_ipsec_test_vectors.h @@ -955,6 +955,661 @@ struct ipsec_test_data pkt_aes_128_cbc_hmac_sha512 = { }, }; +struct ipsec_test_data pkt_3des_cbc_hmac_sha256 = { + .key = { + .data = { + 0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2, + 0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A, + 0x00, 0x04, 0x05, 0x01, 0x23, 0x00, 0x00, 0x00, + }, + }, + .auth_key = { + .data = { + 0xde, 0x34, 0x56, 0x00, 0x00, 0x00, 0x78, 0x00, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x10, 0x30, 0x40, 0x00, 0x01, 0x02, 0x03, 0x04, + 0x0a, 0x0b, 0x0c, 0x0d, 0x05, 0x06, 0x07, 0x08, + }, + }, + .input_text = { + .data = { + /* IP */ + 0x45, 0x00, 0x00, 0x32, 0x00, 0x01, 0x00, 0x00, + 0x1f, 0x11, 0x17, 0x8b, 0xc0, 0xa8, 0x01, 0x6f, + 0xc0, 0xa8, 0x01, 0x70, + + /* UDP */ + 0x00, 0x09, 0x00, 0x09, 0x00, 0x1e, 0x00, 0x00, + 0xbe, 0x9b, 0xe9, 0x55, 0x00, 0x00, 0x00, 0x21, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .len = 50, + }, + .output_text = { + .data = { + /* IP - outer header */ + 0x45, 0x00, 0x00, 0x6c, 0x00, 0x01, 0x00, 0x00, + 0x40, 0x32, 0xf7, 0x0b, 0xc0, 0xa8, 0x01, 0x02, + 0xc0, 0xa8, 0x01, 0x01, + + /* ESP */ + 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x01, + + /* IV */ + 0x34, 0x12, 0x67, 0x45, 0xff, 0xff, 0x00, 0x00, + + /* Data */ + 0x45, 0x2a, 0x7d, 0xe8, 0x96, 0x8b, 0x6e, 0x9f, + 0x8e, 0xa8, 0x87, 0xf6, 0x12, 0x41, 0x61, 0x6e, + 0x42, 0xae, 0xd4, 0x71, 0x2a, 0x7d, 0xde, 0x46, + 0x24, 0xa7, 0xc8, 0xd1, 0x8a, 0x78, 0x5f, 0xb8, + 0xb1, 0x43, 0xec, 0x3b, 0x95, 0x9c, 0x54, 0x7b, + 0x0c, 0x47, 0x80, 0xfb, 0xff, 0x18, 0x54, 0x87, + 0x16, 0x22, 0x88, 0x06, 0xcf, 0xfd, 0xf6, 0x01, + 0x02, 0x58, 0x94, 0x34, 0xc9, 0xbc, 0xea, 0xb8, + 0xc9, 0x75, 0xf6, 0xc4, 0x8b, 0x46, 0x69, 0x3c, + }, + .len = 108, + }, + .iv = { + .data = { + 0x34, 0x12, 0x67, 0x45, 0xff, 0xff, 0x00, 0x00, + }, + }, + + .ipsec_xform = { + .spi = 52, + .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_3DES_CBC, + .key.length = 24, + .iv.length = 8, + }, + }, + .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_3des_cbc_hmac_sha384 = { + .key = { + .data = { + 0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2, + 0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A, + 0x00, 0x04, 0x05, 0x01, 0x23, 0x00, 0x00, 0x00, + }, + }, + .auth_key = { + .data = { + 0x10, 0x30, 0x40, 0x00, 0x01, 0x02, 0x03, 0x04, + 0x0a, 0x0b, 0x0c, 0x0d, 0x05, 0x06, 0x07, 0x08, + 0xde, 0x34, 0x56, 0x00, 0x00, 0x00, 0x78, 0x00, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x02, + 0x10, 0x30, 0x40, 0x00, 0x01, 0x02, 0x03, 0x34, + 0x1a, 0x0b, 0x0c, 0x0d, 0x05, 0x06, 0x07, 0x08, + }, + }, + .input_text = { + .data = { + /* IP */ + 0x45, 0x00, 0x00, 0x32, 0x00, 0x01, 0x00, 0x00, + 0x1f, 0x11, 0x17, 0x8b, 0xc0, 0xa8, 0x01, 0x6f, + 0xc0, 0xa8, 0x01, 0x70, + + /* UDP */ + 0x00, 0x09, 0x00, 0x09, 0x00, 0x1e, 0x00, 0x00, + 0xbe, 0x9b, 0xe9, 0x55, 0x00, 0x00, 0x00, 0x21, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .len = 50, + }, + .output_text = { + .data = { + /* IP - outer header */ + 0x45, 0x00, 0x00, 0x74, 0x00, 0x01, 0x00, 0x00, + 0x40, 0x32, 0xf7, 0x03, 0xc0, 0xa8, 0x01, 0x02, + 0xc0, 0xa8, 0x01, 0x01, + + /* ESP */ + 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x01, + + /* IV */ + 0x34, 0x12, 0x67, 0x45, 0xff, 0xff, 0x00, 0x00, + + /* Data */ + 0x45, 0x2a, 0x7d, 0xe8, 0x96, 0x8b, 0x6e, 0x9f, + 0x8e, 0xa8, 0x87, 0xf6, 0x12, 0x41, 0x61, 0x6e, + 0x42, 0xae, 0xd4, 0x71, 0x2a, 0x7d, 0xde, 0x46, + 0x24, 0xa7, 0xc8, 0xd1, 0x8a, 0x78, 0x5f, 0xb8, + 0xb1, 0x43, 0xec, 0x3b, 0x95, 0x9c, 0x54, 0x7b, + 0x0c, 0x47, 0x80, 0xfb, 0xff, 0x18, 0x54, 0x87, + 0x16, 0x22, 0x88, 0x06, 0xcf, 0xfd, 0xf6, 0x01, + 0x27, 0x34, 0x80, 0xa0, 0xc0, 0xd8, 0x97, 0xa4, + 0x67, 0xf5, 0x6b, 0xd4, 0x2c, 0x74, 0xc4, 0x51, + 0xed, 0x0d, 0xae, 0x23, 0xbb, 0xfa, 0xfb, 0x91, + }, + .len = 116, + }, + .iv = { + .data = { + 0x34, 0x12, 0x67, 0x45, 0xff, 0xff, 0x00, 0x00, + }, + }, + + .ipsec_xform = { + .spi = 52, + .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_3DES_CBC, + .key.length = 24, + .iv.length = 8, + }, + }, + .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_3des_cbc_hmac_sha512 = { + .key = { + .data = { + 0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2, + 0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A, + 0x00, 0x04, 0x05, 0x01, 0x23, 0x00, 0x00, 0x00, + }, + }, + .auth_key = { + .data = { + 0xde, 0x34, 0x56, 0x00, 0x00, 0x00, 0x78, 0x00, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x10, 0x30, 0x40, 0x00, 0x01, 0x02, 0x03, 0x04, + 0x0a, 0x0b, 0x0c, 0x0d, 0x05, 0x06, 0x07, 0x08, + 0xde, 0x34, 0x56, 0x00, 0x00, 0x00, 0x78, 0x00, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x02, + 0x10, 0x30, 0x40, 0x00, 0x01, 0x02, 0x03, 0x34, + 0x1a, 0x0b, 0x0c, 0x0d, 0x05, 0x06, 0x07, 0x08, + }, + }, + .input_text = { + .data = { + /* IP */ + 0x45, 0x00, 0x00, 0x32, 0x00, 0x01, 0x00, 0x00, + 0x1f, 0x11, 0x17, 0x8b, 0xc0, 0xa8, 0x01, 0x6f, + 0xc0, 0xa8, 0x01, 0x70, + + /* UDP */ + 0x00, 0x09, 0x00, 0x09, 0x00, 0x1e, 0x00, 0x00, + 0xbe, 0x9b, 0xe9, 0x55, 0x00, 0x00, 0x00, 0x21, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .len = 50, + }, + .output_text = { + .data = { + /* IP - outer header */ + 0x45, 0x00, 0x00, 0x7c, 0x00, 0x01, 0x00, 0x00, + 0x40, 0x32, 0xf6, 0xfb, 0xc0, 0xa8, 0x01, 0x02, + 0xc0, 0xa8, 0x01, 0x01, + + /* ESP */ + 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x01, + + /* IV */ + 0x34, 0x12, 0x67, 0x45, 0xff, 0xff, 0x00, 0x00, + + /* Data */ + 0x45, 0x2a, 0x7d, 0xe8, 0x96, 0x8b, 0x6e, 0x9f, + 0x8e, 0xa8, 0x87, 0xf6, 0x12, 0x41, 0x61, 0x6e, + 0x42, 0xae, 0xd4, 0x71, 0x2a, 0x7d, 0xde, 0x46, + 0x24, 0xa7, 0xc8, 0xd1, 0x8a, 0x78, 0x5f, 0xb8, + 0xb1, 0x43, 0xec, 0x3b, 0x95, 0x9c, 0x54, 0x7b, + 0x0c, 0x47, 0x80, 0xfb, 0xff, 0x18, 0x54, 0x87, + 0x16, 0x22, 0x88, 0x06, 0xcf, 0xfd, 0xf6, 0x01, + 0xe7, 0x32, 0x8b, 0x4c, 0x9f, 0xe4, 0x54, 0x0d, + 0x37, 0xec, 0xaa, 0x4b, 0x2a, 0x32, 0xfc, 0x4c, + 0x04, 0xeb, 0x26, 0x53, 0x24, 0x4c, 0xcc, 0xf7, + 0xeb, 0x24, 0x76, 0x42, 0xb4, 0x0c, 0xbc, 0xd4, + }, + .len = 124, + }, + .iv = { + .data = { + 0x34, 0x12, 0x67, 0x45, 0xff, 0xff, 0x00, 0x00, + }, + }, + + .ipsec_xform = { + .spi = 52, + .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_3DES_CBC, + .key.length = 24, + .iv.length = 8, + }, + }, + .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_des_cbc_hmac_sha256 = { + .key = { + .data = { + 0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A, + }, + }, + .auth_key = { + .data = { + 0xde, 0x34, 0x56, 0x00, 0x00, 0x00, 0x78, 0x00, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x10, 0x30, 0x40, 0x00, 0x01, 0x02, 0x03, 0x04, + 0x0a, 0x0b, 0x0c, 0x0d, 0x05, 0x06, 0x07, 0x08, + }, + }, + .input_text = { + .data = { + /* IP */ + 0x45, 0x00, 0x00, 0x32, 0x00, 0x01, 0x00, 0x00, + 0x1f, 0x11, 0x17, 0x8b, 0xc0, 0xa8, 0x01, 0x6f, + 0xc0, 0xa8, 0x01, 0x70, + + /* UDP */ + 0x00, 0x09, 0x00, 0x09, 0x00, 0x1e, 0x00, 0x00, + 0xbe, 0x9b, 0xe9, 0x55, 0x00, 0x00, 0x00, 0x21, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .len = 50, + }, + .output_text = { + .data = { + /* IP - outer header */ + 0x45, 0x00, 0x00, 0x6c, 0x00, 0x01, 0x00, 0x00, + 0x40, 0x32, 0xf7, 0x0b, 0xc0, 0xa8, 0x01, 0x02, + 0xc0, 0xa8, 0x01, 0x01, + + /* ESP */ + 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x01, + + /* IV */ + 0x34, 0x12, 0x67, 0x45, 0xff, 0xff, 0x00, 0x00, + + /* Data */ + 0xdd, 0x13, 0x10, 0x3c, 0xe4, 0xb9, 0xce, 0x12, + 0x73, 0x4c, 0x97, 0x00, 0x28, 0xf7, 0xa4, 0x5e, + 0x02, 0x17, 0xe1, 0xc6, 0x09, 0x20, 0x90, 0xe3, + 0xb6, 0x9c, 0x25, 0x6d, 0x62, 0x06, 0x60, 0x90, + 0x91, 0x76, 0x94, 0xd8, 0x57, 0x56, 0xcb, 0xdd, + 0x62, 0x99, 0x99, 0x98, 0xd0, 0x3a, 0x99, 0x71, + 0x64, 0xcb, 0x79, 0x0c, 0x89, 0xa2, 0xf6, 0x12, + 0x1f, 0x09, 0xf8, 0x36, 0x8f, 0x5e, 0x31, 0x93, + 0x0a, 0xa0, 0x48, 0xee, 0x61, 0x21, 0xb5, 0x3d, + }, + .len = 108, + }, + .iv = { + .data = { + 0x34, 0x12, 0x67, 0x45, 0xff, 0xff, 0x00, 0x00, + }, + }, + + .ipsec_xform = { + .spi = 58, + .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_DES_CBC, + .key.length = 8, + .iv.length = 8, + }, + }, + .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_des_cbc_hmac_sha384 = { + .key = { + .data = { + 0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2, + }, + }, + .auth_key = { + .data = { + 0x10, 0x30, 0x40, 0x00, 0x01, 0x02, 0x03, 0x04, + 0x0a, 0x0b, 0x0c, 0x0d, 0x05, 0x06, 0x07, 0x08, + 0xde, 0x34, 0x56, 0x00, 0x00, 0x00, 0x78, 0x00, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x02, + 0x10, 0x30, 0x40, 0x00, 0x01, 0x02, 0x03, 0x34, + 0x1a, 0x0b, 0x0c, 0x0d, 0x05, 0x06, 0x07, 0x08, + }, + }, + .input_text = { + .data = { + /* IP */ + 0x45, 0x00, 0x00, 0x32, 0x00, 0x01, 0x00, 0x00, + 0x1f, 0x11, 0x17, 0x8b, 0xc0, 0xa8, 0x01, 0x6f, + 0xc0, 0xa8, 0x01, 0x70, + + /* UDP */ + 0x00, 0x09, 0x00, 0x09, 0x00, 0x1e, 0x00, 0x00, + 0xbe, 0x9b, 0xe9, 0x55, 0x00, 0x00, 0x00, 0x21, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .len = 50, + }, + .output_text = { + .data = { + /* IP - outer header */ + 0x45, 0x00, 0x00, 0x74, 0x00, 0x01, 0x00, 0x00, + 0x40, 0x32, 0xf7, 0x03, 0xc0, 0xa8, 0x01, 0x02, + 0xc0, 0xa8, 0x01, 0x01, + + /* ESP */ + 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x01, + + /* IV */ + 0x34, 0x12, 0x67, 0x45, 0xff, 0xff, 0x00, 0x00, + + /* Data */ + 0x80, 0x6a, 0xcd, 0x35, 0x95, 0x6c, 0x04, 0x66, + 0x4c, 0x04, 0xeb, 0xdb, 0x85, 0xc8, 0xf9, 0x56, + 0xe7, 0x01, 0x17, 0x97, 0xc4, 0xa5, 0xa4, 0xfe, + 0xa0, 0x81, 0x62, 0xda, 0xb2, 0xc0, 0xcf, 0x21, + 0x54, 0x0c, 0x38, 0xcf, 0xca, 0x41, 0x20, 0x5f, + 0xed, 0xc3, 0xe3, 0x59, 0xc4, 0x2f, 0x5e, 0xf7, + 0xdd, 0x16, 0x15, 0xd2, 0x00, 0xe8, 0x60, 0xc6, + 0xd8, 0x73, 0xf0, 0xb1, 0x89, 0xc4, 0xb2, 0x65, + 0xe2, 0xbf, 0xeb, 0xd8, 0x1d, 0x0a, 0xae, 0x2c, + 0x4d, 0xd3, 0x59, 0x30, 0x5e, 0x47, 0xb9, 0xcc, + }, + .len = 116, + }, + .iv = { + .data = { + 0x34, 0x12, 0x67, 0x45, 0xff, 0xff, 0x00, 0x00, + }, + }, + + .ipsec_xform = { + .spi = 58, + .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_DES_CBC, + .key.length = 8, + .iv.length = 8, + }, + }, + .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_des_cbc_hmac_sha512 = { + .key = { + .data = { + 0x00, 0x04, 0x05, 0x01, 0x23, 0x00, 0x00, 0x00, + }, + }, + .auth_key = { + .data = { + 0xde, 0x34, 0x56, 0x00, 0x00, 0x00, 0x78, 0x00, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x10, 0x30, 0x40, 0x00, 0x01, 0x02, 0x03, 0x04, + 0x0a, 0x0b, 0x0c, 0x0d, 0x05, 0x06, 0x07, 0x08, + 0xde, 0x34, 0x56, 0x00, 0x00, 0x00, 0x78, 0x00, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x02, + 0x10, 0x30, 0x40, 0x00, 0x01, 0x02, 0x03, 0x34, + 0x1a, 0x0b, 0x0c, 0x0d, 0x05, 0x06, 0x07, 0x08, + }, + }, + .input_text = { + .data = { + /* IP */ + 0x45, 0x00, 0x00, 0x32, 0x00, 0x01, 0x00, 0x00, + 0x1f, 0x11, 0x17, 0x8b, 0xc0, 0xa8, 0x01, 0x6f, + 0xc0, 0xa8, 0x01, 0x70, + + /* UDP */ + 0x00, 0x09, 0x00, 0x09, 0x00, 0x1e, 0x00, 0x00, + 0xbe, 0x9b, 0xe9, 0x55, 0x00, 0x00, 0x00, 0x21, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + .len = 50, + }, + .output_text = { + .data = { + /* IP - outer header */ + 0x45, 0x00, 0x00, 0x7c, 0x00, 0x01, 0x00, 0x00, + 0x40, 0x32, 0xf6, 0xfb, 0xc0, 0xa8, 0x01, 0x02, + 0xc0, 0xa8, 0x01, 0x01, + + /* ESP */ + 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x01, + + /* IV */ + 0x34, 0x12, 0x67, 0x45, 0xff, 0xff, 0x00, 0x00, + + /* Data */ + 0x54, 0xe6, 0xf3, 0xd4, 0x25, 0x1c, 0x57, 0xd0, + 0x55, 0x7d, 0x52, 0xd3, 0xcb, 0x65, 0x57, 0x37, + 0xd9, 0x83, 0x37, 0x69, 0x95, 0xa7, 0x2b, 0xc2, + 0x65, 0x9e, 0xf6, 0xc8, 0xca, 0x6a, 0x9d, 0x51, + 0xde, 0xbe, 0x45, 0x58, 0x72, 0x58, 0x92, 0x49, + 0x15, 0x02, 0xae, 0x38, 0xb5, 0xf7, 0xcc, 0x6d, + 0xe5, 0x95, 0x21, 0xf1, 0xda, 0x69, 0x93, 0x76, + 0x6c, 0x85, 0x42, 0xef, 0xb1, 0xd4, 0xae, 0x32, + 0x88, 0x73, 0x1a, 0x59, 0xf9, 0xe5, 0x4b, 0x1c, + 0xc0, 0x32, 0x07, 0x78, 0xaf, 0x09, 0xfd, 0x15, + 0x3e, 0xad, 0x9d, 0x8a, 0xa5, 0x0f, 0xd4, 0x66, + + }, + .len = 124, + }, + .iv = { + .data = { + 0x34, 0x12, 0x67, 0x45, 0xff, 0xff, 0x00, 0x00, + }, + }, + + .ipsec_xform = { + .spi = 52, + .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_DES_CBC, + .key.length = 8, + .iv.length = 8, + }, + }, + .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 = { @@ -1060,6 +1715,227 @@ struct ipsec_test_data pkt_aes_128_cbc_hmac_sha256_v6 = { }, }; +struct ipsec_test_data pkt_3des_cbc_hmac_sha256_v6 = { + .key = { + .data = { + 0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2, + 0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A, + 0x00, 0x04, 0x05, 0x01, 0x23, 0x00, 0x00, 0x00, + }, + }, + .auth_key = { + .data = { + 0xde, 0x34, 0x56, 0x00, 0x00, 0x00, 0x78, 0x00, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x10, 0x30, 0x40, 0x00, 0x01, 0x02, 0x03, 0x04, + 0x0a, 0x0b, 0x0c, 0x0d, 0x05, 0x06, 0x07, 0x08, + }, + }, + .input_text = { + .data = { + 0x60, 0x00, 0x00, 0x00, 0x00, 0x20, 0x06, 0x38, + 0x26, 0x07, 0xf8, 0xb0, 0x40, 0x0c, 0x0c, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, + 0x20, 0x01, 0x04, 0x70, 0xe5, 0xbf, 0xde, 0xad, + 0x49, 0x57, 0x21, 0x74, 0xe8, 0x2c, 0x48, 0x87, + 0x00, 0x19, 0xf9, 0xc7, 0x95, 0x63, 0x97, 0x9c, + 0x03, 0xa0, 0x88, 0x31, 0x80, 0x12, 0xa7, 0xd6, + 0x25, 0x83, 0x00, 0x00, 0x02, 0x04, 0x05, 0x6a, + 0x01, 0x01, 0x04, 0x02, 0x01, 0x03, 0x03, 0x07, + }, + .len = 72, + }, + .output_text = { + .data = { + /* IP - outer header */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x70, 0x32, 0x40, + 0x0c, 0x03, 0x40, 0x0c, 0xf8, 0xb0, 0x26, 0x07, + 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xde, 0xad, 0xe5, 0xbf, 0x04, 0x70, 0x20, 0x01, + 0x48, 0x87, 0xe8, 0x2c, 0x21, 0x74, 0x49, 0x57, + + /* ESP */ + 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x01, + + /* IV */ + 0x34, 0x12, 0x67, 0x45, 0xff, 0xff, 0x00, 0x00, + + /* Data */ + 0xf9, 0x99, 0x5b, 0x32, 0xfc, 0x7d, 0x0f, 0xcb, + 0x25, 0x0c, 0x9f, 0x11, 0xc5, 0xc7, 0x5e, 0x46, + 0x1d, 0x01, 0x2f, 0xd5, 0xb3, 0x6b, 0x02, 0x30, + 0x8a, 0x0c, 0x85, 0xa9, 0xca, 0x87, 0x6f, 0x17, + 0x3f, 0xb0, 0x03, 0x6c, 0xa5, 0x16, 0x1d, 0x1e, + 0x67, 0x5e, 0x70, 0x1a, 0x76, 0xe7, 0x12, 0x0e, + 0x19, 0x2b, 0x5d, 0xe3, 0x4c, 0x51, 0xb3, 0x3a, + 0x1b, 0x7e, 0xd0, 0x21, 0x76, 0x44, 0xcd, 0xb0, + 0xe8, 0x6d, 0xe3, 0x92, 0xad, 0xa1, 0xad, 0x26, + 0x9c, 0xec, 0x2a, 0x65, 0x51, 0xd4, 0xa4, 0xa9, + 0x97, 0x5b, 0x1e, 0xdd, 0x24, 0x47, 0x16, 0x3a, + 0x2d, 0xf3, 0x80, 0x50, 0xd5, 0xbd, 0x4a, 0x98, + }, + .len = 152, + }, + .iv = { + .data = { + 0x34, 0x12, 0x67, 0x45, 0xff, 0xff, 0x00, 0x00, + }, + }, + + .ipsec_xform = { + .spi = 52, + .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_IPV6, + .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_3DES_CBC, + .key.length = 24, + .iv.length = 8, + }, + }, + .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_des_cbc_hmac_sha256_v6 = { + .key = { + .data = { + 0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A, + }, + }, + .auth_key = { + .data = { + 0xde, 0x34, 0x56, 0x00, 0x00, 0x00, 0x78, 0x00, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x10, 0x30, 0x40, 0x00, 0x01, 0x02, 0x03, 0x04, + 0x0a, 0x0b, 0x0c, 0x0d, 0x05, 0x06, 0x07, 0x08, + }, + }, + .input_text = { + .data = { + 0x60, 0x00, 0x00, 0x00, 0x00, 0x20, 0x06, 0x38, + 0x26, 0x07, 0xf8, 0xb0, 0x40, 0x0c, 0x0c, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, + 0x20, 0x01, 0x04, 0x70, 0xe5, 0xbf, 0xde, 0xad, + 0x49, 0x57, 0x21, 0x74, 0xe8, 0x2c, 0x48, 0x87, + 0x00, 0x19, 0xf9, 0xc7, 0x95, 0x63, 0x97, 0x9c, + 0x03, 0xa0, 0x88, 0x31, 0x80, 0x12, 0xa7, 0xd6, + 0x25, 0x83, 0x00, 0x00, 0x02, 0x04, 0x05, 0x6a, + 0x01, 0x01, 0x04, 0x02, 0x01, 0x03, 0x03, 0x07, + }, + .len = 72, + }, + .output_text = { + .data = { + /* IP - outer header */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x70, 0x32, 0x40, + 0x0c, 0x03, 0x40, 0x0c, 0xf8, 0xb0, 0x26, 0x07, + 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xde, 0xad, 0xe5, 0xbf, 0x04, 0x70, 0x20, 0x01, + 0x48, 0x87, 0xe8, 0x2c, 0x21, 0x74, 0x49, 0x57, + + /* ESP */ + 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x01, + + /* IV */ + 0x34, 0x12, 0x67, 0x45, 0xff, 0xff, 0x00, 0x00, + + /* Data */ + 0x6e, 0xf8, 0x1e, 0x91, 0x77, 0x7f, 0x61, 0x77, + 0xcd, 0x1a, 0x9d, 0xb4, 0x4c, 0xf8, 0x9a, 0x89, + 0xa7, 0x7a, 0xf8, 0x2a, 0x2e, 0x54, 0xa5, 0x0a, + 0xe3, 0x60, 0xb9, 0x21, 0xe1, 0xc6, 0x7f, 0x56, + 0x92, 0x76, 0xc3, 0x33, 0x95, 0x93, 0x0d, 0xb8, + 0xce, 0xb9, 0x0e, 0x32, 0xe6, 0xf1, 0x86, 0x81, + 0x73, 0xc9, 0x62, 0x2e, 0x5d, 0x9b, 0xb4, 0xd5, + 0x68, 0xda, 0xb1, 0x87, 0x78, 0x22, 0xc0, 0x9a, + 0x1c, 0xa1, 0x53, 0x1b, 0x67, 0xea, 0x6d, 0x58, + 0x1a, 0xd8, 0xc3, 0x95, 0xa0, 0xc3, 0x7a, 0xb6, + 0xfe, 0xb1, 0x49, 0xa8, 0xad, 0x1a, 0x21, 0xc2, + 0x01, 0x42, 0xa6, 0xf2, 0x3d, 0x7f, 0xb0, 0x6d, + + }, + .len = 152, + }, + .iv = { + .data = { + 0x34, 0x12, 0x67, 0x45, 0xff, 0xff, 0x00, 0x00, + }, + }, + + .ipsec_xform = { + .spi = 58, + .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_IPV6, + .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_DES_CBC, + .key.length = 8, + .iv.length = 8, + }, + }, + .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_gcm_frag = { .key = { .data = { diff --git a/app/test/test_security_inline_proto.c b/app/test/test_security_inline_proto.c index 19297d3628..289778d9be 100644 --- a/app/test/test_security_inline_proto.c +++ b/app/test/test_security_inline_proto.c @@ -63,6 +63,14 @@ extern struct ipsec_test_data pkt_aes_128_cbc_null; extern struct ipsec_test_data pkt_null_aes_xcbc; extern struct ipsec_test_data pkt_aes_128_cbc_hmac_sha384; extern struct ipsec_test_data pkt_aes_128_cbc_hmac_sha512; +extern struct ipsec_test_data pkt_3des_cbc_hmac_sha256; +extern struct ipsec_test_data pkt_3des_cbc_hmac_sha384; +extern struct ipsec_test_data pkt_3des_cbc_hmac_sha512; +extern struct ipsec_test_data pkt_3des_cbc_hmac_sha256_v6; +extern struct ipsec_test_data pkt_des_cbc_hmac_sha256; +extern struct ipsec_test_data pkt_des_cbc_hmac_sha384; +extern struct ipsec_test_data pkt_des_cbc_hmac_sha512; +extern struct ipsec_test_data pkt_des_cbc_hmac_sha256_v6; static struct rte_mempool *mbufpool; static struct rte_mempool *sess_pool; @@ -2584,6 +2592,21 @@ static struct unit_test_suite inline_ipsec_testsuite = { ut_setup_inline_ipsec, ut_teardown_inline_ipsec, test_ipsec_inline_proto_known_vec, &pkt_aes_128_cbc_hmac_sha512), + TEST_CASE_NAMED_WITH_DATA( + "Outbound known vector (ESP tunnel mode IPv4 3DES-CBC HMAC-SHA256 [16B ICV])", + ut_setup_inline_ipsec, ut_teardown_inline_ipsec, + test_ipsec_inline_proto_known_vec, + &pkt_3des_cbc_hmac_sha256), + TEST_CASE_NAMED_WITH_DATA( + "Outbound known vector (ESP tunnel mode IPv4 3DES-CBC HMAC-SHA384 [24B ICV])", + ut_setup_inline_ipsec, ut_teardown_inline_ipsec, + test_ipsec_inline_proto_known_vec, + &pkt_3des_cbc_hmac_sha384), + TEST_CASE_NAMED_WITH_DATA( + "Outbound known vector (ESP tunnel mode IPv4 3DES-CBC HMAC-SHA512 [32B ICV])", + ut_setup_inline_ipsec, ut_teardown_inline_ipsec, + test_ipsec_inline_proto_known_vec, + &pkt_3des_cbc_hmac_sha512), TEST_CASE_NAMED_WITH_DATA( "Outbound known vector (ESP tunnel mode IPv6 AES-GCM 128)", ut_setup_inline_ipsec, ut_teardown_inline_ipsec, @@ -2593,11 +2616,36 @@ static struct unit_test_suite inline_ipsec_testsuite = { ut_setup_inline_ipsec, ut_teardown_inline_ipsec, test_ipsec_inline_proto_known_vec, &pkt_aes_128_cbc_hmac_sha256_v6), + TEST_CASE_NAMED_WITH_DATA( + "Outbound known vector (ESP tunnel mode IPv6 3DES-CBC HMAC-SHA256 [16B ICV])", + ut_setup_inline_ipsec, ut_teardown_inline_ipsec, + test_ipsec_inline_proto_known_vec, + &pkt_3des_cbc_hmac_sha256_v6), TEST_CASE_NAMED_WITH_DATA( "Outbound known vector (ESP tunnel mode IPv4 NULL AES-XCBC-MAC [12B ICV])", ut_setup_inline_ipsec, ut_teardown_inline_ipsec, test_ipsec_inline_proto_known_vec, &pkt_null_aes_xcbc), + TEST_CASE_NAMED_WITH_DATA( + "Outbound known vector (ESP tunnel mode IPv4 DES-CBC HMAC-SHA256 [16B ICV])", + ut_setup_inline_ipsec, ut_teardown_inline_ipsec, + test_ipsec_inline_proto_known_vec, + &pkt_des_cbc_hmac_sha256), + TEST_CASE_NAMED_WITH_DATA( + "Outbound known vector (ESP tunnel mode IPv4 DES-CBC HMAC-SHA384 [24B ICV])", + ut_setup_inline_ipsec, ut_teardown_inline_ipsec, + test_ipsec_inline_proto_known_vec, + &pkt_des_cbc_hmac_sha384), + TEST_CASE_NAMED_WITH_DATA( + "Outbound known vector (ESP tunnel mode IPv4 DES-CBC HMAC-SHA512 [32B ICV])", + ut_setup_inline_ipsec, ut_teardown_inline_ipsec, + test_ipsec_inline_proto_known_vec, + &pkt_des_cbc_hmac_sha512), + TEST_CASE_NAMED_WITH_DATA( + "Outbound known vector (ESP tunnel mode IPv6 DES-CBC HMAC-SHA256 [16B ICV])", + ut_setup_inline_ipsec, ut_teardown_inline_ipsec, + test_ipsec_inline_proto_known_vec, + &pkt_des_cbc_hmac_sha256_v6), TEST_CASE_NAMED_WITH_DATA( "Outbound fragmented packet", @@ -2636,6 +2684,21 @@ static struct unit_test_suite inline_ipsec_testsuite = { ut_setup_inline_ipsec, ut_teardown_inline_ipsec, test_ipsec_inline_proto_known_vec_inb, &pkt_aes_128_cbc_hmac_sha512), + TEST_CASE_NAMED_WITH_DATA( + "Inbound known vector (ESP tunnel mode IPv4 3DES-CBC HMAC-SHA256 [16B ICV])", + ut_setup_inline_ipsec, ut_teardown_inline_ipsec, + test_ipsec_inline_proto_known_vec_inb, + &pkt_3des_cbc_hmac_sha256), + TEST_CASE_NAMED_WITH_DATA( + "Inbound known vector (ESP tunnel mode IPv4 3DES-CBC HMAC-SHA384 [24B ICV])", + ut_setup_inline_ipsec, ut_teardown_inline_ipsec, + test_ipsec_inline_proto_known_vec_inb, + &pkt_3des_cbc_hmac_sha384), + TEST_CASE_NAMED_WITH_DATA( + "Inbound known vector (ESP tunnel mode IPv4 3DES-CBC HMAC-SHA512 [32B ICV])", + ut_setup_inline_ipsec, ut_teardown_inline_ipsec, + test_ipsec_inline_proto_known_vec_inb, + &pkt_3des_cbc_hmac_sha512), TEST_CASE_NAMED_WITH_DATA( "Inbound known vector (ESP tunnel mode IPv6 AES-GCM 128)", ut_setup_inline_ipsec, ut_teardown_inline_ipsec, @@ -2645,11 +2708,37 @@ static struct unit_test_suite inline_ipsec_testsuite = { ut_setup_inline_ipsec, ut_teardown_inline_ipsec, test_ipsec_inline_proto_known_vec_inb, &pkt_aes_128_cbc_hmac_sha256_v6), + TEST_CASE_NAMED_WITH_DATA( + "Inbound known vector (ESP tunnel mode IPv6 3DES-CBC HMAC-SHA256 [16B ICV])", + ut_setup_inline_ipsec, ut_teardown_inline_ipsec, + test_ipsec_inline_proto_known_vec_inb, + &pkt_3des_cbc_hmac_sha256_v6), TEST_CASE_NAMED_WITH_DATA( "Inbound known vector (ESP tunnel mode IPv4 NULL AES-XCBC-MAC [12B ICV])", ut_setup_inline_ipsec, ut_teardown_inline_ipsec, test_ipsec_inline_proto_known_vec_inb, &pkt_null_aes_xcbc), + TEST_CASE_NAMED_WITH_DATA( + "Inbound known vector (ESP tunnel mode IPv4 DES-CBC HMAC-SHA256 [16B ICV])", + ut_setup_inline_ipsec, ut_teardown_inline_ipsec, + test_ipsec_inline_proto_known_vec_inb, + &pkt_des_cbc_hmac_sha256), + TEST_CASE_NAMED_WITH_DATA( + "Inbound known vector (ESP tunnel mode IPv4 DES-CBC HMAC-SHA384 [24B ICV])", + ut_setup_inline_ipsec, ut_teardown_inline_ipsec, + test_ipsec_inline_proto_known_vec_inb, + &pkt_des_cbc_hmac_sha384), + TEST_CASE_NAMED_WITH_DATA( + "Inbound known vector (ESP tunnel mode IPv4 DES-CBC HMAC-SHA512 [32B ICV])", + ut_setup_inline_ipsec, ut_teardown_inline_ipsec, + test_ipsec_inline_proto_known_vec_inb, + &pkt_des_cbc_hmac_sha512), + TEST_CASE_NAMED_WITH_DATA( + "Inbound known vector (ESP tunnel mode IPv6 DES-CBC HMAC-SHA256 [16B ICV])", + ut_setup_inline_ipsec, ut_teardown_inline_ipsec, + test_ipsec_inline_proto_known_vec_inb, + &pkt_des_cbc_hmac_sha256_v6), + TEST_CASE_NAMED_ST( "Combined test alg list", -- 2.25.1