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

PKCS11 signing support #985

Merged
merged 10 commits into from Nov 6, 2021
Merged

PKCS11 signing support #985

merged 10 commits into from Nov 6, 2021

Conversation

garantir-km
Copy link
Contributor

Summary

This PR provides support for PKCS11 tokens. The implementation relies on PKCS11 URIs, which makes it possible to use PKCS11 backed keys without adding extra flags and logic to cosign.

The PR also provides a new tool called pkcs11-tool which allows for retrieval of the PKCS11 URIs for keys in a particular token.

Ticket Link

This PR is in relation with #396.

Release Notes

- Added support for PKCS11 tokens by leveraging PKCS11 URIs.
- Added a new tool `pkcs11-tool` to allow for the retrieval of PKCS11 URIs.

Signed-off-by: Kieran Miller kieran.miller@garantir.io

Signed-off-by: Kieran Miller <kieran.miller@garantir.io>
Signed-off-by: Kieran Miller <kieran.miller@garantir.io>
Signed-off-by: Kieran Miller <kieran.miller@garantir.io>
Copy link
Contributor

@hectorj2f hectorj2f left a comment

Choose a reason for hiding this comment

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

@garantir-km how feasible would it be to add some tests using SoftHSM like done here https://github.com/miekg/pkcs11/blob/master/parallel_test.go ?

@garantir-km
Copy link
Contributor Author

@hectorj2f I think I can add some tests to validate both the PKCS11 URI implementation and the PKCS11 implementation of the Signer interface.

garantir-km and others added 5 commits November 3, 2021 12:48
Added PKCS11 tests.

Signed-off-by: Kieran Miller <kieran.miller@garantir.io>
Signed-off-by: Kieran Miller <kieran.miller@garantir.io>
Signed-off-by: Kieran Miller <kieran.miller@garantir.io>
Signed-off-by: Kieran Miller <kieran.miller@garantir.io>
Signed-off-by: Kieran Miller <kieran.miller@garantir.io>
@garantir-km
Copy link
Contributor Author

@hectorj2f hopefully all workflows will pass now

@zosocanuck
Copy link

zosocanuck commented Nov 5, 2021

I was successfully able to test against SoftHSM v2.5.0 with RSA.

@dlorenc
Copy link
Member

dlorenc commented Nov 5, 2021

One nit about doing the URI switching in a slightly lower level, I think that will reduce duplication in the verify and verify attestation commands as well.

Copy link
Contributor

@hectorj2f hectorj2f left a comment

Choose a reason for hiding this comment

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

lgtm, and works for me using softhsm2

Signed-off-by: Kieran Miller <kieran.miller@garantir.io>
@dlorenc
Copy link
Member

dlorenc commented Nov 6, 2021

Thank you! Lgtm when tests pass!

@dlorenc dlorenc merged commit 7066f12 into sigstore:main Nov 6, 2021
@github-actions github-actions bot added this to the v1.3.0 milestone Nov 6, 2021
@cpanato cpanato modified the milestones: v1.3.0, v1.4.0, v1.3.1 Nov 7, 2021
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.

None yet

5 participants