[API-NEXT,v2,11/15] validation: ipsec: add L3/L4 types validation

Message ID 1519236011-14987-12-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • [API-NEXT,v2,1/15] api: don't create special case for the tunnel-dummy packets
Related show

Commit Message

Github ODP bot Feb. 21, 2018, 6 p.m.
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


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

---
/** Email created from pull request 494 (lumag:ipsec-tfc-imp)
 ** https://github.com/Linaro/odp/pull/494
 ** Patch: https://github.com/Linaro/odp/pull/494.patch
 ** Base sha: ea2afab619ae74108a03798bc358fdfcd29fdd88
 ** Merge commit sha: 0b6ae2680a00027c3958ebcafbbcf92642a68f5e
 **/
 test/validation/api/ipsec/ipsec.c          |   8 ++
 test/validation/api/ipsec/ipsec.h          |   5 ++
 test/validation/api/ipsec/ipsec_test_in.c  | 128 ++++++++++++++++++++++++++++-
 test/validation/api/ipsec/ipsec_test_out.c |  10 +++
 test/validation/api/ipsec/test_vectors.h   |  19 ++++-
 5 files changed, 165 insertions(+), 5 deletions(-)

Patch

diff --git a/test/validation/api/ipsec/ipsec.c b/test/validation/api/ipsec/ipsec.c
index 31bd557fe..6043debf9 100644
--- a/test/validation/api/ipsec/ipsec.c
+++ b/test/validation/api/ipsec/ipsec.c
@@ -689,6 +689,14 @@  void ipsec_check_in_one(const ipsec_test_part *part, odp_ipsec_sa_t sa)
 		}
 		ipsec_check_packet(part->out[i].pkt_out,
 				   pkto[i]);
+		if (part->out[i].pkt_out != NULL &&
+		    part->out[i].l3_type != _ODP_PROTO_L3_TYPE_UNDEF)
+			CU_ASSERT_EQUAL(part->out[i].l3_type,
+					odp_packet_l3_type(pkto[i]));
+		if (part->out[i].pkt_out != NULL &&
+		    part->out[i].l4_type != _ODP_PROTO_L4_TYPE_UNDEF)
+			CU_ASSERT_EQUAL(part->out[i].l4_type,
+					odp_packet_l4_type(pkto[i]));
 		odp_packet_free(pkto[i]);
 	}
 }
diff --git a/test/validation/api/ipsec/ipsec.h b/test/validation/api/ipsec/ipsec.h
index 7ba9ef10e..b2d6df698 100644
--- a/test/validation/api/ipsec/ipsec.h
+++ b/test/validation/api/ipsec/ipsec.h
@@ -42,6 +42,9 @@  typedef struct {
 	uint8_t data[256];
 } ipsec_test_packet;
 
+#define _ODP_PROTO_L3_TYPE_UNDEF ((odp_proto_l3_type_t)-1)
+#define _ODP_PROTO_L4_TYPE_UNDEF ((odp_proto_l4_type_t)-1)
+
 typedef struct {
 	const ipsec_test_packet *pkt_in;
 	odp_bool_t lookup;
@@ -51,6 +54,8 @@  typedef struct {
 	struct {
 		odp_ipsec_op_status_t status;
 		const ipsec_test_packet *pkt_out;
+		odp_proto_l3_type_t l3_type;
+		odp_proto_l4_type_t l4_type;
 	} out[1];
 } ipsec_test_part;
 
diff --git a/test/validation/api/ipsec/ipsec_test_in.c b/test/validation/api/ipsec/ipsec_test_in.c
index 8138defb5..9c1112004 100644
--- a/test/validation/api/ipsec/ipsec_test_in.c
+++ b/test/validation/api/ipsec/ipsec_test_in.c
@@ -31,6 +31,8 @@  static void test_in_ipv4_ah_sha256(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -62,6 +64,8 @@  static void test_in_ipv4_ah_sha256_tun_ipv4(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -93,6 +97,8 @@  static void test_in_ipv4_ah_sha256_tun_ipv6(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -123,6 +129,9 @@  static void test_in_ipv4_ah_sha256_tun_ipv4_notun(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  /* It is L4_TYPE_IPV4 */
+			  .l4_type = _ODP_PROTO_L4_TYPE_UNDEF,
 			  .pkt_out = &pkt_ipv4_icmp_0_ipip },
 		},
 	};
@@ -153,6 +162,8 @@  static void test_in_ipv4_esp_null_sha256(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -183,6 +194,8 @@  static void test_in_ipv4_esp_aes_cbc_null(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -213,6 +226,8 @@  static void test_in_ipv4_esp_aes_cbc_sha256(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -243,6 +258,8 @@  static void test_in_ipv4_esp_aes_ctr_null(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -274,6 +291,8 @@  static void test_in_ipv4_ah_sha256_lookup(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -305,6 +324,8 @@  static void test_in_ipv4_esp_null_sha256_lookup(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -336,6 +357,8 @@  static void test_in_ipv4_esp_null_sha256_tun_ipv4(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -367,6 +390,8 @@  static void test_in_ipv4_esp_null_sha256_tun_ipv6(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -398,6 +423,8 @@  static void test_in_ipv4_esp_udp_null_sha256(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -430,6 +457,8 @@  static void test_in_ipv4_esp_udp_null_sha256_lookup(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -461,6 +490,8 @@  static void test_in_ipv4_ah_sha256_noreplay(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -471,6 +502,8 @@  static void test_in_ipv4_ah_sha256_noreplay(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -505,6 +538,8 @@  static void test_in_ipv4_ah_sha256_replay(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -525,6 +560,8 @@  static void test_in_ipv4_ah_sha256_replay(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -559,6 +596,8 @@  static void test_in_ipv4_esp_null_sha256_noreplay(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -569,6 +608,8 @@  static void test_in_ipv4_esp_null_sha256_noreplay(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -603,6 +644,8 @@  static void test_in_ipv4_esp_null_sha256_replay(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -623,6 +666,8 @@  static void test_in_ipv4_esp_null_sha256_replay(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -878,6 +923,8 @@  static void test_in_ipv4_rfc3602_5_esp(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_rfc3602_5 },
 		},
 	};
@@ -908,6 +955,8 @@  static void test_in_ipv4_rfc3602_6_esp(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_rfc3602_6 },
 		},
 	};
@@ -939,6 +988,8 @@  static void test_in_ipv4_rfc3602_7_esp(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_rfc3602_7 },
 		},
 	};
@@ -970,6 +1021,8 @@  static void test_in_ipv4_rfc3602_8_esp(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_rfc3602_8 },
 		},
 	};
@@ -1001,6 +1054,8 @@  static void test_in_ipv4_mcgrew_gcm_2_esp(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_UDP,
 			  .pkt_out = &pkt_mcgrew_gcm_test_2},
 		},
 	};
@@ -1032,6 +1087,8 @@  static void test_in_ipv4_mcgrew_gcm_3_esp(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = _ODP_PROTO_L4_TYPE_UNDEF,
 			  .pkt_out = &pkt_mcgrew_gcm_test_3},
 		},
 	};
@@ -1063,6 +1120,8 @@  static void test_in_ipv4_mcgrew_gcm_4_esp(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_mcgrew_gcm_test_4},
 		},
 	};
@@ -1072,13 +1131,17 @@  static void test_in_ipv4_mcgrew_gcm_4_esp(void)
 	ipsec_sa_destroy(sa);
 }
 
-#if 0
 static void test_in_ipv4_mcgrew_gcm_12_esp(void)
 {
 	odp_ipsec_tunnel_param_t tunnel = {};
 	odp_ipsec_sa_param_t param;
 	odp_ipsec_sa_t sa;
 
+	/* This test will not work properly inbound inline mode.
+	 * Packet might be dropped and we will not check for that. */
+	if (suite_context.inbound_op_mode == ODP_IPSEC_OP_MODE_INLINE)
+		return;
+
 	ipsec_sa_param_fill(&param,
 			    true, false, 0x335467ae, &tunnel,
 			    ODP_CIPHER_ALG_AES_GCM, &key_mcgrew_gcm_12,
@@ -1095,6 +1158,8 @@  static void test_in_ipv4_mcgrew_gcm_12_esp(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_NONE,
+			  .l4_type = _ODP_PROTO_L4_TYPE_UNDEF,
 			  .pkt_out = &pkt_mcgrew_gcm_test_12},
 		},
 	};
@@ -1103,7 +1168,38 @@  static void test_in_ipv4_mcgrew_gcm_12_esp(void)
 
 	ipsec_sa_destroy(sa);
 }
-#endif
+
+static void test_in_ipv4_mcgrew_gcm_12_esp_notun(void)
+{
+	odp_ipsec_sa_param_t param;
+	odp_ipsec_sa_t sa;
+
+	ipsec_sa_param_fill(&param,
+			    true, false, 0x335467ae, NULL,
+			    ODP_CIPHER_ALG_AES_GCM, &key_mcgrew_gcm_12,
+			    ODP_AUTH_ALG_AES_GCM, NULL,
+			    &key_mcgrew_gcm_salt_12);
+
+	sa = odp_ipsec_sa_create(&param);
+
+	CU_ASSERT_NOT_EQUAL_FATAL(ODP_IPSEC_SA_INVALID, sa);
+
+	ipsec_test_part test = {
+		.pkt_in = &pkt_mcgrew_gcm_test_12_esp,
+		.out_pkt = 1,
+		.out = {
+			{ .status.warn.all = 0,
+			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_NO_NEXT,
+			  .pkt_out = &pkt_mcgrew_gcm_test_12_notun },
+		},
+	};
+
+	ipsec_check_in_one(&test, sa);
+
+	ipsec_sa_destroy(sa);
+}
 
 static void test_in_ipv4_mcgrew_gcm_15_esp(void)
 {
@@ -1127,6 +1223,8 @@  static void test_in_ipv4_mcgrew_gcm_15_esp(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_mcgrew_gcm_test_15},
 		},
 	};
@@ -1158,6 +1256,8 @@  static void test_in_ipv4_rfc7634_chacha(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_rfc7634},
 		},
 	};
@@ -1188,6 +1288,8 @@  static void test_in_ipv4_ah_aes_gmac_128(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -1218,6 +1320,8 @@  static void test_in_ipv4_esp_null_aes_gmac_128(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -1248,6 +1352,8 @@  static void test_in_ipv6_ah_sha256(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV6,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV6,
 			  .pkt_out = &pkt_ipv6_icmp_0 },
 		},
 	};
@@ -1279,6 +1385,8 @@  static void test_in_ipv6_ah_sha256_tun_ipv4(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV6,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV6,
 			  .pkt_out = &pkt_ipv6_icmp_0 },
 		},
 	};
