-
Notifications
You must be signed in to change notification settings - Fork 553
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
Add certificate chain flag for signing #1656
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1656 +/- ##
==========================================
+ Coverage 28.08% 29.06% +0.97%
==========================================
Files 139 139
Lines 8025 8189 +164
==========================================
+ Hits 2254 2380 +126
- Misses 5523 5546 +23
- Partials 248 263 +15
Continue to review full report at Codecov.
|
This allows users to pass their own certificate chain to include in the OCI signature. The chain is checked for validity using the provided certificate. Also refactored the check for matching public keys using a method from sigstore/sigstore, comparing the certificate's key with the provided key. Also added this check when extracting the PKCS11 certificate. Certificate chains must be PEM-encoded. I changed the text of the certificate flag to also specify a preference for PEM encoding, but didn't remove the code that handles DER encoding for backwards compatibility. Signed-off-by: Hayden Blauzvern <[email protected]>
c86b2c6
to
5f68ce3
Compare
@dlorenc Are you familiar with |
Signed-off-by: Hayden Blauzvern <[email protected]>
efac45f
to
0e555cc
Compare
Figured out the issue, looks like some part of the script needs a license binary to be installed via |
Signed-off-by: Hayden Blauzvern <[email protected]>
ca03619
to
9892326
Compare
I tested with a couple configurations:
In general, I've noticed the (optional) Perhaps the |
Thanks for testing this out. Currently, with a pkcs11 key, it attempts to fetch a certificate from the token and then returns early. You're correct, it's currently ignoring the cert and cert chain flags. I just need to change it to not exit early. |
* Add certificate chain flag for signing This allows users to pass their own certificate chain to include in the OCI signature. The chain is checked for validity using the provided certificate. Also refactored the check for matching public keys using a method from sigstore/sigstore, comparing the certificate's key with the provided key. Also added this check when extracting the PKCS11 certificate. Certificate chains must be PEM-encoded. I changed the text of the certificate flag to also specify a preference for PEM encoding, but didn't remove the code that handles DER encoding for backwards compatibility. Signed-off-by: Hayden Blauzvern <[email protected]> * Adding 3rd party licenses Signed-off-by: Hayden Blauzvern <[email protected]> * Added check for empty chain Signed-off-by: Hayden Blauzvern <[email protected]>
This allows users to pass their own certificate chain to include in the
OCI signature. The chain is checked for validity using the provided
certificate.
Also refactored the check for matching public keys using a method from
sigstore/sigstore, comparing the certificate's key with the provided
key. Also added this check when extracting the PKCS11 certificate.
Certificate chains must be PEM-encoded. I changed the text of the
certificate flag to also specify a preference for PEM encoding, but
didn't remove the code that handles DER encoding for backwards
compatibility.
Signed-off-by: Hayden Blauzvern [email protected]
Summary
Ticket Link
Ref #1554
Release Note