DataReelDataReelC++ Toolkit Documentation

DataReel 7.3.1 Beta Release Notes

Contents

Fixes
Tests
DATABASE REPLICATION (added 11/07/2026, beta)

DataReel 7.3.2 fixes database replication (gxrepl) problems found in production; see RELEASE_NOTES_7.3.2.txt.

DataReel 7.3.1 is a beta bug fix release of 7.3. DataReel 7.4.1 (11/20/2026) is now the stable release, and DataReel 6.4.2 the legacy release (bug fixes and security updates only); please report problems through https://datareel.com/contact.php.

7.3.1 fixes the problems found by a security scan of the object database code (gxDatabase, gxBtree, BtreeCache, gxdJournal, the page cache and the file I/O layer) and by a full sweep of the rest of the library (TLS, the gxStream database protocol, HTTP, SMTP, POP3, FTPS, telnet, RS-232, ping, config, log file, thread pool and the repair tools), and adds mutual TLS to gxStream database servers. The file formats are unchanged and the API changes are additions. Rebuild programs against 7.3.1.

The library version is 7.3.1 (version.txt, DATAREEL_VERSION_STRING in gxdlcode.h, libdatareel.so.7.3.1); the soname stays libdatareel.so.7.

Fixes

1. gxDatabase::TotalBlocks() on a damaged file: a block length of

   zero looped for ever, tiny lengths rescanned the same bytes again
   and again, and in the 64-bit engine a huge length wrapped the
   address back to an earlier block (an endless count). Lengths
   shorter than a block header or past the end of the file are now
   skipped like any bad block. (Found by fuzzing.)

2. gxDatabase::CalcChecksum(): the end of file came from the file

   header, so a damaged header could ask for a buffer of any size. It
   is now limited by the real file size. (Found by fuzzing.)

3. gxDatabase::Close(): a file that failed the signature test in

   Open() was never closed, leaking one file descriptor or handle per
   failed open (a bug since 6.x). Close() now closes any open file and
   still never writes a header to a file that failed the checks.
   (Found by LeakSanitizer.)

4. gxdJournal::Recover(): pages past a file's committed size are

   skipped, so a damaged page number cannot become a wrapped file
   offset, and a commit record with a file size the file address type
   cannot hold ends the replay. (Found by static analysis and fuzzing.)

5. gxDatabase::WriteObjectChecksum() returned an uninitialised value

   when the file was not open. (Found by static analysis.)

SECURITY SWEEP FIXES (summary; the full list with tests is in DATAREEL_73_FULL_SECURITY_SWEEP.md in the project notes)

