pkcs11: fix translation of SC error to PKCS11

SC error SC_ERROR_WRONG_CARD and SC_ERROR_NO_CARD_SUPPORT are translated as CKR_TOKEN_NOT_RECOGNIZED
This commit is contained in:
Viktor Tarasov 2013-12-04 18:55:37 +01:00
parent 9fdd9ecaeb
commit f43a9fa41c
1 changed files with 2 additions and 0 deletions

View File

@ -75,6 +75,8 @@ static CK_RV sc_to_cryptoki_error_common(int rc)
case SC_ERROR_CARD_NOT_PRESENT:
return CKR_TOKEN_NOT_PRESENT;
case SC_ERROR_INVALID_CARD:
case SC_ERROR_WRONG_CARD:
case SC_ERROR_NO_CARD_SUPPORT:
return CKR_TOKEN_NOT_RECOGNIZED;
case SC_ERROR_WRONG_LENGTH:
return CKR_DATA_LEN_RANGE;