Improved key file creation with MyEID card to allow creating private keys under specific PINs. A fix to sc_pkcs15_verify_pin when called with empty pin data. #1017
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.
The changes have been tested with a MyEID card. Myeid_create_key has been tested by creating a card with four pins. A key was generated under pin 1 and another key under pin 4. After creation, verified that the correct security attributes were set into both keys.
The change in pkcs15-pin.c was made to fix a problem, which appears when creating objects using C_CreateObject, when pin caching is disabed. With a normal smart card reader, C_CreateObject would fail, because sc_pkcs15_verify_pin was called with empty PIN data, even if C_Login had been called and the required pin had been verified. With a pinpad reader, the user was prompted for pin multiple times. The code has been updated to check the pin verification state if this is possible, and return success if the access condition is already open.