@@ -1310,6 +1418,8 @@  static void test_in_ipv6_ah_sha256_tun_ipv6(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV6,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV6,
 			  .pkt_out = &pkt_ipv6_icmp_0 },
 		},
 	};
@@ -1340,6 +1450,8 @@  static void test_in_ipv6_esp_null_sha256(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV6,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV6,
 			  .pkt_out = &pkt_ipv6_icmp_0 },
 		},
 	};
@@ -1371,6 +1483,8 @@  static void test_in_ipv6_esp_null_sha256_tun_ipv4(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV6,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV6,
 			  .pkt_out = &pkt_ipv6_icmp_0 },
 		},
 	};
@@ -1402,6 +1516,8 @@  static void test_in_ipv6_esp_null_sha256_tun_ipv6(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV6,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV6,
 			  .pkt_out = &pkt_ipv6_icmp_0 },
 		},
 	};
@@ -1433,6 +1549,8 @@  static void test_in_ipv6_esp_udp_null_sha256(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV6,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV6,
 			  .pkt_out = &pkt_ipv6_icmp_0 },
 		},
 	};
@@ -1465,6 +1583,8 @@  static void test_in_ipv6_esp_udp_null_sha256_lookup(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV6,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV6,
 			  .pkt_out = &pkt_ipv6_icmp_0 },
 		},
 	};
