• src/sbbs3/ssl.c

    From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Thu May 7 01:03:39 2026
    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 Wed Nov 11 11:49:26 2026
    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
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Wed Dec 2 20:49:02 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/5ab1e0809844560198faff74
    Modified Files:
    src/sbbs3/ssl.c
    Log Message:
    Fix heap overflow fetching a cryptlib attribute string

    get_binary_crypt_attribute() queried an attribute's length, allocated
    that much, then fetched the value. cryptGetAttributeString() takes no destination size, so if the attribute grew between the two calls the
    copy overran the buffer. The servers read and write each TLS session on separate threads, and both log cryptlib errors from the same session:
    when the input thread's failure replaced the session's error message
    with a longer one between the output thread's two calls, the copy
    corrupted the heap, and the web server aborted in malloc().

    Fetch once into a buffer of cryptlib's maximum attribute size (4096
    bytes), then shrink it to the value's length.

    Fixes #1456

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

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