diff mbox series

[API-NEXT,v5,9/9] fixup! test: validation: add IPsec API testsuite

Message ID 1500908444-7531-10-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v5,1/9] linux-gen: pktio: loop: support IPsec outbound inline | expand

Commit Message

Github ODP bot July 24, 2017, 3 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 81 (lumag:ipsec-packet-impl-2)
 ** https://github.com/Linaro/odp/pull/81
 ** Patch: https://github.com/Linaro/odp/pull/81.patch
 ** Base sha: db7cc41aeb559dd296f3a6d8570aa10326a31d5e
 ** Merge commit sha: ba0b39db1fc90b24a3db1e85e00c2c485b235a47
 **/
 test/common_plat/validation/api/ipsec/ipsec.c      |  2 ++
 .../validation/api/ipsec/test_vectors.h            | 24 ++++++++++++++++++++++
 2 files changed, 26 insertions(+)
diff mbox series

Patch

diff --git a/test/common_plat/validation/api/ipsec/ipsec.c b/test/common_plat/validation/api/ipsec/ipsec.c
index 910901d6..361869ea 100644
--- a/test/common_plat/validation/api/ipsec/ipsec.c
+++ b/test/common_plat/validation/api/ipsec/ipsec.c
@@ -354,9 +354,11 @@  odp_bool_t ipsec_check_packet(const ipsec_test_packet *itp, odp_packet_t pkt)
 	l4 = odp_packet_l4_offset(pkt);
 	odp_packet_copy_to_mem(pkt, 0, len, data);
 
+	CU_ASSERT_EQUAL(len - l3, itp->len - itp->l3_offset);
 	if (len - l3 != itp->len - itp->l3_offset)
 		return false;
 
+	CU_ASSERT_EQUAL(l4 - l3, itp->l4_offset - itp->l3_offset);
 	if (l4 - l3 != itp->l4_offset - itp->l3_offset)
 		return false;
 
diff --git a/test/common_plat/validation/api/ipsec/test_vectors.h b/test/common_plat/validation/api/ipsec/test_vectors.h
index facd0636..623949d0 100644
--- a/test/common_plat/validation/api/ipsec/test_vectors.h
+++ b/test/common_plat/validation/api/ipsec/test_vectors.h
@@ -31,6 +31,8 @@  KEY(key_rfc3602, 0x90, 0xd3, 0x82, 0xb4, 0x10, 0xee, 0xba, 0x7a,
 		 0xd9, 0x38, 0xc4, 0x6c, 0xec, 0x1a, 0x82, 0xbf);
 KEY(key_rfc3602_2, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
 		   0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef);
+KEY(key_mcgrew_gcm_test_1, 0x4c, 0x80, 0xcd, 0xef, 0xbb, 0x5d, 0x10, 0xda,
+			   0x90, 0x6a, 0xc7, 0x3c, 0x36, 0x13, 0xa6, 0x34);
 
 static const ODP_UNUSED ipsec_test_packet pkt_icmp_0 = {
 	.len = 142,
@@ -725,4 +727,26 @@  static const ipsec_test_packet pkt_rfc3602_8_esp = {
 	},
 };
 
+static const ipsec_test_packet pkt_mcgrew_gcm_test_1 = {
+	.len = 72,
+	.l2_offset = ODP_PACKET_OFFSET_INVALID,
+	.l3_offset = 0,
+	.l4_offset = 20,
+	.data = {
+		/* IP */
+		0x45, 0x00, 0x00, 0x48, 0x69, 0x9a, 0x00, 0x00,
+		0x80, 0x11, 0x4d, 0xb7, 0xc0, 0xa8, 0x01, 0x02,
+		0xc0, 0xa8, 0x01, 0x01,
+
+		/* UDP */
+		0x0a, 0x9b, 0xf1, 0x56, 0x38, 0xd3, 0x01, 0x00,
+		0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x04, 0x5f, 0x73, 0x69, 0x70, 0x04, 0x5f, 0x75,
+		0x64, 0x70, 0x03, 0x73, 0x69, 0x70, 0x09, 0x63,
+		0x79, 0x62, 0x65, 0x72, 0x63, 0x69, 0x74, 0x79,
+		0x02, 0x64, 0x6b, 0x00, 0x00, 0x21, 0x00, 0x01,
+		0x01, 0x02, 0x02, 0x01,
+	},
+};
+
 #endif