Skip to content

Commit a4ab47d

Browse files
committed
- add esp encapsulation to tcp_send_empty_immediate so pure acks on ipsec
- basedd connections are not sent in plaintext when the tx fifo is full - (and the link layer is being used) - add esp encapsulation to tcp_send_zero_wnd_probe so zero_window probes on ipsec-protected connections are not sent in plaintext - add esp encapsulation to wolfip_forwad_packet so forwarded ip packets - are not sent in plaintext when the egresse interface has esp sa - ocnfigureed - reset sift-sdown cursor to root on each iteration of - timers_binheapp_poop so that skipping cancelled timers does not b reak - the min-heap invariant - send syn-ack immediately in the listen to syn_rcvd transition instead of deferring it until accept() or the ctrl_rto timer fires. - validate arp reply sender ip against broadcast, multicast, zero and own address before caching, matching the existing arp request handler checks - deconfigure the offered ip address when dhcp request retries are exhausted so the device does not keep using unconfirmed lease. - extend multicast classification tests to cover the 225-239 range and boundaries so mask constant mutations are detected - add ssrr source routine drop test to cover 0x89 variant type branch alongside the existing lsrr test - add multicast source address test for ip_recv to cover the wolfip_ip_is_multicast branch of the rfc 1122 source validation - add multicast sender test for arp request validation to cover the wolfip_ip_is_multicast branch of the cache poisoning guard. - add esp encapsulation to tcp_send_reset_reply so rst segments toward esp_protected peers are not sent in plaintext - nclude tcp timestamp option in zero-window probes when timestamps are negotiated, per rfc 7323 (around section 3.2) - process ack+fin segments in syn_rcvd state per rfc 9293 instead of silently discarding non-pure acks. - Compute ICMP TTL exceeded and destination unreachable original packet - quote size from the actual IP header length so packets with IP options - include the full header plus 8 bytes of transport data. - seed ipcounter with a random value at init so ip identification fields on non-df packets are not predictable from zero - set the df bit on tcp rst replies to match the normal tcp output patch and prevent ip id observability - zero hmac hash buffers on the stack after icv comparison and copy to prevent residual keyed hash output from persisting - zero gcm/gmac nonce buffers on the stack after use to prevent residual implicit salt bytes from persisting
1 parent 26dc833 commit a4ab47d

9 files changed

Lines changed: 1090 additions & 105 deletions

File tree

