Skip to content

Commit a925d65

Browse files
committed
- fix listen socket descrution on SYN_RCVD ctrl-RTO expirty:
revert to TCP_LISTEN instead of close_socket() - add missing esp encapsulation to icmp tx path in wolfip_poll() - add alignment guard to tcp ts option fit-check in tcp_send_syn(), matching ws and sack patterns - add missing esp encapsulation to icmp echo reply path in icmp_input() - add missing esp encapsulation to icmp port unreachable pathh in wolfip_send_port_unreachable() - add rfc 9293 compliant rst handling for tcp syn__sent state - add sequence number validation of rst segments in tcp syn_rcvd state per rfc 9293 - add source ip validation in ip_recv() to drop broadcast, multicast and zero-address packets per rfc 1122 - validate arp request sender ip before caching to prevent cache poisoningg from spoofed sources - validate dhcp ack server identifier matches the server commiteed during offer phase - add coverage tests for icmp port unreachable suppression on broadcast/multicast source and destination - add coverage tests for tcp rst suppression on broadcast and multicast destination addresses - add coverage test for dhcp renewing to rebinding state transition at rebind deadline boundary - add coverage test for icmp echo reply suppression on multicast destination addresses - validate arp * fields in arp_recv and update existing tests to set them correctly - Use wc_ForceZero for ESP SA key material clearing and update CI workflows to build wolfSSL from source with --enable-md5 - add missing esp encapsulation to icmp ttl exceeded path in wolfip_send_ttl_exceeded() - send rst in response to syn-ack with invalid ack in syn_sent state per rfc 9293 - send rst in response to aunnaccetable ack in syn_rcvd state per rfc 9293 - drop segments without ack flag in synchronized tcp states per rfc 9293 - drop ip packets with source routine options (lsrr/ssrr) per rfc 7126
1 parent d6fe35e commit a925d65

13 files changed

Lines changed: 1141 additions & 27 deletions

.github/workflows/freebsd.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,16 @@ jobs:
2121
prepare: |
2222
set -ex
2323
env IGNORE_OSVERSION=yes pkg update -f
24-
env IGNORE_OSVERSION=yes pkg install -y gmake gcc wolfssl check vim
24+
env IGNORE_OSVERSION=yes pkg install -y gmake gcc check vim autoconf automake libtool
2525
kldload if_tap || true
2626
sysctl net.link.tap.up_on_open=1 || true
27+
git clone --depth=1 https://github.com/wolfssl/wolfssl --branch nightly-snapshot /tmp/wolfssl
28+
cd /tmp/wolfssl
29+
./autogen.sh
30+
./configure --enable-md5
31+
gmake -j$(sysctl -n hw.ncpu)
32+
gmake install
33+
ldconfig
2734
run: |
2835
set -ex
2936
cd "${GITHUB_WORKSPACE:-/root/work/github/workspace}"

.github/workflows/linux.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,22 @@ jobs:
1616
with:
1717
submodules: true
1818

19-
- name: Update repo
19+
- name: Install dependencies
2020
run: |
2121
sudo apt-get update
22-
sudo apt-get install -y libwolfssl-dev
22+
sudo apt-get install -y build-essential autoconf automake libtool pkg-config
2323
sudo modprobe tun
2424
25+
- name: Clone and build wolfSSL from nightly-snapshot
26+
run: |
27+
git clone --depth=1 https://github.com/wolfssl/wolfssl --branch nightly-snapshot /tmp/wolfssl
28+
cd /tmp/wolfssl
29+
./autogen.sh
30+
./configure --enable-md5
31+
make -j$(nproc)
32+
sudo make install
33+
sudo ldconfig
34+
2535
- name: Build linux tests
2636
run: |
2737
mkdir -p build/port

.github/workflows/macos.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ jobs:
1818
- name: Install dependencies
1919
run: |
2020
brew update
21-
brew install make wolfssl check
21+
brew install make check autoconf automake libtool
22+
23+
- name: Clone and build wolfSSL from nightly-snapshot
24+
run: |
25+
git clone --depth=1 https://github.com/wolfssl/wolfssl --branch nightly-snapshot /tmp/wolfssl
26+
cd /tmp/wolfssl
27+
./autogen.sh
28+
./configure --enable-md5
29+
make -j$(sysctl -n hw.ncpu)
30+
sudo make install
2231
2332
- name: Build tests
2433
run: |

.github/workflows/multi-compiler.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,19 @@ jobs:
3939

4040
- name: Install dependencies
4141
run: |
42-
sudo apt-get install -y libwolfssl-dev check
42+
sudo apt-get install -y autoconf automake libtool pkg-config check
4343
sudo modprobe tun
4444
45+
- name: Clone and build wolfSSL from nightly-snapshot
46+
run: |
47+
git clone --depth=1 https://github.com/wolfssl/wolfssl --branch nightly-snapshot /tmp/wolfssl
48+
cd /tmp/wolfssl
49+
./autogen.sh
50+
./configure --enable-md5
51+
make -j$(nproc)
52+
sudo make install
53+
sudo ldconfig
54+
4555
- name: Build wolfIP with ${{ matrix.cc }}
4656
run: |
4757
mkdir -p build/port

.github/workflows/sanitizers.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,19 @@ jobs:
4444
- name: Install dependencies
4545
run: |
4646
sudo apt-get update
47-
sudo apt-get install -y libwolfssl-dev check
47+
sudo apt-get install -y build-essential autoconf automake libtool pkg-config check
4848
sudo modprobe tun
4949
50+
- name: Clone and build wolfSSL from nightly-snapshot
51+
run: |
52+
git clone --depth=1 https://github.com/wolfssl/wolfssl --branch nightly-snapshot /tmp/wolfssl
53+
cd /tmp/wolfssl
54+
./autogen.sh
55+
./configure --enable-md5
56+
make -j$(nproc)
57+
sudo make install
58+
sudo ldconfig
59+
5060
- name: Build wolfIP with ${{ matrix.name }}
5161
run: |
5262
mkdir -p build/port

src/test/unit/unit.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,26 @@ Suite *wolf_suite(void)
208208
tcase_add_test(tc_utils, test_sock_accept_synack_retransmission);
209209
tcase_add_test(tc_utils, test_sock_accept_synack_window_not_scaled);
210210
tcase_add_test(tc_utils, test_sock_accept_ack_transitions_to_established);
211+
tcase_add_test(tc_utils, test_listen_socket_survives_synrcvd_rto_expiry);
212+
tcase_add_test(tc_utils, test_accepted_socket_destroyed_on_synrcvd_rto_expiry);
213+
tcase_add_test(tc_utils, test_tcp_send_syn_options_aligned_small_mtu);
214+
tcase_add_test(tc_utils, test_syn_sent_bare_rst_dropped);
215+
tcase_add_test(tc_utils, test_syn_rcvd_rst_bad_seq_dropped);
216+
tcase_add_test(tc_utils, test_ip_recv_drops_broadcast_source);
217+
tcase_add_test(tc_utils, test_arp_recv_rejects_broadcast_sender);
218+
tcase_add_test(tc_utils, test_dhcp_ack_rejects_mismatched_server_id);
219+
tcase_add_test(tc_utils, test_udp_no_icmp_unreachable_for_broadcast_src);
220+
tcase_add_test(tc_utils, test_udp_no_icmp_unreachable_for_multicast_src);
221+
tcase_add_test(tc_utils, test_udp_no_icmp_unreachable_for_broadcast_dst);
222+
tcase_add_test(tc_utils, test_udp_no_icmp_unreachable_for_multicast_dst);
223+
tcase_add_test(tc_utils, test_tcp_no_rst_for_broadcast_dst);
224+
tcase_add_test(tc_utils, test_tcp_no_rst_for_multicast_dst);
225+
tcase_add_test(tc_utils, test_dhcp_renewing_transitions_to_rebinding);
226+
tcase_add_test(tc_utils, test_arp_recv_rejects_wrong_htype);
227+
tcase_add_test(tc_utils, test_syn_sent_bad_ack_synack_sends_rst);
228+
tcase_add_test(tc_utils, test_syn_rcvd_bad_ack_sends_rst);
229+
tcase_add_test(tc_utils, test_established_fin_without_ack_dropped);
230+
tcase_add_test(tc_utils, test_ip_recv_drops_source_routed_packet);
211231
tcase_add_test(tc_utils, test_sock_sendto_error_paths);
212232
tcase_add_test(tc_utils, test_sock_sendto_null_buf_or_len_zero);
213233
tcase_add_test(tc_utils, test_sock_sendto_tcp_not_established);
@@ -712,6 +732,7 @@ Suite *wolf_suite(void)
712732
tcase_add_test(tc_proto, test_icmp_input_echo_request_dhcp_running_no_reply);
713733
tcase_add_test(tc_proto, test_icmp_input_echo_request_broadcast_no_reply);
714734
tcase_add_test(tc_proto, test_icmp_input_echo_request_directed_broadcast_no_reply);
735+
tcase_add_test(tc_proto, test_icmp_input_echo_request_multicast_no_reply);
715736
tcase_add_test(tc_proto, test_icmp_input_echo_request_filter_drop);
716737
tcase_add_test(tc_proto, test_icmp_input_echo_request_ip_filter_drop);
717738
tcase_add_test(tc_proto, test_icmp_input_echo_request_eth_filter_drop);

0 commit comments

Comments
 (0)