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

Fix FileSystemSigner with PKCS#12 files #97

Merged
merged 1 commit into from
Feb 13, 2025
Merged

Fix FileSystemSigner with PKCS#12 files #97

merged 1 commit into from
Feb 13, 2025

Conversation

13ajay
Copy link
Contributor

@13ajay 13ajay commented Jan 15, 2025

  • Use *rsa.PrivateKey and *ec.PrivateKey types across the project to maintain consistency
  • Refactor Makefile so that it's easy to run the subset of tests that don't require non-trivial dependencies

We may also want to change sign-string so that paths to PKCS#12 files can be passed in using the --private-key flag. Currently, the --certificate flag has to be used (even if the container only contains a private key).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

* Use *rsa.PrivateKey and *ec.PrivateKey types across the project to
  maintain consistency
* Refactor Makefile so that it's easy to run the subset of tests that
  don't require non-trivial dependencies
.PHONY: test
test: test-certs
go test ./... -list . | grep -E '^Test[a-zA-Z0-9]+' | grep -vE 'TPMSigner|PKCS11Signer' | tr '\n' '|' | sed 's/|$$//' | xargs -t go test ./... -run

define CERT_RECIPE
@SUBJ=$$(echo "$@" | sed 's^\(.*/\)\?\([^/]*\)-cert.pem^\2^'); \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sed command does not seem to remove the -cert.pem suffix from the filename

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me when using GNU sed (maybe you're using BSD sed?). As an example:

% echo "tst/certs/rsa-1024-md5-cert.pem" | sed 's^\(.*/\)\?\([^/]*\)-cert.pem^\2^'
rsa-1024-md5

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I just confirmed that it works when using GNU sed.

Copy link

@030emily 030emily left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve

@13ajay 13ajay merged commit 1ec0609 into main Feb 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants