• src/ssh/enc/aes256-ctr.c src/ssh/kex/curve25519-sha256.c dh-gex-sha256

    From Deucе@VERT to Git commit to main/sbbs/master on Mon Mar 23 20:49:18 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/f71fe26992b4638e30d57a3f
    Modified Files:
    src/ssh/enc/aes256-ctr.c src/ssh/kex/curve25519-sha256.c dh-gex-sha256.c src/ssh/key_algo/rsa-sha2-256.c ssh-ed25519.c src/ssh/mac/hmac-sha2-256.c src/ssh/ssh-arch.c ssh-conn.c ssh-trans.c
    Log Message:
    Compile out unreachable defense-in-depth guards under DSSH_TESTING

    Wrap ~46 dead-code branches in #ifndef DSSH_TESTING so coverage
    reports reflect only reachable code. Each guard has a comment
    explaining why it is unreachable:

    ssh-arch.c: dssh_parse_uint32 cannot fail after bufsz >= 4 check

    ssh-trans.c: rekey_time never 0 after init, enc blocksize always >= 8,
    payload_len always > 0, enc->encrypt/decrypt always non-NULL, all
    modules provide cleanup, ka->haskey always non-NULL, kex_selected
    validated before kex(), shared secret always non-empty, namelist
    buffers adequate, remote_languages never populated

    ssh-conn.c: send_extended_data len already clamped by public API,
    chan_type always set after init, channels array never contains NULL

    key_algo: cbd->pkey always set before sign/pubkey/save callable,
    caller buffers always adequate, EVP_PKEY_id always matches module,
    cleanup only called after successful init

    kex modules: ka and function pointers always set by negotiation,
    own-key pubkey always succeeds, serialize buffers adequate

    enc/mac: cleanup only called after successful init

    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 23:06:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/7aa05c370a0dbe347d819876
    Modified Files:
    src/ssh/enc/aes256-ctr.c src/ssh/kex/curve25519-sha256.c dh-gex-sha256.c src/ssh/key_algo/rsa-sha2-256.c src/ssh/ssh-auth.c ssh-conn.c ssh-internal.h ssh-trans.c
    Log Message:
    Range-check all narrowing casts; DSSH_STRLEN macro

    Every runtime size_t → uint32_t cast now has an explicit range
    check before the narrowing. Casts backed by provable invariants
    (received packet lengths, fixed-size buffers, BN_num_bytes chain)
    are documented and left as single-use inline casts. Values used
    more than once after narrowing get an initializer variable.

    DSSH_STRLEN(lit) macro replaces (uint32_t)(sizeof(lit) - 1).
    EVP_EncryptUpdate bufsz gets INT_MAX guard. send_packet
    arithmetic cast replaced with range-checked initializer.

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

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