-
Notifications
You must be signed in to change notification settings - Fork 250
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
Update ctclient to support SCT extensions #1645
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
1782a3b
to
e877abf
Compare
/gcbrun |
Thanks a lot for sending this! |
@phbnf Thank you for the review. I'll update the patch later, but maybe a bit slow because I'll be busy during the coming Spring Festival holidays. Cheers. |
e877abf
to
2eac070
Compare
According to RFC 6962 (Section 3.4), the 'extensions' field defined for SCT is also included in 'MerkleTreeLeaf.TimestampedEntry'. Since the current MerkleTreeLeaf functions (e.g., CreateX509MerkleTreeLeaf()) don't support to specify this field, we need to manually fill it in order to calculate the correct leaf hash. As suggested, we chose not to change the signatures of those functions to avoid breaking external dependencies. * Update LogClient.VerifySCTSignature() to fill the 'extensions' field from 'sct.Extensions'. * Update ctclient's get-entries command to print the extensions if non-empty, which can be parsed by the 'get-inclusion-proof' command similar to the 'timestamp' field for convenience. * Update ctclient's upload command to calculate the leaf hash with the 'sct.Extensions'; also print the SCT extensions as hex string in the end, which may be used by the 'get-inclusion-proof' command. * Update ctclient's get-inclusion-proof command to add the '--extensions' flag to specify the SCT extensions returned by 'upload' command. Signed-off-by: Aaron LI <aaronly.me@gmail.com>
Signed-off-by: Aaron LI <aaronly.me@gmail.com>
b4168d4
to
26cc158
Compare
Hi @phbnf, I've updated and rebased the patch. Please have another look. Thank you. |
/gcbrun |
According to RFC 6962 (Section 3.4), the
extensions
field defined for SCT is also included inMerkleTreeLeaf.TimestampedEntry
. So, the functions that build theMerkleTreeLeaf
struct are required to accept theextensions
parameter to fill this field.Although RFC 6962 itself specified no extensions, the Static CT API v1.0.0 defined the
leaf_index(0)
SCT extension. With a CT deployment based on Sunlight and Sunglasses, thectclient get-inclusion-proof
was failing because of the wrong leaf hash. With this patch, bothctclient upload
andctclient get-inclusion-proof
work as expected.Example 1:
Example 2:
Checklist