From: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>

Test vectors from draft-mcgrew-gcm-test-01 contain invalid next_header
field in ESP trailers (0x01 = ICMP instead of 0x04 = IPv4). Correct test
vectors. Test 12 is disabled till NoNH packets are properly supported in
a defined way.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
/** Email created from pull request 304 (lumag:ipsec-ipv6-2)
 ** https://github.com/Linaro/odp/pull/304
 ** Patch: https://github.com/Linaro/odp/pull/304.patch
 ** Base sha: 4cb02e1caccb9179575e95448fd46979e17d0905
 ** Merge commit sha: 32adfc64ec5b4cc2948ab55456aeba75ae6816ff
 **/
 test/validation/api/ipsec/ipsec_test_in.c |  4 ++++
 test/validation/api/ipsec/test_vectors.h  | 30 +++++++++++++++---------------
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/test/validation/api/ipsec/ipsec_test_in.c 
b/test/validation/api/ipsec/ipsec_test_in.c
index daafaf69a..5af98112a 100644
--- a/test/validation/api/ipsec/ipsec_test_in.c
+++ b/test/validation/api/ipsec/ipsec_test_in.c
@@ -947,6 +947,7 @@ 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 = {};
@@ -977,6 +978,7 @@ static void test_in_ipv4_mcgrew_gcm_12_esp(void)
 
        ipsec_sa_destroy(sa);
 }
+#endif
 
 static void test_in_ipv4_mcgrew_gcm_15_esp(void)
 {
@@ -1094,8 +1096,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_15_esp,
                                  ipsec_check_esp_null_aes_gmac_128),
        ODP_TEST_INFO_CONDITIONAL(test_in_ipv4_ah_sha256,
diff --git a/test/validation/api/ipsec/test_vectors.h 
b/test/validation/api/ipsec/test_vectors.h
index 51aa97ccb..c057f7765 100644
--- a/test/validation/api/ipsec/test_vectors.h
+++ b/test/validation/api/ipsec/test_vectors.h
@@ -1021,9 +1021,9 @@ static const ipsec_test_packet pkt_mcgrew_gcm_test_2_esp 
= {
                0x3d, 0xe8, 0x18, 0x27, 0xc1, 0x0e, 0x9a, 0x4f,
                0x51, 0x33, 0x0d, 0x0e, 0xec, 0x41, 0x66, 0x42,
                0xcf, 0xbb, 0x85, 0xa5, 0xb4, 0x7e, 0x48, 0xa4,
-               0xec, 0x3b, 0x9b, 0xa9, 0x5d, 0x91, 0x8b, 0xd1,
-               0x83, 0xb7, 0x0d, 0x3a, 0xa8, 0xbc, 0x6e, 0xe4,
-               0xc3, 0x09, 0xe9, 0xd8, 0x5a, 0x41, 0xad, 0x4a,
+               0xec, 0x3b, 0x9b, 0xa9, 0x5d, 0x91, 0x8b, 0xd4,
+               0x26, 0xf8, 0x39, 0x1b, 0x99, 0x27, 0xd0, 0xfc,
+               0xc9, 0x84, 0x56, 0x1b, 0xbb, 0xce, 0x9f, 0xc0,
        },
 };
 
@@ -1078,9 +1078,9 @@ static const ipsec_test_packet pkt_mcgrew_gcm_test_3_esp 
= {
                0x06, 0xef, 0xae, 0x9d, 0x65, 0xa5, 0xd7, 0x63,
                0x74, 0x8a, 0x63, 0x79, 0x85, 0x77, 0x1d, 0x34,
                0x7f, 0x05, 0x45, 0x65, 0x9f, 0x14, 0xe9, 0x9d,
-               0xef, 0x84, 0x2d, 0x8e, 0xb3, 0x35, 0xf4, 0xee,
-               0xcf, 0xdb, 0xf8, 0x31, 0x82, 0x4b, 0x4c, 0x49,
-               0x15, 0x95, 0x6c, 0x96,
+               0xef, 0x84, 0x2d, 0x8b, 0x42, 0xf5, 0x64, 0xf5,
+               0x2d, 0xfd, 0xd6, 0xee, 0xf4, 0xf9, 0x2e, 0xad,
+               0xba, 0xc2, 0x39, 0x90,
        },
 };
 
@@ -1137,9 +1137,9 @@ static const ipsec_test_packet pkt_mcgrew_gcm_test_4_esp 
= {
                0x45, 0x64, 0x76, 0x49, 0x27, 0x19, 0xff, 0xb6,
                0x4d, 0xe7, 0xd9, 0xdc, 0xa1, 0xe1, 0xd8, 0x94,
                0xbc, 0x3b, 0xd5, 0x78, 0x73, 0xed, 0x4d, 0x18,
-               0x1d, 0x19, 0xd4, 0xd5, 0xc8, 0xc1, 0x8a, 0xf3,
-               0xf8, 0x21, 0xd4, 0x96, 0xee, 0xb0, 0x96, 0xe9,
-               0x8a, 0xd2, 0xb6, 0x9e, 0x47, 0x99, 0xc7, 0x1d,
+               0x1d, 0x19, 0xd4, 0xd5, 0xc8, 0xc1, 0x8a, 0xf6,
+               0xfe, 0x1d, 0x73, 0x72, 0x22, 0x8a, 0x69, 0xf4,
+               0x0d, 0xeb, 0x37, 0x3d, 0xdc, 0x01, 0x67, 0x6b,
        },
 };
 
@@ -1177,9 +1177,9 @@ static const ipsec_test_packet pkt_mcgrew_gcm_test_12_esp 
= {
                0x43, 0x45, 0x7e, 0x91, 0x82, 0x44, 0x3b, 0xc6,
 
                /* Data */
-               0x43, 0x7f, 0x86, 0x6b, 0xcb, 0x3f, 0x69, 0x9f,
-               0xe9, 0xb0, 0x82, 0x2b, 0xac, 0x96, 0x1c, 0x45,
-               0x04, 0xbe, 0xf2, 0x70,
+               0x43, 0x7f, 0x86, 0x51, 0x7e, 0xa5, 0x95, 0xd2,
+               0xca, 0x00, 0x4c, 0x33, 0x38, 0x8c, 0x46, 0x77,
+               0x0c, 0x59, 0x0a, 0xd6,
        },
 };
 
@@ -1234,9 +1234,9 @@ static const ipsec_test_packet pkt_mcgrew_gcm_test_15_esp 
= {
                0x02, 0x00, 0x07, 0x00, 0x61, 0x62, 0x63, 0x64,
                0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c,
                0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74,
-               0x01, 0x02, 0x02, 0x01, 0xf2, 0xa9, 0xa8, 0x36,
-               0xe1, 0x55, 0x10, 0x6a, 0xa8, 0xdc, 0xd6, 0x18,
-               0xe4, 0x09, 0x9a, 0xaa,
+               0x01, 0x02, 0x02, 0x04, 0x59, 0x4f, 0x40, 0x55,
+               0x42, 0x8d, 0x39, 0x9a, 0x9d, 0x66, 0xc1, 0x5e,
+               0x77, 0x02, 0x3a, 0x98,
        },
 };
 

Reply via email to