25.3.8-fips: add TLSv1.3 support to disableProtocols configuration#1569
Open
mkmkme wants to merge 19 commits intoreleases/25.3.8-fipsfrom
Open
25.3.8-fips: add TLSv1.3 support to disableProtocols configuration#1569mkmkme wants to merge 19 commits intoreleases/25.3.8-fipsfrom
mkmkme wants to merge 19 commits intoreleases/25.3.8-fipsfrom
Conversation
Made-with: Cursor Signed-off-by: Julian Huang <jhuang@altinity.com>
Signed-off-by: Julian Huang <jhuang@altinity.com>
…ndshaker Move the identical glibc_compat.c files from ssl-shim/ and ssl-handshaker/ into a shared programs/ssl-common/ directory. Also add the gtest include path required by test_util.cc to both CMakeLists. Signed-off-by: Julian Huang <jhuang@altinity.com>
The FIPS 2.0.0 shim sources do not include any gtest headers, so this include path is not needed. Signed-off-by: Julian Huang <jhuang@altinity.com>
Signed-off-by: Julian Huang <jhuang@altinity.com>
Gate ssl-shim/ssl-handshaker/acvp-server declarations in main.cpp with per-target ENABLE_CLICKHOUSE_* defines (via config_tools.h) that match the exact CMake conditions under which targets are created, preventing unresolved symbols when FIPS_CLICKHOUSE is set without AWSLC_SRC_DIR or on non-Linux platforms. Move the --allow-multiple-definition linker flag from the global clickhouse target into each of the three library targets as an INTERFACE property, so the flag only enters the link when those specific libraries are actually consumed. Signed-off-by: Julian Huang <jhuang@altinity.com> Made-with: Cursor
Replace the partial posix_spawn with the complete upstream musl implementation (https://git.musl-libc.org/cgit/musl/tree/src/process/posix_spawn.c), adapted for the glibc sysroot headers used by ClickHouse. Key safety improvements from upstream: - Pipe fd clobbering protection: if a file action targets the error-reporting pipe fd, dup it to an unoccupied fd first - Close-on-exec set after file actions (pipe may have been moved) - Block all signals before pipe2/clone; unblock after exec - EPIPE-aware error reporting back to parent - Support for POSIX_SPAWN_SETSID, SETPGROUP, RESETIDS, SETSIGDEF - Larger stack (1024 + PATH_MAX) Adaptations from upstream musl: - Uses glibc sysroot field names (__ss/__sd vs __mask/__def) - Keeps __posix_spawnx exec-function parameter (glibc attr has no __fn) - Omits LOCK(__abort_lock) (musl-internal, not available) - Omits __get_handler_set (musl-internal; signals are blocked for the child's brief pre-exec window so parent handlers cannot fire) - Uses clone() instead of musl-internal __clone() Signed-off-by: Julian Huang <jhuang@altinity.com> Made-with: Cursor
…2, used only for ssl/acvp tests Signed-off-by: Julian Huang <jhuang@altinity.com>
…t the rest of CH Signed-off-by: Julian Huang <jhuang@altinity.com>
Signed-off-by: Julian Huang <jhuang@altinity.com>
…ading source twice Signed-off-by: Julian Huang <jhuang@altinity.com>
Compile ssl-shim, ssl-handshaker, and acvp-server test harness code inside the Docker build rather than with manual /usr/bin/c++ invocations in CMake. A new build_test_harness.sh script does partial linking (ld -r) with libstdc++ and then uses objcopy --prefix-symbols to namespace all internal symbols, avoiding collisions with ClickHouse's libc++. This eliminates --allow-multiple-definition, hardcoded x86 library paths, and the AWSLC_SRC_DIR configure-time requirement. The three per-program CMakeLists.txt are replaced by IMPORTED library targets in contrib/openssl-cmake/CMakeLists.txt. posix_spawn_2.c gains aarch64 raw-syscall wrappers so both Dockerfiles work natively. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
aarch64 Linux does not define SYS_dup2 — the syscall was omitted from the aarch64 kernel ABI since dup3 supersedes it. Use SYS_dup3 with flags=0 which is semantically identical. Both call sites are already guarded by fd != op->fd, so dup3's EINVAL-on-equal-fds is not a concern.
…xtended-testing SSL/ACVP Test Integration for FIPS - second try
…-ch-binary-extended-testing Revert "SSL/ACVP Test Integration for FIPS - second try"
The disableProtocols mechanism only handled sslv2 through tlsv1_2. Specifying "tlsv1_3" in the config was silently ignored, so TLS 1.3 connections could not be disabled. This matters for FIPS testing where we need to verify that disabling all protocols actually prevents all connections. Add PROTO_TLSV1_3 to the Protocols enum, handle SSL_OP_NO_TLSv1_3 in Context::disableProtocols(), and parse "tlsv1_3" in all four config readers (SSLManager, TLSHandler, PostgreSQLHandler, KeeperServer).
Collaborator
Author
|
AI audit note: This review comment was generated by AI (gpt-5.3-codex). Audit update for PR #1569 (TLSv1.3 support for disableProtocols): Confirmed defects: No confirmed defects in reviewed scope. Coverage summary: |
Collaborator
|
Previously failing regression tests involving disabling protocols now pass. Looks like Also ran AI Audit from my end. AI said "No confirmed defects in reviewed scope." :) Looks good to me! |
7c8d816 to
d1e8b14
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The disableProtocols mechanism only handled sslv2 through tlsv1_2. Specifying "tlsv1_3" in the config was silently ignored, so TLS 1.3 connections could not be disabled. This matters for FIPS testing where we need to verify that disabling all protocols actually prevents all connections.
Add PROTO_TLSV1_3 to the Protocols enum, handle SSL_OP_NO_TLSv1_3 in Context::disableProtocols(), and parse "tlsv1_3" in all four config readers (SSLManager, TLSHandler, PostgreSQLHandler, KeeperServer).
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
add TLSv1.3 support to disableProtocols configuration
Documentation entry for user-facing changes
...
CI/CD Options
Exclude tests:
Regression jobs to run: