-
-
Notifications
You must be signed in to change notification settings - Fork 6
feat: Add cert-tools binary #638
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
base: main
Are you sure you want to change the base?
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.
Just a partial review while on mobile.
Will do a proper one tomorrow.
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
const HEADER: &[u8] = b"-----BEGIN CERTIFICATE-----"; | ||
const FOOTER: &[u8] = b"-----END CERTIFICATE-----"; |
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.
There are a few variations of the header/footer: See: https://github.com/openssl/openssl/blob/ea85fbce9fac7bf87c5c0a82151dbde259bbfc4f/include/openssl/pem.h#L35-L62
At least we might care about:
BEGIN CERTIFICATE
BEGIN RSA PUBLIC KEY
BEGIN ECDSA PUBLIC KEY
Same for END
.
I left out legacy stuff like BEGIN DSA PUBLIC 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.
note: I copied that from existing code.
Also, https://docs.rs/openssl/latest/openssl/x509/struct.X509.html#method.from_pem states:
The input should have a header of -----BEGIN CERTIFICATE-----.
As we stuff the result into that openssl function, this is definitely not ideal but worked so far fine.
The good thing is that the SDP has most PEM files under it's own control, only rarely users add certificates to it.
Are you ok with merging as-is and improving it in case it causes any trouble? But I only see the option of adding error handling, as the openssl function seems to require this specific header
Co-authored-by: Nick <[email protected]>
Co-authored-by: Nick <[email protected]>
Co-authored-by: Nick <[email protected]>
Co-authored-by: Nick <[email protected]>
Description
Part of stackabletech/issues#764
Example usage
Definition of Done Checklist
Author
Reviewer
Acceptance
type/deprecation
label & add to the deprecation scheduletype/experimental
label & add to the experimental features tracker