• src/ssh/test/test_asymmetric_mac.csrc/ssh/test/CMakeLists.txt test_all

    From Deuc¿@VERT to Git commit to main/sbbs/master on Tue Mar 31 11:13:12 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/a8491210ced8844e548b4d5b
    Added Files:
    src/ssh/test/test_asymmetric_mac.c
    Modified Files:
    src/ssh/test/CMakeLists.txt test_alloc.c test_auth.c test_conn.c test_dhgex_provider.h test_selftest.c test_thread_errors.c test_transport.c
    Log Message:
    Add DSSH_TEST_MAC variant axis and fork-based asymmetric MAC test

    Gap 1: hmac-sha2-256 was never exercised in integration tests because hmac-sha2-512 always won negotiation. Add DSSH_TEST_MAC=hmac256 env
    var with test_register_mac_algos() helper to control MAC preference
    order. Four hmac256 variants added per test suite (default, rsa,
    dhgex, sntrup) covering the full stack with the 32-byte MAC.

    Gap 2: asymmetric c2s/s2c MAC negotiation was untestable because both
    sides share the same global registry. Add test_asymmetric_mac.c using
    fork() after socketpair() so client and server have separate registries
    with opposite MAC preference orders. Full handshake, auth, channel
    echo roundtrip exercises the per-direction key derivation fix from the
    previous commit. Proper session_teardown() (terminate + shutdown +
    cleanup) prevents demux thread hangs; child gets alarm(30) safety net.

    Test suite: 3489 tests (up from 2624), 0 failures.

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

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