src/test/unit/unit.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ Suite *wolf_suite(void)
104104
tcase_add_test(tc_utils, test_timer_pop_right_child_swap);
105105
tcase_add_test(tc_utils, test_timer_pop_break_when_root_small);
106106
tcase_add_test(tc_utils, test_is_timer_expired_skips_zero_head);
107+
tcase_add_test(tc_utils, test_timer_pop_siftdown_resets_after_cancelled);
108+
tcase_add_test(tc_utils, test_tcp_reset_reply_sets_df_bit);
109+
tcase_add_test(tc_utils, test_ipcounter_seeded_at_init);
107110
tcase_add_test(tc_utils, test_wolfip_getdev_ex_api);
108111
tcase_add_test(tc_utils, test_wolfip_ll_frame_mtu_enforces_minimum);
109112
tcase_add_test(tc_utils, test_transport_capacity_helpers_cover_guard_paths);
@@ -214,7 +217,9 @@ Suite *wolf_suite(void)
214217
tcase_add_test(tc_utils, test_syn_sent_bare_rst_dropped);
215218
tcase_add_test(tc_utils, test_syn_rcvd_rst_bad_seq_dropped);
216219
tcase_add_test(tc_utils, test_ip_recv_drops_broadcast_source);
220+
tcase_add_test(tc_utils, test_ip_recv_drops_multicast_source);
217221
tcase_add_test(tc_utils, test_arp_recv_rejects_broadcast_sender);
222+
tcase_add_test(tc_utils, test_arp_recv_rejects_multicast_sender);
218223
tcase_add_test(tc_utils, test_dhcp_ack_rejects_mismatched_server_id);
219224
tcase_add_test(tc_utils, test_udp_no_icmp_unreachable_for_broadcast_src);
220225
tcase_add_test(tc_utils, test_udp_no_icmp_unreachable_for_multicast_src);
@@ -228,6 +233,7 @@ Suite *wolf_suite(void)
228233
tcase_add_test(tc_utils, test_syn_rcvd_bad_ack_sends_rst);
229234
tcase_add_test(tc_utils, test_established_fin_without_ack_dropped);
230235
tcase_add_test(tc_utils, test_ip_recv_drops_source_routed_packet);
236+
tcase_add_test(tc_utils, test_ip_recv_drops_ssrr_source_routed_packet);
231237
tcase_add_test(tc_utils, test_sock_sendto_error_paths);
232238
tcase_add_test(tc_utils, test_sock_sendto_null_buf_or_len_zero);
233239
tcase_add_test(tc_utils, test_sock_sendto_tcp_not_established);
@@ -322,6 +328,7 @@ Suite *wolf_suite(void)
322328
tcase_add_test(tc_utils, test_tcp_has_pending_unsent_payload_ignores_zero_ip_len_ack_only_desc);
323329
tcase_add_test(tc_utils, test_tcp_initial_cwnd_caps_to_iw10_and_half_rwnd);
324330
tcase_add_test(tc_utils, test_tcp_persist_cb_sends_one_byte_probe);
331+
tcase_add_test(tc_utils, test_tcp_zero_wnd_probe_includes_timestamp_when_enabled);
325332
tcase_add_test(tc_utils, test_tcp_zero_wnd_probe_rejects_invalid_inputs_and_empty_payload);
326333
tcase_add_test(tc_utils, test_tcp_zero_wnd_probe_skips_ack_only_segment);
327334
tcase_add_test(tc_utils, test_tcp_zero_wnd_probe_selects_middle_byte_at_snd_una);
@@ -340,6 +347,7 @@ Suite *wolf_suite(void)
340347
tcase_add_test(tc_utils, test_poll_icmp_send_on_arp_miss_requests_arp_and_retains_queue);
341348
tcase_add_test(tc_utils, test_dhcp_timer_cb_paths);
342349
tcase_add_test(tc_utils, test_regression_dhcp_lease_expiry_deconfigures_address);
350+
tcase_add_test(tc_utils, test_dhcp_request_retry_exhaustion_deconfigures_lease);
343351
tcase_add_test(tc_utils, test_dhcp_timer_cb_send_failure_does_not_consume_retry_budget);
344352
tcase_add_test(tc_utils, test_dhcp_client_init_and_bound);
345353
tcase_add_test(tc_utils, test_dhcp_client_init_bind_failure_closes_socket);
@@ -491,6 +499,7 @@ Suite *wolf_suite(void)
491499
tcase_add_test(tc_utils, test_tcp_input_syn_rcvd_ack_established);
492500
tcase_add_test(tc_utils, test_tcp_input_syn_rcvd_ack_invalid_ack_rejected);
493501
tcase_add_test(tc_utils, test_tcp_input_syn_rcvd_ack_invalid_seq_rejected);
502+
tcase_add_test(tc_utils, test_tcp_input_syn_rcvd_ack_fin_transitions_to_close_wait);
494503
tcase_add_test(tc_utils, test_tcp_input_filter_drop);
495504
tcase_add_test(tc_utils, test_tcp_input_port_mismatch_skips_socket);
496505
tcase_add_test(tc_utils, test_tcp_input_remote_ip_mismatch_skips_socket);
@@ -578,6 +587,7 @@ Suite *wolf_suite(void)
578587
tcase_add_test(tc_utils, test_tcp_ack_sack_early_retransmit_before_three_dupack);
579588
tcase_add_test(tc_utils, test_tcp_input_listen_syn_without_sack_disables_sack);
580589
tcase_add_test(tc_utils, test_tcp_input_listen_syn_arms_control_rto);
590+
tcase_add_test(tc_utils, test_tcp_input_listen_syn_sends_synack_immediately);
581591
tcase_add_test(tc_utils, test_tcp_input_syn_sent_synack_without_sack_disables_sack);
582592
tcase_add_test(tc_utils, test_tcp_recv_partial_hole_fill_consumes_stored_ooo);
583593
tcase_add_test(tc_utils, test_tcp_ack_ignores_sack_when_not_negotiated);
@@ -635,6 +645,7 @@ Suite *wolf_suite(void)
635645
tcase_add_test(tc_proto, test_arp_reply_updates_expired_entry);
636646
tcase_add_test(tc_proto, test_wolfip_recv_ex_multi_interface_arp_reply);
637647
tcase_add_test(tc_proto, test_forward_prepare_null_args);
648+
tcase_add_test(tc_proto, test_send_ttl_exceeded_includes_full_ip_header_with_options);
638649
tcase_add_test(tc_proto, test_send_ttl_exceeded_filter_drop);
639650
tcase_add_test(tc_proto, test_send_ttl_exceeded_ip_filter_drop);
640651
tcase_add_test(tc_proto, test_send_ttl_exceeded_eth_filter_drop);
@@ -646,6 +657,7 @@ Suite *wolf_suite(void)
646657
tcase_add_test(tc_proto, test_arp_request_filter_drop);
647658
tcase_add_test(tc_proto, test_arp_request_invalid_interface);
648659
tcase_add_test(tc_proto, test_arp_request_no_send_fn);
660+
tcase_add_test(tc_proto, test_arp_reply_rejects_invalid_sender_ip);
649661
tcase_add_test(tc_proto, test_arp_reply_filter_drop);
650662
tcase_add_test(tc_proto, test_arp_recv_invalid_iface);
651663
tcase_add_test(tc_proto, test_arp_recv_filter_drop);

0 commit comments

Comments
 (0)