• src/ssh/ssh-auth.c src/ssh/test/dssh_test_internal.h test_auth.c

    From Deucе@VERT to Git commit to main/sbbs/master on Wed Mar 25 00:49:07 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/c5e8b4efff3f8f6aec667491
    Modified Files:
    src/ssh/ssh-auth.c src/ssh/test/dssh_test_internal.h test_auth.c
    Log Message:
    ssh-auth.c: direct parse_userauth_prefix tests (7 new tests)

    Make parse_userauth_prefix DSSH_TESTABLE and add 7 direct unit tests
    that call it from the main thread. This bypasses a coverage counter
    issue where threaded server tests' branch hits don't register in
    merged profdata.

    Tests cover all 6 truncation branches in parse_userauth_prefix:
    - Empty payload (no username length)
    - Truncated username data
    - No service length field
    - Truncated service data
    - No method length field
    - Truncated method data
    - Valid parse (positive test)

    ssh-auth.c missed branches: 64 → 55.

    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 Wed Mar 25 00:49:07 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/76bffee6fc3abb7d1b82b208
    Modified Files:
    src/ssh/ssh-auth.c src/ssh/test/dssh_test_internal.h test_auth.c
    Log Message:
    ssh-auth.c: DSSH_TESTABLE + direct server parse tests (17 new)

    Make auth_server_impl, get_methods_impl, auth_password_impl,
    auth_kbi_impl, and auth_publickey_impl DSSH_TESTABLE for direct
    testing from the main thread without needing a server thread.

    Add direct_server_test() helper: injects SERVICE_REQUEST + crafted USERAUTH_REQUEST into c2s, closes c2s, calls auth_server_impl
    directly. No threads, deterministic coverage.

    17 server-side parse/state tests:
    - Password: no boolean, no pw_len, pw overflow, change no new_pw,
    change new_pw overflow
    - Publickey: no has_sig, no algo_len, algo overflow, no pk_len,
    pk overflow, sig no sig_len, sig overflow
    - Wrong first message type (not SERVICE_REQUEST)
    - Short/overflow SERVICE_REQUEST payload
    - Long username (>255, truncation ternary)
    - NULL username_out_len parameter

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

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