Commit Graph

22 Commits (38fba1147f670b85bbc870bbdeb450ae1efd0822)

Author SHA1 Message Date
Tobias Frauenschläger 38fba1147f Send SNI in external.test so the peer returns its own certificate
scripts/external.test connects to www.wolfssl.com without a server_name
extension, so the CDN in front of that host answers with its own default
certificate rather than the wolfSSL one. That chain currently runs through
the RSA-4096 GlobalSign Root R46, while the intended chain is RSA-2048
throughout, so the test only passes on builds able to verify a 4096-bit
signature.

Two PRB configurations fail on master because of it. The fastmath leg with
FP_MAX_BITS=6144 reports BUFFER_E, and the 32-bit leg reports
ASN_SIG_CONFIRM_E because a build without WOLFSSL_X86_64_BUILD,
WOLFSSL_AARCH64_BUILD or OPENSSL_EXTRA defaults SP_INT_BITS to 3072. Both
are correct refusals to handle a key larger than the build supports, so the
test, not the library, is what needs fixing.

Name the host with -S in both client invocations. The option is a no-op
where the build lacks SNI, so those configurations keep their current
behavior, and the check uses the client's own "-S check" probe to decide.

Verified by building master with CFLAGS=-DSP_INT_BITS=3072, which
reproduces the BUFFER_E failure, and confirming the test passes with this
change in the same build and in an --enable-all build.
2026-09-04 15:02:39 +02:00
Juliusz Sosinowicz 1fa1228ba1 Address review: make the hang guards actually fire
Three ways the bounds added here failed to do their job:

- get_first_free_port ended the scan cap with 'exit 1', but every caller
  runs it in a command substitution, so only the subshell died. The port
  variable came back empty, the next $((port + 1)) evaluated to 1, and the
  run limped on to a confusing wait_for_readyFile failure. Forcing the cap
  on ocsp-stapling.test: before, the script ran on and hung until an outer
  timeout killed it; now it exits 1 at the error. Return instead, and check
  the status at all 25 call sites across the six scripts.

- The macOS timeout shim was a shell function. Backgrounding a function
  forks a subshell, so $! was the subshell and cleanup killed that while
  the server it was meant to stop leaked. Use a prefix variable that
  expands to nothing when timeout(1) is absent, keeping $! the real pid.

- timeout -s KILL exits 137, not 124. Sites that read $? and treat any
  non-zero as 'feature not compiled in' turned a hang into exit 0, so the
  bound made a hang less visible than before. Add timed_out() and check it
  before those skip branches; use it for the version probes too, which
  matched any status >= 124.
2026-08-13 15:52:17 +00:00
Juliusz Sosinowicz fb3c892931 Bound remaining hangable operations in test scripts
A test script that blocks forever burns the CI job's full
timeout-minutes with no logs. e82ecdff93 and 5c5cbd3094 bounded the
waited-on servers; this covers the remaining hang classes in
scripts/*.test:

- Wrap foreground example client/server, openssl s_client, and
  openssl ocsp invocations in "timeout -s KILL 2m". A client wedged
  before or without a live peer (e.g. blocked in first-seed entropy
  gathering, or DTLS with no reset from a dead peer) is not bounded
  by its peer's timeout.
- Add the macOS timeout() fallback shim to scripts that now use
  timeout.
- Bound the get_first_free_port scan loops (nc -w 1, 100-port cap).
- Add -w 1 to the remaining nc probes and dtls.test UDP pcap markers.
- ocsp-responder-openssl-interop.test: bound the responder reap in
  cleanup: give each responder 5 s to exit after SIGTERM, then
  SIGKILL before waiting, so a wedged responder cannot hang the EXIT
  trap.
- benchmark.test: bound the clients but leave the -i servers
  unwrapped: the script ends them with kill -6, which timeout(1)
  does not forward, so wrapping would orphan the server.
- trusted_peer/tls13: kill the server with SIGTERM instead of
  SIGKILL in cleanup so the signal forwards through the timeout
  wrapper to the wrapped server.
2026-08-13 15:52:17 +00:00
Colton Willey 9ad4e565fe Restore original comments 2024-09-05 15:10:50 -07:00
Colton Willey f749ca387d Rewrite to use test to make old mac sh versions happy 2024-09-04 16:34:09 -07:00
Colton Willey 8661cf6fee Update no network test option to overload meaning of existing WOLFSSL_EXTERNAL_TEST instead of using new flag 2024-09-04 16:09:16 -07:00
Daniel Pouzzner 1c68da282c portability enhancement: use "#!/usr/bin/env <interpreter>" on all perl scripts and shell scripts that use bash extensions, and use "#!/bin/sh" on the rest. 2024-08-20 13:48:33 -05:00
Brett 89d445a5a5 added --sys-ca-certs client connection to external test 2023-10-25 15:13:08 -06:00
Lealem Amedie 40d9473e6a Display SKIP instead of PASS when tests skipped for make check 2022-06-21 13:11:08 -07:00
Daniel Pouzzner 368854b243 scripts/: refactor TLS version support tests to use -V, rather than -v (which makes frivolous connection attempts). 2022-05-19 11:18:34 -05:00
Daniel Pouzzner abfc788389 script cleanup: use #!/bin/bash on all scripts that use "echo -e" (/bin/sh is sometimes a non-Bourne/non-POSIX shell, e.g. dash/ash, with no support for "echo -e"); fix whitespace. 2022-03-09 12:28:22 -06:00
Elms 21db484f50 tests: fix test scripts for paths with spaces 2021-06-13 21:37:07 -07:00
Elms d67934f6b8 scripts: remove use of `realpath` and fix `external.test`
`external.test` could fail quietly for not finding `ping.test` for
out-of-tree builds. Make it look relative to the script location.
2021-02-10 14:18:32 -08:00
Daniel Pouzzner 5625929c83 scripts/external.test: skip test when -UHAVE_ECC. 2020-11-10 01:27:45 -06:00
Daniel Pouzzner 196ae63eb2 scripts/external.test: skip test when -DWOLFSSL_SNIFFER (staticCipherList in client.c is incompatible). 2020-11-10 00:03:02 -06:00
Sean Parkinson 487c60df78 Fixes to work when compiled with TLS 1.3 only
TLS 1.3 Early Data can be used with PSK and not session tickets.
If only TLS 1.3 and no session tickets then no resumption.
External sites don't support TLS 1.3 yet.
2018-08-28 15:37:15 +10:00
Jacob Barthelmeh 1e766b23cf check return value of ping.test 2016-04-14 14:42:01 -06:00
David Garske 993972162e MinGW fixes, server port assigning cleanup and ping test cleanup. Fixes issue with visibility detection with MinGW. The visibility.m4 script was not actually trying to call the hidden function, which caused MinGW to detect improperly that visibility was supported. Fix for bogusFile on Windows build. Fixes to build warnings for unused variable 'res' and signed/unsigned comparison for sizeof min(). Cleanup of the server side port assignment to allow use with Windows/MinGW/Cygwin. If Windows uses new GetRandomPort() function in test.h to get port in in the 49152 - 65535 range. If *nix then uses the tcp_listen returned port. Otherwise uses the default wolfSSLPort. Refactor of the ping test code to use common file and properly handle ping count differences (Windows "-c" vs. *Nix style "-n"). Workaround for MinGW and cyassl/options.h getting file permissions error. Added non-fatal compile warning if using MinGW that "strtok_s" might be missing along with a link to public domain source that can be used. 2016-04-08 11:48:14 -06:00
toddouska 87668e7acd make external script test optional with env variable as CA changes more frequent than release 2015-10-20 11:56:46 -07:00
toddouska f76af05abf change autoconf scripts to /bin/sh, no -i on ping for portability 2015-06-10 14:11:36 -07:00
toddouska 4fe04c6bed detect build cases where external script test case doesn't make sense 2015-05-07 12:50:27 -07:00
toddouska 08b6e66ea8 add external site script test to make check 2015-05-07 10:02:43 -07:00