• src/ssh/test/test_conn.c test_transport.c

    From Deucе@VERT to Git commit to main/sbbs/master on Tue Mar 24 20:58:43 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/88b70f03d0f04fb63dc37d00
    Modified Files:
    src/ssh/test/test_conn.c test_transport.c
    Log Message:
    Test the last "practically untestable" branches

    All four turned out to be testable:

    - aes256_ctr/ctx_member_null: cbd non-NULL but cbd->ctx is NULL
    (second half of OR condition at line 46)
    - aes256_ctr/encrypt_update_fail: arm ossl countdown AFTER init
    succeeds so EVP_EncryptUpdate fails mid-operation
    - hmac_sha2_256/cleanup_null: call cleanup with NULL ctx
    - hmac_sha2_256/generate_failure: arm ossl countdown AFTER init
    succeeds so EVP_MAC operations fail mid-generate
    - test_window_add_overflow: set local_window near UINT32_MAX,
    send_window_adjust with enough to overflow — clamps to UINT32_MAX

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Tue Mar 24 20:58:43 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/88b47fbe94219893b4e85e9d
    Modified Files:
    src/ssh/test/test_conn.c test_transport.c
    Log Message:
    Add deterministic tests for profiling-unstable branches

    Some branches flip between "covered" and "missed" across coverage
    runs due to non-deterministic thread scheduling in two-threaded
    iterate tests. Add targeted single-threaded tests that exercise
    each branch deterministically.

    Negotiation failure tests (test_transport.c):
    - negotiate/no_common_kex: null gconf.kex_head → kex_selected NULL
    - negotiate/no_common_comp_s2c: crafted peer KEXINIT with bogus
    comp_s2c → comp_s2c_selected NULL (line 1138)

    Version parse tests (test_transport.c):
    - is_20 "1.99" chain: short buffer, bad minor digit, missing dash
    cover all 6 sub-branches of the || chain at line 78
    - version/rx_non_ascii: inject version line with byte > 127

    derive_key ossl injection tests (test_transport.c):
    - 7 tests targeting each EVP call in the derive_key chain plus
    the extension loop, covering lines 1207-1230

    hmac-sha2-256 targeted tests (test_transport.c):
    - reinit failure, fetch failure, mac_init failure covering
    generate() and init() error paths

    Connection state tests (test_conn.c):
    - session_poll and accept nsec overflow (tv_nsec >= 1e9)
    - stderr signal mark truncation (to_mark < avail)

    alloc/kex_server fix (test_alloc.c):
    - Build correct wire packets for curve25519 (was always building
    DH-GEX packets). Covers server-side alloc failures for both KEX.

    CLAUDE.md: document two-build-directory conventions, test counts,
    ossl/alloc thread-local injection infrastructure.

    11 of 20 profiling-unstable branches now deterministically stable.
    Remaining 9: 5 auth state machine (need crafted packet infra),
    4 coverage tool merge artifacts from parallel ctest.

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net