Repository navigation
Support verifying embedded SCTs - #84
Conversation
|
I’d recommend continuing to support both detached and embedded SCTs. While the production environment will embed them, organizations may run their own instances of fulcio in a mode that only supports detached SCTs |
Makes sense. Any thoughts on a search priority between the two? In other words, should we check for the sidecar version first and only fall back on the embedded path if it's not present, or should we opportunistically search for the embedded SCT? |
|
Preferring embedded is probably the preferred approach since that'll be what's used in the community instance, and we haven't seen many examples of self-hosted Fulcio instances yet. |
Signed-off-by: William Woodruff <[email protected]>
|
Blocked on pyca/cryptography#7237 for |
|
@tetsuo-cpp in terms of verifying the embedded SCT: you might also find the code that does that for Chrome helpful: https://source.chromium.org/chromium/chromium/src/+/main:net/cert/ct_serialization.cc;l=258-284;drc=8a609a649e36c8099c6801d41aca1ec3b0b3af73;bpv=1;bpt=1 |
Signed-off-by: William Woodruff <[email protected]>
|
Still not sure what's going on. I've opened #7267 for visibility as well. Firstly, I verified that the TBS precertificate with the SCT list extension generated by this code is identical to what is produced by Then I generated the entire digitally signed struct (the payload for the signature) in These are some possibilities for what is wrong:
|
I agree this is unlikely. The only reason that the issuer would differ between the precert and cert is in the case where the CA has issued a special signing certificate that only signs precerts. We don't use this, the same CA certificate signs both the precert and certificate.
I'm assuming you're testing against fulcio.sigstage.dev, and if so, this would be correct.
This could be a possibility. If you want to test if this is working with ECDSA signature instead, you could spin up your own local instance of Fulcio with Some random guesses:
|
This is a good candidate; I'll look into this 🙂 The entry type should be correct, since we're no longer hardcoding |
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
|
Just dumping for context: this is how I've added a development build of LDFLAGS="-L$(brew --prefix [email protected])/lib" \
CFLAGS="-I$(brew --prefix [email protected])/include" \
pip install --editable git+https://github.com/trail-of-forks/cryptography.git@alex/tbs-precert#egg=cryptography |
Confirmed this: |
|
More braindump: here's how |
Signed-off-by: William Woodruff <[email protected]>
I just dumped our reconstructed |
Also if I run |
Where should the log ID be included in the digitally-signed payload? I see it in the SCT structure, but not in the |
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
I can remove this and redo it as part of #27 if that works for you. I think it's still useful to have a |
Sounds good! Let's prioritize the |
|
I'll resolve these conflicts in just a moment. Let's get the |
|
Needs rebase, but otherwise the only thing blocking this is an upstream release of |
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
|
We've hacked around the upstream requirements, for now. I'm going to push up some more changes to properly mark each hack, so that we can easily undo them later. |
Signed-off-by: William Woodruff <[email protected]>
woodruffw
left a comment
There was a problem hiding this comment.
Provisionally approving, but @di and @tetsuo-cpp please review one last time!
(I've tested these changes locally and can confirm that sigstore sign and sigstore sign --staged both work. I don't know of a non-embedded SCT instance to test against any more, but these changes should work with one.)
Signed-off-by: William Woodruff <[email protected]>
tetsuo-cpp
left a comment
There was a problem hiding this comment.
LGTM! GH won't let me approve this since I opened the PR but the temporary changes you added look fine.
* Adding several bundle tests: - Ensure production trust bundle that doesn't validate staging - Ensure we can't swap in a signed entry timestamp from the future - Ensure we can detect modifications to the message signature and digest Signed-off-by: Zach Steindler <[email protected]> * Fixing type errors from linter Signed-off-by: Zach Steindler <[email protected]> --------- Signed-off-by: Zach Steindler <[email protected]>
Closes #30
Closes #95