• src/ssh/TODO.md ssh-auth.

    From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, March 27, 2026 05:30:00
    https://gitlab.synchro.net/main/sbbs/-/commit/45e6600f19b4e23f5dccbf4b
    Modified Files:
    src/ssh/TODO.md ssh-auth.c ssh-conn.c ssh-internal.h ssh-trans.c ssh.c src/ssh/test/test_alloc.c
    Log Message:
    Fix 5 security bugs: stack overflows, OOB read, use-after-free, truncation

    - send_auth_failure(): replace msg[256] stack buffer with malloc
    (methods string from app callback was unbounded)
    - auth_server_impl() SERVICE_ACCEPT: replace accept[64] stack buffer
    with malloc (service name length is attacker-controlled)
    - Peer KEXINIT parsing: add minimum length check before setting ppos
    (short packet caused unsigned wraparound in pk_len - ppos)
    - find_channel(): hand-over-hand locking (channel_mtx then buf_mtx)
    to prevent use-after-free when channel is closed during demux
    - CHANNEL_DATA/EXTENDED_DATA: reject malformed packets where declared
    length exceeds payload instead of silently truncating

    Also: document lock ordering at declarations and cascade sites,
    update alloc test countdowns for new mallocs, add TODO for
    non-ASCII cleanup in source comments.

    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/m on Friday, March 27, 2026 20:57:00
    https://gitlab.synchro.net/main/sbbs/-/commit/8316e6a9848d490dcb6dc7b9
    Modified Files:
    src/ssh/TODO.md ssh-auth.c ssh-conn.c src/ssh/test/test_auth.c test_conn.c
    Log Message:
    Close item 87, add 30 NULL-parameter coverage tests (ssh-conn.c 69%->76%)

    Item 87 (shutdown path tolerance) already handled by dssh_thrd_check
    wrapper -- terminate atomic prevents recursion, every lock/broadcast in set_terminate() checks its return and skips on failure. Moved to Closed.

    Reorder NULL guard || chains in ssh-conn.c (16 functions) and ssh-auth.c
    (5 functions): sess == NULL now evaluates last so all branches are
    reachable with fake non-NULL sentinels (no handshake needed). Split
    parse function NULL checks into separate if statements.

    25 new tests in test_conn.c + 5 in test_auth.c covering every branch in
    every public API NULL guard. ssh-conn.c branch coverage 69.08% -> 76.01%
    (-65 missed branches), overall 79.79% -> 81.49%.

    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/m on Saturday, March 28, 2026 12:55:00
    https://gitlab.synchro.net/main/sbbs/-/commit/e0d57ec867e5c7e469991072
    Modified Files:
    src/ssh/TODO.md ssh-auth.c
    Log Message:
    Close items 10, 11: decompose auth_server_impl, eliminate SER macros

    Extract 4 per-method handlers (handle_auth_none, handle_auth_password, handle_auth_kbi, handle_auth_publickey) plus password_dispatch helper. auth_server_impl reduced from ~575 to ~80 lines of dispatch using AUTH_HANDLER_CONTINUE/AUTH_HANDLER_SUCCESS return macros.

    Replace all 5 local SER/SD_SER/MSG_SER/KBI_SER macros with direct DSSH_PUT_U32() calls. Extract build_userauth_request() prefix builder
    for 5 client call sites, eliminating ~60 lines of duplicated
    serialization.

    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/m on Saturday, March 28, 2026 12:55:00
    https://gitlab.synchro.net/main/sbbs/-/commit/7795126bb8bb6838af433fe0
    Modified Files:
    src/ssh/TODO.md ssh-auth.c ssh-chan.c ssh-chan.h ssh-conn.c ssh-internal.h ssh-trans.c ssh-trans.h ssh.c src/ssh/test/dssh_test_internal.h test_algo_enc.c test_algo_key.c test_algo_mac.c test_alloc.c test_auth.c test_chan.c test_conn.c test_selftest.c test_thread_errors.c test_transport.c test_transport_errors.c
    Log Message:
    Close item 90: consistent symbol prefix convention

    dssh_ prefix reserved for DSSH_PUBLIC symbols, dssh_test_ for symbols
    inside #ifdef DSSH_TESTING, no prefix for internal symbols
    (DSSH_PRIVATE, DSSH_TESTABLE). ~50 functions renamed across 9 library
    files and 11 test files.

    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/m on Wednesday, April 01, 2026 16:21:00
    https://gitlab.synchro.net/main/sbbs/-/commit/4fcdc81cdf4a3cd75b83d964
    Modified Files:
    src/ssh/TODO.md ssh-auth.c ssh-conn.c ssh-trans.c src/ssh/test/CMakeLists.txt test_auth.c
    Log Message:
    RULES.md audit fixes: input validation, type safety, arithmetic safety (items 163-169)

    - send_info_request: UINT32_MAX guards on string lengths (item 163)
    - Server KBI: reject num_responses > last_nprompts (item 164)
    - Client KBI: hard cap of 256 on num_prompts (item 165)
    - event_queue_push: SIZE_MAX/2 overflow guard (item 166)
    - send_to_slot: UINT8_MAX range check on payload_len (item 167)
    - stream_zc_cb, handle_channel_extended_data: inline cast to initializer (items 168-169)
    - 2 new tests: kbi_excess_responses, kbi_too_many_prompts

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

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