@@ -1499,10 +1619,10 @@  odp_testinfo_t ipsec_in_suite[] = {
 				  ipsec_check_esp_aes_gcm_256),
 	ODP_TEST_INFO_CONDITIONAL(test_in_ipv4_mcgrew_gcm_4_esp,
 				  ipsec_check_esp_aes_gcm_128),
-#if 0
 	ODP_TEST_INFO_CONDITIONAL(test_in_ipv4_mcgrew_gcm_12_esp,
 				  ipsec_check_esp_aes_gcm_128),
-#endif
+	ODP_TEST_INFO_CONDITIONAL(test_in_ipv4_mcgrew_gcm_12_esp_notun,
+				  ipsec_check_esp_aes_gcm_128),
 	ODP_TEST_INFO_CONDITIONAL(test_in_ipv4_mcgrew_gcm_15_esp,
 				  ipsec_check_esp_null_aes_gmac_128),
 	ODP_TEST_INFO_CONDITIONAL(test_in_ipv4_rfc7634_chacha,
diff --git a/test/validation/api/ipsec/ipsec_test_out.c b/test/validation/api/ipsec/ipsec_test_out.c
index 911987388..3db553b60 100644
--- a/test/validation/api/ipsec/ipsec_test_out.c
+++ b/test/validation/api/ipsec/ipsec_test_out.c
@@ -273,6 +273,8 @@  static void test_out_ipv4_esp_aes_cbc_null(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -346,6 +348,8 @@  static void test_out_ipv4_esp_aes_cbc_sha256(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -388,6 +392,8 @@  static void test_out_ipv4_esp_aes_ctr_null(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -430,6 +436,8 @@  static void test_out_ipv4_esp_aes_gcm128(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
@@ -532,6 +540,8 @@  static void test_out_ipv4_esp_chacha20_poly1305(void)
 		.out = {
 			{ .status.warn.all = 0,
 			  .status.error.all = 0,
+			  .l3_type = ODP_PROTO_L3_TYPE_IPV4,
+			  .l4_type = ODP_PROTO_L4_TYPE_ICMPV4,
 			  .pkt_out = &pkt_ipv4_icmp_0 },
 		},
 	};
diff --git a/test/validation/api/ipsec/test_vectors.h b/test/validation/api/ipsec/test_vectors.h
index f14fdb2b3..4d5ab3bdc 100644
--- a/test/validation/api/ipsec/test_vectors.h
+++ b/test/validation/api/ipsec/test_vectors.h
@@ -1641,7 +1641,7 @@  static const ipsec_test_packet pkt_mcgrew_gcm_test_4_esp = {
 static const ipsec_test_packet pkt_mcgrew_gcm_test_12 = {
 	.len = 14,
 	.l2_offset = 0,
-	.l3_offset = ODP_PACKET_OFFSET_INVALID,
+	.l3_offset = 14,
 	.l4_offset = ODP_PACKET_OFFSET_INVALID,
 	.data = {
 		/* ETH - not a part of RFC, added for simplicity */
@@ -1650,6 +1650,23 @@  static const ipsec_test_packet pkt_mcgrew_gcm_test_12 = {
 	},
 };
 
+static const ipsec_test_packet pkt_mcgrew_gcm_test_12_notun = {
+	.len = 34,
+	.l2_offset = 0,
+	.l3_offset = 14,
+	.l4_offset = 34,
+	.data = {
+		/* ETH - not a part of RFC, added for simplicity */
+		0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1,
+		0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0x08, 0x00,
+
+		/* IP - not a part of RFC, added for simplicity */
+		0x45, 0x00, 0x00, 0x14, 0x69, 0x8f, 0x00, 0x00,
+		0x80, 0x3b, 0x4d, 0xcc, 0xc0, 0xa8, 0x01, 0x02,
+		0xc0, 0xa8, 0x01, 0x01,
+	},
+};
+
 static const ipsec_test_packet pkt_mcgrew_gcm_test_12_esp = {
 	.len = 70,
 	.l2_offset = 0,