Mutual TLS for gxStream database servers (gxstls.h, gxstream.h, gxssl.h)

   Section text for RELEASE_NOTES_7.3.1.txt, 11/01/2026.

   gxStream servers now require client certificates and accept only
   the clients in an allow list. The check is on by default for
   database servers and off for other TLS servers.

   Servers
   - New gxStreamServer (gxstream.h), a gxsTLSServer for gxStream
     clients. Before Listen(), call SetClientCAFile("client_ca.pem")
     and allow clients with AllowClientFingerprint(sha256) and/or
     AllowClientCN(name). Listen() fails, with Error() saying why,
     if the client CA file or the allow list is missing. An open
     server needs an explicit AllowAnonymousClients(true).
     Accept(gxStream &) accepts a client into a stream.
   - New gxsTLSServer functions: SetClientCAFile(), ClientCAFile(),
     AllowClientFingerprint(), AllowClientCN(),
     ClearClientAllowList(), AllowedFingerprints(), AllowedCNs(),
     SetRequireClientAuth(), RequireClientAuth(),
     AllowAnonymousClients(), AnonymousClientsAllowed() and the
     static NormalizeFingerprint().
   - With a client CA file set, the server asks every client for a
     certificate. Only the CAs in that file are trusted for client
     certificates, not the system store. After the handshake
     Accept() checks that a certificate was sent, that its chain
     verifies, and that its SHA-256 fingerprint or subject CN is in
     the allow list. If any check fails the connection is closed
     and Accept() returns -1 (fail closed). With a client CA file and
     an empty allow list (possible only on a plain gxsTLSServer), any
     certificate from those CAs is accepted.
   - Fingerprints are 32 hex bytes, with or without colons and in
     either case; the "sha256 Fingerprint=" prefix printed by
     "openssl x509 -noout -fingerprint -sha256" is skipped. CN
     matches are exact and case sensitive. A certificate with no CN,
     more than one CN, or a NUL in the CN matches only by
     fingerprint.
   - The accepted gxsTLSConnection reports the client's identity:
     ClientAuthenticated(), PeerFingerprint() (upper case hex with
     colons) and PeerCN() (UTF-8). These come from the client's
     certificate, so escape control characters before logging them.
   - A plain gxsTLSServer (HTTPS server, tls_echo_server and other
     TLS servers) does not ask for client certificates unless
     SetClientCAFile() is called. Only gxStreamServer, or a server
     that calls SetRequireClientAuth(true), refuses to start without
     the setup. A program that serves gxStream with a plain
     gxsTLSServer keeps working but has no client check; switch it
     to gxStreamServer.
   - Call Accept() for every client. AttachServer() with the server
     context checks the certificate chain (OpenSSL) but not the
     allow list.

   Clients
   - New gxStream::SetClientCert(cert, key, passphrase), the same as
     Connection().SetClientCert(), sets the certificate and key sent
     to the server. Set it before Connect(). With TLS 1.3 a refused
     client finds out on its first read or write after Connect(),
     not in Connect() itself.
   - Schannel (Windows) clients load the certificate and key the
     same way as Schannel servers: a PEM or DER certificate with a
     PEM/DER PKCS#8, RSA or EC key (the key is imported into the
     current user's key store while the context exists), or a .pfx
     or .p12 file passed as the certificate with an empty key file.

   gxSSL
   - New SetClientCAList()/ClientCAList(), VerifyClientCert() and
     GetPeerCertIdentity() (OpenSSL and Schannel). OpenSSL servers
     use SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, send the
     client CA names and set a session ID context so resumed
     sessions still work. Schannel servers request client
     certificates with ASC_REQ_MUTUAL_AUTH and check the chain the
     same way VerifyCert() checks a server against a CA list: the
     root must be in the client CA list and the SSL policy is
     checked for client authentication. The fingerprint comes from
     CryptHashCertificate2(SHA256).

   Examples and tests
   - stream_server has new options --client-ca FILE,
     --allow-fingerprint SHA256 and --allow-cn NAME (repeatable), and
     --open for an open server. Without them it refuses to start. It
     logs each client's CN and fingerprint. stream_client has --cert
     FILE --key FILE.
   - run_tests.sh makes a client CA and two client certificates and
     adds stream_client_identity_logged, stream_no_client_cert_refused,
     stream_wrong_client_cert_refused,
     stream_server_refuses_without_auth_config and stream_open_server.
     run_tests_win.sh runs the same checks; its CERT_DIR now also
     needs client_ca.pem, client_ok.pem/.key and client_bad.pem/.key.

   Compatibility
   - Source compatible: all changes are new functions and a new
     class. gxSSL, gxsTLSConnection and gxsTLSServer have new
     members, so programs built against 7.3 must be rebuilt.
   - Existing stream_server command lines must add --client-ca and
     an allow option (or --open), and clients need --cert/--key.
   - The Schannel code was written without a Windows compiler at hand
     and needs a build and run_tests_win.sh run on Windows before
     release. Depending on the Windows ClientAuthTrustMode setting,
     Schannel may also check client certificates against the
     machine's trusted roots during the handshake.

NOTE: a journal names the files it repairs. Recovering a journal that someone else wrote can write to any file the program may write, the same trust the program gives its database files. Keep journal files in a folder only the database owner can write.

Tests

The scan itself (tools, fuzzing statistics, reproducers) is described in DATAREEL_73_SECURITY_SCAN.md in the project notes.

DATABASE REPLICATION (added 11/07/2026, beta)

gxrepl keeps folders of object databases the same on two nodes over a gxStream TLS connection, TCP port 2073 (gxsDATA_PORT) by default, with an SSH tunnel as the fallback when the port is closed. See utils/gxrepl/README.md.

No file format changes: a database written with the ship log is an ordinary database, and the log lives in its own folder. POSIX only.

11/08/2026 changes (replication protocol 2; both nodes must run the same version, a mismatch is refused in the hello):

Database object server (11/08/2026, phase 2; replication protocol 3):

Power-loss tests and fixes (11/09/2026, phase 2 step 5):

Replication fixes from the 11/10 reviews (gxrepl-var-r3):

Ship-log volume and whole copies (11/10, gxrepl-var-r4 / r4d):