• src/ssh/test/test_auth.c

    From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Mar 23 20:49:18 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/17d44539e6157fe2cc0edf44
    Modified Files:
    src/ssh/test/test_auth.c
    Log Message:
    Add 11 server auth parse error tests

    Tests send malformed USERAUTH_REQUEST packets through an encrypted
    session to exercise parse_userauth_prefix and method-specific parse
    branches in dssh_auth_server:

    - empty request (just message type byte)
    - truncated username (length > remaining data)
    - no service name field after username
    - truncated service name (length > remaining)
    - no method field after service name
    - truncated method name (length > remaining)
    - password method with no change boolean
    - password method with no password length
    - publickey method with no has_signature boolean
    - first message is not SERVICE_REQUEST
    - username >= 256 bytes (truncation to saved_user)

    ssh-auth.c branch coverage: 63.33% -> 67.27% (-13 missed)

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Wed Mar 25 00:49:07 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/a9b8ad269a7a66caf2f395f3
    Modified Files:
    src/ssh/test/test_auth.c
    Log Message:
    ssh-auth.c coverage: defensive, client, and edge-case tests (23 new)

    Defensive/edge-case tests (11):
    - Server with NULL username_out parameters
    - get_methods with zero-size and small buffer
    - FAILURE response with DEL char in method names
    - 4/8/9-byte method names that don't match none/password/publickey
    - Password change callback returning NULL prompt
    - Publickey auth with algo name > 64 bytes (truncation)
    - Banner with no language field
    - get_methods small buffer (copylen truncation)

    Client-side failure tests (12):
    - SERVICE_REQUEST and get_methods send failures
    - Password CHANGEREQ: callback error and send failure
    - KBI initial send and recv failures
    - Publickey: no key, pubkey fail, sign fail, send fail, recv fail
    - Publickey with BANNER before auth response

    ssh-auth.c missed branches: 71 → 62 (77.9% → 80.6%).

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)