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

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

Merged
merged 2 commits into from
Apr 19, 2017

Conversation

hhonkanen
Copy link
Contributor

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.

…tion is already open on card. This check is performed only if this function is called with empty data. This change fixes a problem with pinpad readers, when PIN cache is disabled and prevents unnecessary PIN queries.
…s are set and keys can be created under specific PINs. Previously keys were always created under PIN 1. Changed description of myeid_create_key function.
@frankmorgner
Copy link
Member

The code looks OK. Can you get confirmation of some other users/maintainers of this card?

@hhonkanen
Copy link
Contributor Author

@viktorTarasov: Please could you take a look at this PR as you have experience with MyEID?
@larssilven: You tested my changes into pkcs15-pin.c couple of months ago with a pinpad reader. Please could you confirm in this thread that it worked as expected?

@larssilven
Copy link
Contributor

Yes it worked as expected.

@frankmorgner frankmorgner merged commit 8cf68bc into OpenSC:master Apr 19, 2017
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

3 participants