2002-04-05 15:06:33 +00:00
|
|
|
/*
|
|
|
|
* errors.h: OpenSC error codes
|
|
|
|
*
|
2006-12-19 21:31:17 +00:00
|
|
|
* Copyright (C) 2001, 2002 Juha Yrjölä <juha.yrjola@iki.fi>
|
2002-04-05 15:06:33 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2002-04-06 12:02:28 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2002-04-05 15:06:33 +00:00
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2002-04-06 12:02:28 +00:00
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2002-04-05 15:06:33 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _OPENSC_ERRORS_H
|
|
|
|
#define _OPENSC_ERRORS_H
|
|
|
|
|
2005-02-02 10:21:10 +00:00
|
|
|
#ifdef __cplusplus
|
2002-04-19 14:23:31 +00:00
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2002-04-05 15:06:33 +00:00
|
|
|
#define SC_SUCCESS 0
|
|
|
|
|
2002-04-06 12:02:28 +00:00
|
|
|
/* Errors related to reader operation */
|
|
|
|
#define SC_ERROR_READER -1100
|
|
|
|
#define SC_ERROR_NO_READERS_FOUND -1101
|
2010-08-23 10:32:21 +00:00
|
|
|
/* Unused: -1102 */
|
|
|
|
/* Unused: -1103 */
|
2002-04-06 12:02:28 +00:00
|
|
|
#define SC_ERROR_CARD_NOT_PRESENT -1104
|
|
|
|
#define SC_ERROR_CARD_REMOVED -1105
|
|
|
|
#define SC_ERROR_CARD_RESET -1106
|
|
|
|
#define SC_ERROR_TRANSMIT_FAILED -1107
|
2002-12-23 18:47:27 +00:00
|
|
|
#define SC_ERROR_KEYPAD_TIMEOUT -1108
|
|
|
|
#define SC_ERROR_KEYPAD_CANCELLED -1109
|
|
|
|
#define SC_ERROR_KEYPAD_PIN_MISMATCH -1110
|
2010-08-23 10:32:21 +00:00
|
|
|
#define SC_ERROR_KEYPAD_MSG_TOO_LONG -1111
|
2003-01-03 16:30:28 +00:00
|
|
|
#define SC_ERROR_EVENT_TIMEOUT -1112
|
2003-02-19 13:36:58 +00:00
|
|
|
#define SC_ERROR_CARD_UNRESPONSIVE -1113
|
2003-04-11 14:42:16 +00:00
|
|
|
#define SC_ERROR_READER_DETACHED -1114
|
|
|
|
#define SC_ERROR_READER_REATTACHED -1115
|
2010-01-15 09:45:11 +00:00
|
|
|
#define SC_ERROR_READER_LOCKED -1116
|
2002-04-06 12:02:28 +00:00
|
|
|
|
|
|
|
/* Resulting from a card command or related to the card*/
|
|
|
|
#define SC_ERROR_CARD_CMD_FAILED -1200
|
|
|
|
#define SC_ERROR_FILE_NOT_FOUND -1201
|
|
|
|
#define SC_ERROR_RECORD_NOT_FOUND -1202
|
|
|
|
#define SC_ERROR_CLASS_NOT_SUPPORTED -1203
|
|
|
|
#define SC_ERROR_INS_NOT_SUPPORTED -1204
|
|
|
|
#define SC_ERROR_INCORRECT_PARAMETERS -1205
|
|
|
|
#define SC_ERROR_WRONG_LENGTH -1206
|
|
|
|
#define SC_ERROR_MEMORY_FAILURE -1207
|
|
|
|
#define SC_ERROR_NO_CARD_SUPPORT -1208
|
|
|
|
#define SC_ERROR_NOT_ALLOWED -1209
|
|
|
|
#define SC_ERROR_INVALID_CARD -1210
|
|
|
|
#define SC_ERROR_SECURITY_STATUS_NOT_SATISFIED -1211
|
|
|
|
#define SC_ERROR_AUTH_METHOD_BLOCKED -1212
|
|
|
|
#define SC_ERROR_UNKNOWN_DATA_RECEIVED -1213
|
|
|
|
#define SC_ERROR_PIN_CODE_INCORRECT -1214
|
|
|
|
#define SC_ERROR_FILE_ALREADY_EXISTS -1215
|
2003-10-30 17:03:09 +00:00
|
|
|
#define SC_ERROR_DATA_OBJECT_NOT_FOUND -1216
|
2010-01-23 19:12:52 +00:00
|
|
|
#define SC_ERROR_NOT_ENOUGH_MEMORY -1217
|
2011-04-27 14:28:03 +00:00
|
|
|
#define SC_ERROR_CORRUPTED_DATA -1218
|
|
|
|
#define SC_ERROR_FILE_END_REACHED -1219
|
2012-10-14 12:35:46 +00:00
|
|
|
#define SC_ERROR_REF_DATA_NOT_USABLE -1220
|
2002-04-06 12:02:28 +00:00
|
|
|
|
|
|
|
/* Returned by OpenSC library when called with invalid arguments */
|
|
|
|
#define SC_ERROR_INVALID_ARGUMENTS -1300
|
2010-08-23 10:32:21 +00:00
|
|
|
/* Unused: -1301 */
|
|
|
|
/* Unused: -1302 */
|
2002-04-06 12:02:28 +00:00
|
|
|
#define SC_ERROR_BUFFER_TOO_SMALL -1303
|
|
|
|
#define SC_ERROR_INVALID_PIN_LENGTH -1304
|
2003-11-23 15:33:56 +00:00
|
|
|
#define SC_ERROR_INVALID_DATA -1305
|
2002-04-06 12:02:28 +00:00
|
|
|
|
|
|
|
/* Resulting from OpenSC internal operation */
|
|
|
|
#define SC_ERROR_INTERNAL -1400
|
|
|
|
#define SC_ERROR_INVALID_ASN1_OBJECT -1401
|
|
|
|
#define SC_ERROR_ASN1_OBJECT_NOT_FOUND -1402
|
|
|
|
#define SC_ERROR_ASN1_END_OF_CONTENTS -1403
|
|
|
|
#define SC_ERROR_OUT_OF_MEMORY -1404
|
|
|
|
#define SC_ERROR_TOO_MANY_OBJECTS -1405
|
|
|
|
#define SC_ERROR_OBJECT_NOT_VALID -1406
|
|
|
|
#define SC_ERROR_OBJECT_NOT_FOUND -1407
|
|
|
|
#define SC_ERROR_NOT_SUPPORTED -1408
|
2002-04-17 08:55:39 +00:00
|
|
|
#define SC_ERROR_PASSPHRASE_REQUIRED -1409
|
2012-05-29 09:29:44 +00:00
|
|
|
#define SC_ERROR_INCONSISTENT_CONFIGURATION -1410
|
2002-04-23 08:17:06 +00:00
|
|
|
#define SC_ERROR_DECRYPT_FAILED -1411
|
2003-07-14 16:56:38 +00:00
|
|
|
#define SC_ERROR_WRONG_PADDING -1412
|
2003-07-16 15:17:57 +00:00
|
|
|
#define SC_ERROR_WRONG_CARD -1413
|
2003-10-21 11:11:19 +00:00
|
|
|
#define SC_ERROR_CANNOT_LOAD_MODULE -1414
|
2006-04-03 10:42:00 +00:00
|
|
|
#define SC_ERROR_OFFSET_TOO_LARGE -1415
|
2009-11-13 19:01:21 +00:00
|
|
|
#define SC_ERROR_NOT_IMPLEMENTED -1416
|
2018-05-26 22:38:37 +00:00
|
|
|
#define SC_ERROR_INVALID_TLV_OBJECT -1417
|
|
|
|
#define SC_ERROR_TLV_END_OF_CONTENTS -1418
|
2002-04-06 12:02:28 +00:00
|
|
|
|
|
|
|
/* Relating to PKCS #15 init stuff */
|
|
|
|
#define SC_ERROR_PKCS15INIT -1500
|
|
|
|
#define SC_ERROR_SYNTAX_ERROR -1501
|
|
|
|
#define SC_ERROR_INCONSISTENT_PROFILE -1502
|
2002-04-17 20:42:54 +00:00
|
|
|
#define SC_ERROR_INCOMPATIBLE_KEY -1503
|
2002-12-04 09:26:40 +00:00
|
|
|
#define SC_ERROR_NO_DEFAULT_KEY -1504
|
2011-03-06 11:34:58 +00:00
|
|
|
#define SC_ERROR_NON_UNIQUE_ID -1505
|
2010-08-23 10:32:21 +00:00
|
|
|
#define SC_ERROR_CANNOT_LOAD_KEY -1506
|
|
|
|
/* Unused: -1007 */
|
|
|
|
#define SC_ERROR_TEMPLATE_NOT_FOUND -1508
|
|
|
|
#define SC_ERROR_INVALID_PIN_REFERENCE -1509
|
|
|
|
#define SC_ERROR_FILE_TOO_SMALL -1510
|
2002-04-06 12:02:28 +00:00
|
|
|
|
2011-05-13 12:50:24 +00:00
|
|
|
/* Related to secure messaging */
|
2013-01-06 15:38:33 +00:00
|
|
|
#define SC_ERROR_SM -1600
|
|
|
|
#define SC_ERROR_SM_ENCRYPT_FAILED -1601
|
|
|
|
#define SC_ERROR_SM_INVALID_LEVEL -1602
|
|
|
|
#define SC_ERROR_SM_NO_SESSION_KEYS -1603
|
|
|
|
#define SC_ERROR_SM_INVALID_SESSION_KEY -1604
|
|
|
|
#define SC_ERROR_SM_NOT_INITIALIZED -1605
|
|
|
|
#define SC_ERROR_SM_AUTHENTICATION_FAILED -1606
|
|
|
|
#define SC_ERROR_SM_RAND_FAILED -1607
|
|
|
|
#define SC_ERROR_SM_KEYSET_NOT_FOUND -1608
|
|
|
|
#define SC_ERROR_SM_IFD_DATA_MISSING -1609
|
|
|
|
#define SC_ERROR_SM_NOT_APPLIED -1610
|
|
|
|
#define SC_ERROR_SM_SESSION_ALREADY_ACTIVE -1611
|
|
|
|
#define SC_ERROR_SM_INVALID_CHECKSUM -1612
|
2011-05-13 12:50:24 +00:00
|
|
|
|
2002-04-06 12:02:28 +00:00
|
|
|
/* Errors that do not fit the categories above */
|
|
|
|
#define SC_ERROR_UNKNOWN -1900
|
|
|
|
#define SC_ERROR_PKCS15_APP_NOT_FOUND -1901
|
2002-04-05 15:06:33 +00:00
|
|
|
|
2002-04-19 14:23:31 +00:00
|
|
|
const char *sc_strerror(int sc_errno);
|
|
|
|
|
2005-02-02 10:21:10 +00:00
|
|
|
#ifdef __cplusplus
|
2002-04-19 14:23:31 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2002-04-05 15:06:33 +00:00
|
|
|
#endif
|