Added an error code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1634 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
1435c8fcce
commit
30fba619b9
|
@ -70,6 +70,7 @@ const char *sc_strerror(int error)
|
||||||
"Command too long",
|
"Command too long",
|
||||||
"Buffer too small",
|
"Buffer too small",
|
||||||
"Invalid PIN length",
|
"Invalid PIN length",
|
||||||
|
"Invalid data",
|
||||||
};
|
};
|
||||||
const int arg_base = -SC_ERROR_INVALID_ARGUMENTS;
|
const int arg_base = -SC_ERROR_INVALID_ARGUMENTS;
|
||||||
const char *int_errors[] = {
|
const char *int_errors[] = {
|
||||||
|
|
|
@ -71,6 +71,7 @@ extern "C" {
|
||||||
#define SC_ERROR_CMD_TOO_LONG -1302
|
#define SC_ERROR_CMD_TOO_LONG -1302
|
||||||
#define SC_ERROR_BUFFER_TOO_SMALL -1303
|
#define SC_ERROR_BUFFER_TOO_SMALL -1303
|
||||||
#define SC_ERROR_INVALID_PIN_LENGTH -1304
|
#define SC_ERROR_INVALID_PIN_LENGTH -1304
|
||||||
|
#define SC_ERROR_INVALID_DATA -1305
|
||||||
|
|
||||||
/* Resulting from OpenSC internal operation */
|
/* Resulting from OpenSC internal operation */
|
||||||
#define SC_ERROR_INTERNAL -1400
|
#define SC_ERROR_INTERNAL -1400
|
||||||
|
|
|
@ -68,6 +68,8 @@ CK_RV sc_to_cryptoki_error(int rc, int reader)
|
||||||
return CKR_PIN_INVALID;
|
return CKR_PIN_INVALID;
|
||||||
case SC_ERROR_INVALID_ARGUMENTS:
|
case SC_ERROR_INVALID_ARGUMENTS:
|
||||||
return CKR_ARGUMENTS_BAD;
|
return CKR_ARGUMENTS_BAD;
|
||||||
|
case SC_ERROR_INVALID_DATA:
|
||||||
|
return CKR_DATA_INVALID;
|
||||||
}
|
}
|
||||||
sc_debug(context, "opensc error: %s (%d)\n", sc_strerror(rc), rc);
|
sc_debug(context, "opensc error: %s (%d)\n", sc_strerror(rc), rc);
|
||||||
return CKR_GENERAL_ERROR;
|
return CKR_GENERAL_ERROR;
|
||||||
|
|
Loading…
Reference in New Issue