Skip to content

Use sipHash128 instead of MD5 in test 05359_parquet_file_logical_type - #125750

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:fips-05359-parquet-file-logical-type-siphash128
Oct 15, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:fips-05359-parquet-file-logical-type-siphash128

Conversation

@groeneai

@groeneai groeneai commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #123788
Related: #125132

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Use sipHash128 instead of MD5 in the stateless test 05359_parquet_file_logical_type, so it also passes when OpenSSL FIPS mode is enabled.

Description

05359_parquet_file_logical_type (added in #125132) builds the checksum field of its Parquet FILE tuples as 'MD5:' || lower(hex(MD5(toString(number)))). In FIPS mode MD5 throws Code: 344 ... Function MD5 is not available in FIPS mode. (SUPPORT_IS_DISABLED) at analysis, so the INSERTs that write the test files fail and the whole test fails, on master too. This was reported on #123788; the FIPS job runs only in the private CI (CH Inc sync), so I cannot link a public failing job.

The checksum is an opaque string; nothing parses it as a digest. The change replaces MD5 with sipHash128 (no OpenSSL, also FixedString(16)) and renames the label prefix to match, the same substitution as #116023. Only the three checksum values in the .reference change. This keeps the test in the FIPS job instead of skipping it there.

Validation: with FIPS mode turned on through OPENSSL_CONF (default_properties = fips=yes; SELECT MD5('1') throws Code: 344 under it), master's test fails with the reported error and the fixed test passes 20/20 with output matching the reference. This config does not load the FIPS provider module, so it is not a full FIPS build. Without FIPS the fixed test passes 50/50 with randomized settings.


Workflow [PR]
Sync PR [sync-upstream/pr/125750]

Version info

  • Merged into: 26.11.1.9-master (included in 26.11 and later)

The test builds the opaque `checksum` string of its Parquet `FILE` tuples
with `MD5`, which throws `SUPPORT_IS_DISABLED` at analysis when OpenSSL
FIPS mode is enabled. The inserts that write the test files then fail and
the whole test fails in the FIPS job, on master too.

`sipHash128` has no OpenSSL dependency and no FIPS check and also returns
`FixedString(16)`, so the value stays a 32-char hex string. The label
prefix is renamed with it. Only the three checksum values in the
reference change. Same substitution as ClickHouse#116023.

Reported on ClickHouse#123788.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (0 findings).
Checked: no other FIPS-gated function (MD5, SHA1, MD4, RIPEMD160) in this test or its siblings 05360/05361;
checksum is a plain string field (Parquet/FileLogicalType.h), so its content is not parsed; the three reference values match an independent computation.

No findings to adjudicate.

Session id: cron:clickhouse-review-slot-11:20261014-083300

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. FIPS mode emulated with OPENSSL_CONF (default_properties = fips=yes); control SELECT MD5('1') throws Code: 344 under it. Master's test then fails every time with Function MD5 is not available in FIPS mode. (SUPPORT_IS_DISABLED).
b Root cause explained? The test builds the opaque checksum string of its FILE tuples with MD5, which throws at analysis in FIPS mode, so the INSERTs never write the Parquet files and every later section fails.
c Fix matches root cause? Yes. MD5 replaced by sipHash128 (no OpenSSL, no FIPS check) at its only call site; no skip tag, no relaxed assertion.
d Test intent preserved / new tests added? Yes. The checksum field is still a per-row string (NULL for one row), and the test now also runs its Parquet FILE coverage in the FIPS job. Test-only fix, so the test itself is the deliverable.
e Both directions demonstrated? Yes, under the emulation: master text FAIL with the reported error; fixed text 20/20 OK with output matching the reference. Without FIPS: 50/50 OK with randomized settings.
f Fix is general across code paths? The only FIPS-refused function in this test; the two sibling tests added with it (05360, 05361) use none.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (test data only). The value stays 32 hex chars and Nullable(String).
h Backward compatible? (maintainer-approved exception only) N/A, test-only change.
i Invariants and contracts preserved? Yes. The round-trip check re-evaluates the same source query and still compares equal; only three reference values change.

Session id: cron:clickhouse-impl-slot-5:20261014-082300

@clickhouse-gh

clickhouse-gh Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [6d3b923]

Summary: ✅


AI Review

Summary

Replaces MD5 with sipHash128 in 05359_parquet_file_logical_type so the Parquet FILE test can run with FIPS enabled, and updates the three expected checksum strings. No actionable findings.

Missing context / blind spots
  • ⚠️ The complete stateless test and a full FIPS-provider build were not rerun locally; no ClickHouse binary is available in this checkout. Runtime evidence comes from the author's documented before/after FIPS emulation runs. Full FIPS-job results would provide independent confirmation. The three changed reference hashes were independently verified.
Final Verdict

Status: ✅ Approve.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Oct 14, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @al13n321, could you review this? The test built its opaque Parquet FILE checksum string with MD5, which throws SUPPORT_IS_DISABLED in FIPS builds; it now uses sipHash128, and only the three checksum values in the reference change.

@alexey-milovidov alexey-milovidov self-assigned this Oct 15, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 15, 2026
Merged via the queue into ClickHouse:master with commit ffaef6a Oct 15, 2026
520 of 522 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 15, 2026
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-ClickHouse__ClickHouse that referenced this pull request Nov 8, 2026
…ed_keys

The test fingerprints each serialized uniqExact*State as hex(MD5(hex(state))).
MD5 is refused in OpenSSL FIPS mode (FunctionMD5 throws SUPPORT_IS_DISABLED at
analysis), so in a FIPS build the test fails at its first state query
(query 12, line 42) and at every later one.

The digest is incidental: it only compresses a long hex string into a 128-bit
fingerprint. Replace MD5 with sipHash128 at all 69 call sites: it needs no
OpenSSL, exists in every build including Fast test, and returns
FixedString(16) like MD5, so the reference keeps its shape and size. Same
substitution as ClickHouse#125750 and ClickHouse#125527.

The new fingerprints were taken from a run printing both hashes of every
state: all 286 MD5 halves equal the old reference and the old-to-new mapping
is a bijection, so the reference still asserts the same states.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh clickhouse-gh Bot added comp-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). and removed comp-testing Test content only (no production code). labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants