Skip to content

Conversation

@rozbb
Copy link
Contributor

@rozbb rozbb commented Sep 16, 2025

Currently, the validate_chain function in the Merkle Tree Certificate worker does not verify signatures on the provided bootstrap certificate chain (#109). This is not a security issue, but it does mean the log can get spammed easier because it will put obviously bad certificates on the log.

This PR:

  1. Moves the common validation logic from static_ct_api to x509_util
  2. Rewrites domain-specific validation logic as a hook that static_ct_api and mtc_worker give to the generic validator

One question I had: what precisely is validate_correspondence() exposed for? I didn't implement validation there because it had a slightly different type signature, and it didn't look like it was used anywhere. I can def add it if it's needed though.

@lukevalenta lukevalenta self-assigned this Sep 16, 2025
@lukevalenta
Copy link
Contributor

what precisely is validate_correspondence() exposed for?

This is logic that bootstrap MTC clients will need to implement, but only really useful for testing here.

@rozbb rozbb force-pushed the mtc-validate-bootstrap-certs branch from 04d0763 to 620f885 Compare September 16, 2025 22:03
Copy link
Contributor Author

@rozbb rozbb left a comment

Choose a reason for hiding this comment

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

Rebased. Picked up one odd change

@rozbb
Copy link
Contributor Author

rozbb commented Sep 17, 2025

Fixed TODO on validate_correspondence

@lukevalenta lukevalenta added the mtc Merkle Tree Certificates label Sep 25, 2025
Copy link
Contributor

@lukevalenta lukevalenta left a comment

Choose a reason for hiding this comment

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

Just some minor nits, but this looks good!

.into();
} else {
issuer_key_hash = Sha256::digest(
intermediates[0]
Copy link
Contributor

@lukevalenta lukevalenta Sep 25, 2025

Choose a reason for hiding this comment

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

I think here we're not guaranteed that intermediates[0] exists, so might need to grab the found root.

@lukevalenta lukevalenta merged commit 4a791d0 into cloudflare:main Sep 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mtc Merkle Tree Certificates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants