You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[tests] test_tls.w stale (unsafe: syntax), PRF/conn checks never run #1063
tests/test_tls.w does not execute at 450733e (same drift class
as #1053/#1055, which named other suites): unsafe: single-line
prefix rejected at :36 and throughout, so the PRF determinism
probe and conn-init checks never run in CI.
Evidence
with-stage1 check tests/test_tls.w fails at :36
(unsafe: tls_prf_sha256(). The PRF logic itself is correct —
verified independently this session (100-byte output byte-exact
vs a python P_SHA256 oracle, .audit/probes/tls/prf.w) — only
the harness is stale.
Notes
Mechanical migration to current unsafe { } syntax. The suite's
PRF assertions are weak (non-zero + deterministic, no expected
bytes); promote the oracle-computed vector when migrating.
Verdict. Established: tests/test_tls.w does not compile — the stale unsafe: statement prefix is rejected, so the PRF and conn-init checks never run. Same test-rot class as #1053 (bigint/rsa/crypto) and #1055 (ec/ecdsa). As with those, fixing the syntax alone is not enough: tls_prf_sha256 is module-private and the file is in tests/, which no test target scans.
Tested.
Source
main @ 5809ac1 (2026-09-14); tests/test_tls.w unchanged since the reported revision 450733e
Compilers
with v0.15.2.1 built from 5809ac1 (staging worktree); a compiler built from 450733e with the nightly-20260903 seed. Same error
Platform
macOS Darwin 25.6.0 arm64
with check tests/test_tls.w, both compilers:
error: unsafe: requires a newline and indented block; use unsafe { ... } or unsafe *ptr
--> tests/test_tls.w:36:13
36 | unsafe: tls_prf_sha256(
Two unsafe: sites in the file; the first blocks compilation.
Further blockers (same as #1053/#1055).tls_prf_sha256 is declared unsafe fn (not pub) at lib/std/tls.w:114, and the test does use std.tls, so after the syntax fix it would fail with a privacy error (§18.3). And no .Test target in build.w globs tests/ (they scan test/), so the file never runs in with build :test. So "mechanical migration" understates it: the test also needs a pub/same-module home and suite wiring.
Root cause. Test rot since the TLS port; no compiler defect. Direct check + source evidence.
Severity. Low as a test-hygiene item, but it is why the far more serious TLS defects have no backstop: #1061 (no authentication), #1062 (unclamped handshake lengths). This suite is also where the PRF vector (which I confirmed correct elsewhere) should be pinned.
Related.#1053, #1055, #1054 (same drift/privacy/wiring pattern across crypto suites). No open PR.
Recommendation — champion (bundle with #1053/#1055). Migrate unsafe: to unsafe { }, give tls_prf_sha256 (and any other exercised entry points) a test-visible surface or co-locate the test in the module, move the file under test/, and replace the weak "non-zero + deterministic" PRF assertion with the oracle-computed vector. Acceptance criteria: with build :test runs a TLS suite that asserts the PRF against a known vector and covers conn init; a red result appears if the PRF regresses.
Not tested. I did not run the repaired suite (it needs the privacy change to compile). Linux/Windows not exercised.
Merged to main ae20d89 (#3251): std.tls's P_SHA256 PRF has a known answer that runs (the TLS working group's vector), tls_prf_sha256_kat, checked by test/behavior/behav_crypto_kats_hmac_bigint_prf.w; the dead tests/test_tls.w is deleted.
Activity
ehartford commentedon Sep 16, 2026
Review: reproduced
Verdict. Established:
tests/test_tls.wdoes not compile — the staleunsafe:statement prefix is rejected, so the PRF and conn-init checks never run. Same test-rot class as #1053 (bigint/rsa/crypto) and #1055 (ec/ecdsa). As with those, fixing the syntax alone is not enough:tls_prf_sha256is module-private and the file is intests/, which no test target scans.Tested.
main@ 5809ac1 (2026-09-14);tests/test_tls.wunchanged since the reported revision 450733ewith v0.15.2.1built from 5809ac1 (staging worktree); a compiler built from 450733e with the nightly-20260903 seed. Same errorwith check tests/test_tls.w, both compilers:Two
unsafe:sites in the file; the first blocks compilation.Further blockers (same as #1053/#1055).
tls_prf_sha256is declaredunsafe fn(notpub) atlib/std/tls.w:114, and the test doesuse std.tls, so after the syntax fix it would fail with a privacy error (§18.3). And no.Testtarget inbuild.wglobstests/(they scantest/), so the file never runs inwith build :test. So "mechanical migration" understates it: the test also needs apub/same-module home and suite wiring.Root cause. Test rot since the TLS port; no compiler defect. Direct
check+ source evidence.Severity. Low as a test-hygiene item, but it is why the far more serious TLS defects have no backstop: #1061 (no authentication), #1062 (unclamped handshake lengths). This suite is also where the PRF vector (which I confirmed correct elsewhere) should be pinned.
Related. #1053, #1055, #1054 (same drift/privacy/wiring pattern across crypto suites). No open PR.
Recommendation — champion (bundle with #1053/#1055). Migrate
unsafe:tounsafe { }, givetls_prf_sha256(and any other exercised entry points) a test-visible surface or co-locate the test in the module, move the file undertest/, and replace the weak "non-zero + deterministic" PRF assertion with the oracle-computed vector. Acceptance criteria:with build :testruns a TLS suite that asserts the PRF against a known vector and covers conn init; a red result appears if the PRF regresses.Not tested. I did not run the repaired suite (it needs the privacy change to compile). Linux/Windows not exercised.
ehartford commentedon Oct 25, 2026
Triage 2026-10-25,
with v0.15.3.0(main a261b65): reproduced.post-release: test coverage, the same class as #1053.
Issues batch D: crypto known answers that run (#1053 #1055 #1063); de…
ehartford commentedon Nov 11, 2026
Merged to main ae20d89 (#3251): std.tls's P_SHA256 PRF has a known answer that runs (the TLS working group's vector), tls_prf_sha256_kat, checked by test/behavior/behav_crypto_kats_hmac_bigint_prf.w; the dead tests/test_tls.w is deleted.