createca: Address panic when no private key pair matches #351
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
While following https://github.com/lukehinds/sigstore-the-hard-way - I managed to trigger a panic by running:
go run . createca --org=acme --country=USA --locality=Anytown --province=AnyPlace --postal-code=ABCDEF --street-address=123 Main St --hsm-caroot-id 0 --out fulcio-root.pem
which resulted in the following output:
I wasn't sure how to interpret this, so I dove into the source code and discovered that PKCS11CA was a label, rather than a key type or format. Apparently, the tutorial uses a label of "FulcioCA", whereas fulcio expected "PKCS11CA" (this may just be a HEAD vs latest release change).
This PR catches the unhandled panic and makes the underlying issue a little bit more clear:
Release Note