globalplatform
errorcodes.h
Go to the documentation of this file.
1 /* Copyright (c) 2009, Karsten Ohme
2  * This file is part of GlobalPlatform.
3  *
4  * GlobalPlatform is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * GlobalPlatform is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with GlobalPlatform. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
22 // Self defined errors.
23 #define OPGP_ERROR_SUCCESS 0
24 #define OPGP_ERROR_UNRECOGNIZED_APDU_COMMAND ((DWORD)0x80301000L)
25 #define OPGP_ERROR_CARD_CRYPTOGRAM_VERIFICATION ((DWORD)0x80302000L)
26 #define OPGP_ERROR_COMMAND_SECURE_MESSAGING_TOO_LARGE ((DWORD)0x80303000L)
27 #define OPGP_ERROR_COMMAND_TOO_LARGE ((DWORD)0x80303001L)
28 #define OPGP_ERROR_INSUFFICIENT_BUFFER ((DWORD)0x80304000L)
29 #define OPGP_ERROR_WRONG_TRY_LIMIT ((DWORD)0x80306000L)
30 #define OPGP_ERROR_WRONG_PIN_LENGTH ((DWORD)0x80307000L)
31 #define OPGP_ERROR_WRONG_KEY_VERSION ((DWORD)0x80308000L)
32 #define OPGP_ERROR_WRONG_KEY_INDEX ((DWORD)0x80309000L)
33 #define OPGP_ERROR_WRONG_KEY_TYPE ((DWORD)0x8030A000L)
34 #define OPGP_ERROR_KEY_CHECK_VALUE ((DWORD)0x8030B000L)
35 #define OPGP_ERROR_INVALID_COMBINATION_KEY_SET_VERSION_KEY_INDEX ((DWORD)0x8030C000L)
36 #define OPGP_ERROR_MORE_KEY_INFORMATION_TEMPLATES ((DWORD)0x8030D000L)
37 #define OPGP_ERROR_APPLICATION_TOO_BIG ((DWORD)0x8030E000L)
38 #define OPGP_ERROR_VALIDATION_FAILED ((DWORD)0x8030F000L)
39 #define OPGP_ERROR_INVALID_FILENAME ((DWORD)0x8030F001L)
40 #define OPGP_ERROR_INVALID_PASSWORD ((DWORD)0x8030F002L)
41 #define OPGP_ERROR_WRONG_EXPONENT ((DWORD)0x8030F003L)
42 #define OPGP_ERROR_INVALID_LOAD_FILE ((DWORD)0x8030F008L)
43 #define OPGP_ERROR_CAP_UNZIP ((DWORD)0x8030F009L)
44 #define OPGP_ERROR_INVALID_RESPONSE_DATA ((DWORD)0x8030F00BL)
45 #define OPGP_ERROR_CRYPT ((DWORD)0x8030F00CL)
46 // Philip Wendland: added this because security level 3 of SCP03 is not supported yet.
47 #define OPGP_ERROR_SCP03_SECURITY_R_ENCRYPTION_R_MAC_NOT_SUPPORTED ((DWORD)0x8030F00EL)
48 
49 /* Open Platform 2.0.1' specific errors */
50 
51 #define OP201_ERROR_LOAD_FILE_DAP_NULL ((DWORD)0x8030F007L)
52 #define OP201_ERROR_MORE_APPLICATION_DATA ((DWORD)0x80305001L)
53 
54 /* GlobalPlatform 2.1.1 specific errors */
55 
56 #define GP211_ERROR_MORE_APPLICATION_DATA ((DWORD)0x80305000L)
57 #define GP211_ERROR_LOAD_FILE_DATA_BLOCK_HASH_NULL ((DWORD)0x8030F004L)
58 #define GP211_ERROR_INVALID_SCP ((DWORD)0x8030F005L)
59 #define GP211_ERROR_INVALID_SCP_IMPL ((DWORD)0x8030F006L)
60 #define GP211_ERROR_VALIDATION_R_MAC ((DWORD)0x8030F007L)
61 #define GP211_ERROR_INCONSISTENT_SCP ((DWORD)0x8030F00AL)
62 #define GP211_ERROR_INCORRECT_CARD_CHALLENGE ((DWORD)0x8030F00DL)
63 #define GP211_ERROR_INCONSISTENT_SCP_IMPL ((DWORD)0x8030F00CL)
64 
65 /* Mapping of ISO7816-4 errors to error codes.
66  * 0x8020XXXX is the general meaning error.
67  * 0x802YXXXX is a special meaning for a use case.
68 */
69 
70 #define OPGP_ISO7816_ERROR_PREFIX ((DWORD)0x80200000L)
71 
72 
73 /* Normal processing */
74 
75 #define OPGP_ISO7816_ERROR_SUCCESS (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x9000L)
76 #define OPGP_ISO7816_ERROR_RESPONSE_LENGTH (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6100L)
77 
78 // State of non-volatile memory unchanged
79 #define OPGP_ISO7816_ERROR_FILE_INVALIDATED (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6283L)
80 #define OPGP_ISO7816_WARNING_CM_LOCKED (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x16283L)
81 
82 #define OPGP_ISO7816_ERROR_FILE_TERMINATED (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6285L)
83 
84 // State of non-volatile memory changed
85 #define OPGP_ISO7816_ERROR_6300 (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6300L)
86 #define OPGP_ISO7816_ERROR_HOST_CRYPTOGRAM_VERIFICATION (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x16300L)
87 
88 #define OPGP_ISO7816_ERROR_MORE_DATA_AVAILABLE (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6310L)
89 
90 
91 /* Execution errors */
92 
93 
94 #define OPGP_ISO7816_ERROR_NOTHING_SPECIFIC (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6400L)
95 #define OPGP_ISO7816_ERROR_MEMORY_FAILURE (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6581L)
96 
97 #define OPGP_ISO7816_ERROR_WRONG_LENGTH (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6700L)
98 
99 #define OPGP_ISO7816_ERROR_CHANNEL_NOT_SUPPORTED (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6881L)
100 #define OPGP_ISO7816_ERROR_SECURE_MESSAGING_NOT_SUPPORTED (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6882L)
101 
102 // Command not allowed class.
103 #define OPGP_ISO7816_ERROR_CONDITIONS_NOT_SATISFIED (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6985L)
104 #define OPGP_ISO7816_ERROR_NOT_MULTI_SELECTABLE (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x16985L)
105 
106 #define OPGP_ISO7816_ERROR_SECURITY_STATUS_NOT_SATISFIED (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6982L)
107 
108 #define OPGP_ISO7816_ERROR_6999 (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6999L)
109 #define OPGP_ISO7816_ERROR_SELECTION_REJECTED (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x16999L)
110 
111 // Wrong parameter(s) P1-P2 class.
112 #define OPGP_ISO7816_ERROR_WRONG_DATA (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6A80L)
113 #define OPGP_ISO7816_ERROR_WRONG_GLOBAL_PIN_FORMAT (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x16A80L)
114 
115 #define OPGP_ISO7816_ERROR_FUNC_NOT_SUPPORTED (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6A81L)
116 #define OPGP_ISO7816_ERROR_APPLET_NOT_SELECTABLE (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x16A81L)
117 
118 #define OPGP_ISO7816_ERROR_FILE_NOT_FOUND (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6A82L)
119 #define OPGP_ISO7816_ERROR_APPLET_NOT_FOUND (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x16A82L)
120 
121 #define OPGP_ISO7816_ERROR_NOT_ENOUGH_MEMORY (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6A84L)
122 
123 #define OPGP_ISO7816_ERROR_INCORRECT_P1P2 (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6A86L)
124 #define OPGP_ISO7816_ERROR_WRONG_PIN_TRY_LIMIT (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x16A86L)
125 
126 #define OPGP_ISO7816_ERROR_DATA_NOT_FOUND (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6A88L)
127 
128 #define OPGP_ISO7816_ERROR_WRONG_P1P2 (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6B00L)
129 #define OPGP_ISO7816_ERROR_CORRECT_LENGTH (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6C00L)
130 #define OPGP_ISO7816_ERROR_INVALID_INS (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6D00L)
131 #define OPGP_ISO7816_ERROR_WRONG_CLA (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6E00L)
132 
133 #define OPGP_ISO7816_ERROR_ILLEGAL_PARAMETER (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x6F74L)
134 
135 #define OPGP_ISO7816_ERROR_ALGORITHM_NOT_SUPPORTED (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x9484L)
136 #define OPGP_ISO7816_ERROR_INVALID_KEY_CHECK_VALUE (OPGP_ISO7816_ERROR_PREFIX | (DWORD)0x9485L)