Skip to content

Start basic SCT support#423

Merged
ctz merged 6 commits intomainfrom
jbp-sct
Jan 21, 2026
Merged

Start basic SCT support#423
ctz merged 6 commits intomainfrom
jbp-sct

Conversation

@djc
Copy link
Copy Markdown
Member

@djc djc commented Dec 11, 2025

No description provided.

@djc djc requested a review from ctz December 11, 2025 13:01
@djc djc force-pushed the jbp-sct branch 2 times, most recently from 842a112 to e918319 Compare December 11, 2025 13:23
Comment thread src/sct.rs Outdated
Comment on lines +58 to +63
#[allow(dead_code)] // pending sct verification
extensions: untrusted::Input<'a>,
#[allow(dead_code)] // pending sct verification
signature_algorithm: u16,
#[allow(dead_code)] // pending sct verification
signature: untrusted::Input<'a>,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

What kind of verification needs to happen? Thoughts on a testing strategy?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verification here would be a separate feature, taking a set of valid CT logs (their IDs, public keys, etc) and checking each SCT purported to come from a valid known log is correctly signed. Doing this verification is a future upki feature, mainly because tracking "valid CT logs" requires ongoing, current knowledge.

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 96.73203% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.78%. Comparing base (7ee26a7) to head (b963a7c).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/verify_cert.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #423      +/-   ##
==========================================
- Coverage   96.78%   96.78%   -0.01%     
==========================================
  Files          19       20       +1     
  Lines        3797     3950     +153     
==========================================
+ Hits         3675     3823     +148     
- Misses        122      127       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@djc djc changed the title Improve SCT support Start basic SCT support Dec 11, 2025
@djc
Copy link
Copy Markdown
Member Author

djc commented Jan 18, 2026

Need to make sure to fuse the iterator if there's an unrecoverable error.

(Personally not sure I mind Result<Iter<Item = Result<_, _>>> all that much, and I don't think this API will be all that widely used?)

@ctz
Copy link
Copy Markdown
Member

ctz commented Jan 18, 2026

Need to make sure to fuse the iterator if there's an unrecoverable error.

(Personally not sure I mind Result<Iter<Item = Result<_, _>>> all that much, and I don't think this API will be all that widely used?)

What do you think about the opposite change -- Result<Iter<Item = Foo>>? It means it is two pass, but the error handling is much simplified as they happen up-front.

Anyway, not married to this either way.

I have one more addition to make on this PR then we can squash.

@djc
Copy link
Copy Markdown
Member Author

djc commented Jan 18, 2026

Need to make sure to fuse the iterator if there's an unrecoverable error.
(Personally not sure I mind Result<Iter<Item = Result<_, _>>> all that much, and I don't think this API will be all that widely used?)

What do you think about the opposite change -- Result<Iter<Item = Foo>>? It means it is two pass, but the error handling is much simplified as they happen up-front.

Uh, do we allocate after the first pass, or unwrap() during the second? Neither sound all that appealing.

@ctz
Copy link
Copy Markdown
Member

ctz commented Jan 19, 2026

Uh, do we allocate after the first pass, or unwrap() during the second? Neither sound all that appealing.

I was thinking unwrap() -- I have dropped this commit just now.

Comment thread src/trust_anchor.rs

/// Reconstitutes the given trust anchor's SubjectPublicKeyInfo.
#[cfg(feature = "alloc")]
pub fn spki_for_anchor(anchor: &TrustAnchor<'_>) -> SubjectPublicKeyInfoDer<'static> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not really great, but the alternatives don't seem great either:

  • copying der::asn1_wrap into pki-types and having an accessor fn on TrustAnchor
  • moving der::asn1_wrap into pki-types and then reexposing it (though perhaps as a SubjectPublicKeyInfoDer::from_interior_bytes() or whatever)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Seems okay to me. Might be nice if we can move some of this reusable logic into pki-types some day -- I forget the other place recently where I was copying similar stuff around.

Comment thread src/sct.rs Outdated
Comment thread src/sct.rs Outdated
Comment thread src/sct.rs Outdated
Comment thread src/sct.rs Outdated
@djc
Copy link
Copy Markdown
Member Author

djc commented Jan 20, 2026

✅ (I submitted the PR, so can't formally approve).

@ctz ctz enabled auto-merge January 21, 2026 20:29
@ctz ctz self-requested a review January 21, 2026 20:29
@ctz ctz added this pull request to the merge queue Jan 21, 2026
Merged via the queue into main with commit 9780810 Jan 21, 2026
43 of 44 checks passed
@ctz ctz deleted the jbp-sct branch January 21, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants