-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signed Certificate Timestamp verification #326
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll work on adding SCT to the verification flow once we get #311 merged. I think this is ready for a first pass :)
// TODO(tnytown): Migrate to const-oid's CT_PRECERT_SCTS when a new release is cut. | ||
const CT_PRECERT_SCTS: ObjectIdentifier = ObjectIdentifier::new_unwrap("1.3.6.1.4.1.11129.2.4.2"); | ||
const PRECERTIFICATE_SIGNING_CERTIFICATE: ObjectIdentifier = | ||
ObjectIdentifier::new_unwrap("1.3.6.1.4.1.11129.2.4.4"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const-oid
0.10
should include these OIDs, but isn't released yet
}; | ||
|
||
match (algo, params) { | ||
// TODO(tnytown): should we also accept ed25519, p384, ... ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only saw p256 SCTs while testing this changeset against the public-good prod and staging, do we need to support other key types?
0501ffc
to
be5f3fc
Compare
773490d
to
2c8a320
Compare
This is ready for review, but we should get #311 in first. |
739b4b4
to
4180b1f
Compare
c9ad592
to
d4d74f7
Compare
@tnytown is this one ready to be reviewed? |
310fff3
to
76992cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flagging some expect
s for review!
), | ||
fingerprint: { | ||
let mut hasher = sha2::Sha256::new(); | ||
spki.encode(&mut hasher).expect("failed to hash key!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This expect
should be safe: the only error that encode
should return in this context is IO-related (and hasher
shouldn't ever refuse a write.)
tbs_precert | ||
.encode_to_vec(&mut tbs_precert_der) | ||
.expect("failed to re-encode Precertificate!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This encode_to_vec
shouldn't be fallible: all we've done to the tbsCertificate is removed an extension, and it previously decoded correctly.
Yes, thanks for the ping @flavio! |
Co-authored-by: Alex Cameron <alex.cameron@trailofbits.com> Signed-off-by: Andrew Pan <andrew.pan@trailofbits.com>
@flavio gentle ping on this PR :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I left two minor suggestions.
Co-authored-by: Flavio Castelli <flavio@castelli.me> Signed-off-by: Andrew Pan <3821575+tnytown@users.noreply.github.com>
@flavio I applied the changes, thanks! Let me know if there's anything else you need. |
I think it’s all good. Can you file some issues to keep track of the few TODOs that are left? |
Blocked on #311.Summary
Adds Signed Certificate Timestamp verification and hooks it up to the bundle signing flow. SCT verification ensures that the signing certificate in a given operation has been submitted to the Certificate Transparency log, which aids in the detection of malicious certificates and keeps Certificate Authorities like Fulcio honest.
Release Note
Documentation
No user-facing documentation needed, we automatically perform SCT validation when public
sign
andverify
APIs are used.