Skip to content
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

Refactor self-signed signature handling #74

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

atc0005
Copy link
Owner

@atc0005 atc0005 commented Dec 9, 2024

These changes are borrowed from the atc0005/check-cert project where work is underway towards implementing upcoming chain order validation support.

  • add new helper functions
    • certs.verifySignature
    • certs.verifySignatureMD5WithRSA
    • certs.verifySignatureSHA1WithRSA
    • certs.verifySignatureECDSAWithSHA1
  • remove `certs.isSelfSignedMD5WithRSA helper func
  • refactor certs.isSelfSigned to drop use of that func and use certs.verifySignature helper func directly
  • add certs.verifySignature func to act as entry point for all signature verification work calling out to algorithm-specific helper functions as needed
  • update/add nolint:gosec directives

NOTE: I have not tested the certs.verifySignatureECDSAWithSHA1 function as I do not have a certificate with signature algorithm of ECDSAWithSHA1 to test with.

These changes are borrowed from the atc0005/check-cert project
where work is underway towards implementing upcoming chain
order validation support.

- add new helper functions
  - `certs.verifySignature`
  - `certs.verifySignatureMD5WithRSA`
  - `certs.verifySignatureSHA1WithRSA`
  - `certs.verifySignatureECDSAWithSHA1`
- remove `certs.isSelfSignedMD5WithRSA helper func
- refactor `certs.isSelfSigned` to drop use of that func and
  use `certs.verifySignature` helper func directly
- add `certs.verifySignature` func to act as entry point for
  all signature verification work calling out to algorithm-specific
  helper functions as needed
- update/add `nolint:gosec` directives

NOTE: I have *not* tested the `certs.verifySignatureECDSAWithSHA1`
function as I do not have a certificate with signature algorithm
of `ECDSAWithSHA1` to test with.
@atc0005 atc0005 added this to the v0.7.1-alpha.1 milestone Dec 9, 2024
@atc0005 atc0005 self-assigned this Dec 9, 2024
@atc0005 atc0005 merged commit 398bbe5 into development Dec 9, 2024
29 checks passed
@atc0005 atc0005 deleted the refactor-self-signed-signature-handling branch December 9, 2024 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant