• src/sbbs3/ssl.c

    From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Wednesday, May 06, 2026 19:41:53
    https://gitlab.synchro.net/main/sbbs/-/commit/e3c1569fc5a74ca9bb76c62c
    Modified Files:
    src/sbbs3/ssl.c
    Log Message:
    ssl: assert CRYPTLIB_PATCHES literal is at least 32 chars (CID 483188)

    CRYPTLIB_PATCHES is generated at build time by 3rdp/build/hashpatch.pl
    as a 32-char MD5 plus " -" (36 bytes including NUL). If hashpatch.pl
    fails to run, the macro can be left empty, and the existing
    memcmp(patches, CRYPTLIB_PATCHES, 32) reads 32 bytes off the end of a
    1-byte empty literal Ä Coverity flags this as OVERRUN. Add a
    _Static_assert at the top of internal_do_cryptInit() so a malformed
    build fails to compile instead of producing a binary that may either
    overrun or run a broken patch check.

    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Wednesday, May 06, 2026 19:41:53
    https://gitlab.synchro.net/main/sbbs/-/commit/c34274cdbba23fb7f5bcba2a
    Modified Files:
    src/sbbs3/ssl.c
    Log Message:
    ssl: suppress destroy_session false positives (CIDs 479100, 530506)

    CID 530506 (psess->next MISSING_LOCK): Coverity confused the two
    distinct list mutexes. sess_list nodes (and their next fields) are
    protected by ssl_sess_list_mutex, which IS held at the flagged write.
    The cert_list (separate list, separate mutex) shares the cert_list
    struct type but has no overlap Ä a node lives in exactly one list at
    a time.

    CID 479100 (sess ATOMICITY across two locked sections): After sess is
    removed from sess_list under ssl_sess_list_mutex, no other thread can
    reach it via either list. It's thread-local until appended to
    cert_list under ssl_cert_list_mutex. The "second locked section" only
    touches a pointer this thread exclusively owns.

    Add SUPPRESS comments documenting both invariants.

    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Wednesday, May 06, 2026 22:36:57
    https://gitlab.synchro.net/main/sbbs/-/commit/0f04514cb45809851b631961
    Modified Files:
    src/sbbs3/ssl.c
    Log Message:
    ssl: cast DO() to void in get_ssl_cert key load (CID 544155)

    The cryptGetPrivateKey result is captured via the cert_entry->cert out-parameter and the loop's 'cert == -1' check, which is the actual
    condition the caller acts on. The DO() macro return is informational
    only here. Make the discarded return explicit.

    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Thursday, May 07, 2026 01:03:39
    https://gitlab.synchro.net/main/sbbs/-/commit/a62f38d5ba9491e2c89227d7
    Modified Files:
    src/sbbs3/ssl.c
    Log Message:
    ssl: fix macOS build of internal_do_cryptInit (CID 483188 follow-up)

    e3c1569fc added a _Static_assert that CRYPTLIB_PATCHES is at least
    32 chars, but some build configs (macOS, exec/testbuild.js nightly)
    define it empty to deliberately skip the patch-version check. The
    assert tripped that build.

    Replace the assert with a sizeof() runtime guard wrapping the cryptGetAttributeString / memcmp / asprintf block. Compilers fold
    the sizeof comparison constant per build, so:
    - When CRYPTLIB_PATCHES is the real 36-byte literal, the block is
    kept and Coverity sees the memcmp is safely bounded.
    - When CRYPTLIB_PATCHES is "", the block is dropped entirely and
    we never attempt the 32-byte read past the empty literal.

    GitLab CI pipelines pass; this only affects the nightly testbuild configurations that leave CRYPTLIB_PATCHES empty.

    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Wednesday, November 11, 2026 11:49:26
    https://gitlab.synchro.net/main/sbbs/-/commit/72f4ea568a7c43de6dd2479a
    Modified Files:
    src/sbbs3/ssl.c
    Log Message:
    ssl: don't clear the shared cert_path when a certificate load fails

    get_ssl_cert() and create_self_signed_cert() zeroed the static
    cert_path on failure, without a lock, while other threads could be in get_ssl_cert()'s retry loop. Those threads then tried to open "" for
    the rest of their retries, so one transient failure to read ssl.cert
    (e.g. from an overloaded network share) failed every TLS session being
    set up at the time:

    get_ssl_cert: Failed to open/read TLS certificate:
    SMTPS ERROR 'Data has not been initialised' (-11) setting private key
    SMTPS !Unable to set private key

    The path never changes once set, so leave it alone on failure, and set
    it under tls_cert_file_date_lock in ssl_sync(), which every reader of
    cert_path has already passed through.

    The clears date from 976801798b (2023-12-20) and d1c741d073
    (2025-03-09).

    Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

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