@@ -937,13 +937,7 @@ static void do_roundtrip_cbc_hmac(uint8_t *enc_key, uint8_t enc_key_len,
937937 /* --- Wrap --- */
938938 ret = esp_transport_wrap (ip , & ip_len );
939939 ck_assert_int_eq (ret , 0 );
940-
941- /* esp_send normally fixes these up; we must do it manually. */
942940 frame_len = (uint32_t )ip_len + ETH_HEADER_LEN ;
943- ip -> proto = 0x32U ; /* IP proto = ESP */
944- ip -> len = ee16 (ip_len );
945- ip -> csum = 0U ;
946- iphdr_set_checksum (ip );
947941
948942 /* --- Unwrap --- */
949943 ret = esp_transport_unwrap (ip , & frame_len );
@@ -1047,12 +1041,7 @@ START_TEST(test_roundtrip_des3_sha256)
10471041
10481042 ret = esp_transport_wrap (ip , & ip_len );
10491043 ck_assert_int_eq (ret , 0 );
1050-
10511044 frame_len = (uint32_t )ip_len + ETH_HEADER_LEN ;
1052- ip -> proto = 0x32U ;
1053- ip -> len = ee16 (ip_len );
1054- ip -> csum = 0U ;
1055- iphdr_set_checksum (ip );
10561045
10571046 ret = esp_transport_unwrap (ip , & frame_len );
10581047 ck_assert_int_eq (ret , 0 );
@@ -1099,12 +1088,7 @@ START_TEST(test_roundtrip_aes_gcm_rfc4106)
10991088
11001089 ret = esp_transport_wrap (ip , & ip_len );
11011090 ck_assert_int_eq (ret , 0 );
1102-
11031091 frame_len = (uint32_t )ip_len + ETH_HEADER_LEN ;
1104- ip -> proto = 0x32U ;
1105- ip -> len = ee16 (ip_len );
1106- ip -> csum = 0U ;
1107- iphdr_set_checksum (ip );
11081092
11091093 ret = esp_transport_unwrap (ip , & frame_len );
11101094 ck_assert_int_eq (ret , 0 );
@@ -1149,12 +1133,7 @@ START_TEST(test_roundtrip_aes_gmac_rfc4543)
11491133
11501134 ret = esp_transport_wrap (ip , & ip_len );
11511135 ck_assert_int_eq (ret , 0 );
1152-
11531136 frame_len = (uint32_t )ip_len + ETH_HEADER_LEN ;
1154- ip -> proto = 0x32U ;
1155- ip -> len = ee16 (ip_len );
1156- ip -> csum = 0U ;
1157- iphdr_set_checksum (ip );
11581137
11591138 ret = esp_transport_unwrap (ip , & frame_len );
11601139 ck_assert_int_eq (ret , 0 );
@@ -1204,12 +1183,7 @@ static void do_icv_tamper(void)
12041183
12051184 ret = esp_transport_wrap (ip , & ip_len );
12061185 ck_assert_int_eq (ret , 0 );
1207-
12081186 frame_len = (uint32_t )ip_len + ETH_HEADER_LEN ;
1209- ip -> proto = 0x32U ;
1210- ip -> len = ee16 (ip_len );
1211- ip -> csum = 0U ;
1212- iphdr_set_checksum (ip );
12131187
12141188 /* esp_len = ip_len - IP_HEADER_LEN. The ICV occupies the last
12151189 * ESP_ICVLEN_HMAC_128 (16) bytes of ip->data[0..esp_len-1]. */
@@ -1264,12 +1238,7 @@ START_TEST(test_ciphertext_tamper_cbc_sha256)
12641238
12651239 ret = esp_transport_wrap (ip , & ip_len );
12661240 ck_assert_int_eq (ret , 0 );
1267-
12681241 frame_len = (uint32_t )ip_len + ETH_HEADER_LEN ;
1269- ip -> proto = 0x32U ;
1270- ip -> len = ee16 (ip_len );
1271- ip -> csum = 0U ;
1272- iphdr_set_checksum (ip );
12731242
12741243 ip -> data [ct_offset ] ^= 0x01U ; /* single bit flip in ciphertext */
12751244
@@ -1364,12 +1333,7 @@ START_TEST(test_ip_recv_esp_transport_delivers_udp_payload)
13641333
13651334 ret = esp_transport_wrap (ip , & ip_len );
13661335 ck_assert_int_eq (ret , 0 );
1367-
13681336 frame_len = (uint32_t )ip_len + ETH_HEADER_LEN ;
1369- ip -> proto = 0x32U ;
1370- ip -> len = ee16 (ip_len );
1371- ip -> csum = 0U ;
1372- iphdr_set_checksum (ip );
13731337
13741338 ip_recv (& s , 0 , ip , frame_len );
13751339
@@ -1413,12 +1377,7 @@ START_TEST(test_ip_recv_esp_transport_unwrap_failure_drops_packet)
14131377
14141378 ret = esp_transport_wrap (ip , & ip_len );
14151379 ck_assert_int_eq (ret , 0 );
1416-
14171380 frame_len = (uint32_t )ip_len + ETH_HEADER_LEN ;
1418- ip -> proto = 0x32U ;
1419- ip -> len = ee16 (ip_len );
1420- ip -> csum = 0U ;
1421- iphdr_set_checksum (ip );
14221381
14231382 esp_len = frame_len - ETH_HEADER_LEN - IP_HEADER_LEN ;
14241383 ip -> data [esp_len - 1U ] ^= 0xFFU ;
0 commit comments