Skip to content

Conversation

@achamayou
Copy link
Member

@achamayou achamayou commented Dec 8, 2025

Follow up to #7508 and hopefully last round of cleanups for clang-tidy.

This turned up an unfortunate and embarrassing mistake in the commit evidence derivation (ledger_secret.h), where we only use the first 8 characters of the label. This is luckily of no security consequence, since we only use this one derivation at the moment, but I have added comments to highlight this if we ever add more.

Contains a very small adjustment in the public hmac API (vector to span) that I claim is small enough no to warrant a changelog entry (it is API compatible for all plausible API usage).

@achamayou achamayou added the run-long-test Run Long Test job label Dec 9, 2025
@achamayou achamayou marked this pull request as ready for review December 9, 2025 20:34
@achamayou achamayou requested a review from a team as a code owner December 9, 2025 20:34
Copilot AI review requested due to automatic review settings December 9, 2025 20:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR performs comprehensive clang-tidy cleanup following PR #7508. The key changes include:

  • Critical fix: Corrected commit secret derivation in ledger_secret.h to use the full label instead of only 8 characters (though noted as having no security consequence in current usage)
  • API improvement: Changed HMAC API to accept std::span instead of std::vector for better flexibility
  • Code quality improvements: Applied extensive clang-tidy suggestions including proper initialization, const correctness, [[nodiscard]] attributes, simplified control flow, and modern C++ idioms

Reviewed changes

Copilot reviewed 72 out of 72 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/node/ledger_secret.h Fixed commit secret label usage (critical bug fix) and changed to use std::span
src/crypto/hmac.cpp Updated HMAC implementation to accept std::span parameters
include/ccf/crypto/hmac.h Changed HMAC API signature from vector to span
doc/build_apps/crypto.rst Updated documentation to reflect new HMAC signature
.clang-tidy Simplified HeaderFilterRegex pattern
src/node/*.h Applied clang-tidy cleanups: initialization, const correctness, [[nodiscard]], std::move()
src/kv/*.h Applied similar cleanups to KV store components
src/js/*.h Applied cleanups to JavaScript integration components
Multiple other files Extensive cleanup including: default member initialization, simplified else-after-return, range-based loops, proper casting, override specifiers

Copy link
Member

@eddyashton eddyashton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've skimmed this up and down and side-to-side a few times until my eyes glaze over, and it "looks good to me" (for fuzzy values of "looks", "good", and "me"). Hurrah for never thinking about tidy ever again!

@achamayou achamayou merged commit 49cec19 into main Dec 10, 2025
34 checks passed
@achamayou achamayou deleted the final_tidy branch December 10, 2025 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-long-test Run Long Test job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants