Set label and ID on PKCS11 EC public key#10954
Open
aidangarske wants to merge 1 commit into
Open
Conversation
aidangarske
commented
Jul 20, 2026
Member
- Fixes wc_ecc_verify_hash returning WC_HW_E on a label/ID-generated PKCS#11 EC key — Pkcs11EcKeyGen set the label/ID only on the private key, so verify couldn't find the public key object. Now sets them on the public key template too.
- Caught here: https://github.com/aidangarske/wolfssl-examples/blob/cb15c8dec3cbf8e7d9ada7f6edb3d0301c5cfe3e/.github/examples-manifest.yml#L1415 checked here https://github.com/wolfSSL/wolfssl-examples/actions/runs/29779301218/job/88477936034?pr=598 currently suppressed till merged
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a PKCS#11 ECDSA verification failure when using an EC key generated with a label/ID: the generated public-key object is destroyed after export, so later verification cannot find a token-resident public key by label/ID and returns WC_HW_E.
Changes:
- Reorders public-key selection in
Pkcs11ECDSA_Verify()to prefer creating a session public-key object from the exported ECC point before trying label-based lookup. - Adds an explanatory comment documenting why the exported point is preferred in this scenario.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… lookup finds none
aidangarske
force-pushed
the
pkcs11-ecc-pubkey-label
branch
from
July 20, 2026 21:35
01daa90 to
dc491c4
Compare
aidangarske
marked this pull request as ready for review
July 20, 2026 22:08
|
retest this please |
padelsbach
approved these changes
Jul 22, 2026
Member
Author
|
Jenkins retest this please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.