1 | /* **************************************************************************** |
---|
2 | * eID Middleware Project. |
---|
3 | * Copyright (C) 2008-2009 FedICT. |
---|
4 | * |
---|
5 | * This is free software; you can redistribute it and/or modify it |
---|
6 | * under the terms of the GNU Lesser General Public License version |
---|
7 | * 3.0 as published by the Free Software Foundation. |
---|
8 | * |
---|
9 | * This software 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 GNU |
---|
12 | * Lesser General Public License for more details. |
---|
13 | * |
---|
14 | * You should have received a copy of the GNU Lesser General Public |
---|
15 | * License along with this software; if not, see |
---|
16 | * http://www.gnu.org/licenses/. |
---|
17 | **************************************************************************** */ |
---|
18 | |
---|
19 | #pragma once |
---|
20 | |
---|
21 | #define EIDMW_OK 0 |
---|
22 | |
---|
23 | // Results of calling the function with incorrect parameters */ |
---|
24 | |
---|
25 | /** A function parameter has an unexpected value (general) */ |
---|
26 | #define EIDMW_ERR_PARAM_BAD 0xe1d00100 |
---|
27 | |
---|
28 | /** A function parameter exceeded the allowed range */ |
---|
29 | #define EIDMW_ERR_PARAM_RANGE 0xe1d00101 |
---|
30 | |
---|
31 | /** Bad file path (invalid characters, length no multiple of 4) */ |
---|
32 | #define EIDMW_ERR_BAD_PATH 0xe1d00102 |
---|
33 | |
---|
34 | /** Unknown/unsupported algorithm */ |
---|
35 | #define EIDMW_ERR_ALGO_BAD 0xe1d00103 |
---|
36 | |
---|
37 | /** Invalid/unsupported PIN operation */ |
---|
38 | #define EIDMW_ERR_PIN_OPERATION 0xe1d00104 |
---|
39 | |
---|
40 | /** PIN not allowed for this card (invalid characters, too short/long) */ |
---|
41 | #define EIDMW_ERR_PIN_FORMAT 0xe1d00105 |
---|
42 | |
---|
43 | /** Bad usage of a class or function */ |
---|
44 | #define EIDMW_ERR_BAD_USAGE 0xe1d00106 |
---|
45 | |
---|
46 | |
---|
47 | // Card errors |
---|
48 | |
---|
49 | /** Generic card error */ |
---|
50 | #define EIDMW_ERR_CARD 0xe1d00200 |
---|
51 | |
---|
52 | /** Not Authenticated (no PIN specified) */ |
---|
53 | #define EIDMW_ERR_NOT_AUTHENTICATED 0xe1d00201 |
---|
54 | |
---|
55 | /** This command is not supported by this card */ |
---|
56 | #define EIDMW_ERR_NOT_SUPPORTED 0xe1d00202 |
---|
57 | |
---|
58 | /** Bad PIN */ |
---|
59 | #define EIDMW_ERR_PIN_BAD 0xe1d00203 |
---|
60 | |
---|
61 | /** PIN blocked */ |
---|
62 | #define EIDMW_ERR_PIN_BLOCKED 0xe1d00204 |
---|
63 | |
---|
64 | /** No card present or card has been removed */ |
---|
65 | #define EIDMW_ERR_NO_CARD 0xe1d00205 |
---|
66 | |
---|
67 | /** Bad parameter P1 or P2 */ |
---|
68 | #define EIDMW_ERR_BAD_P1P2 0xe1d00206 |
---|
69 | |
---|
70 | /** Command not allowed */ |
---|
71 | #define EIDMW_ERR_CMD_NOT_ALLOWED 0xe1d00207 |
---|
72 | |
---|
73 | /** File not found */ |
---|
74 | #define EIDMW_ERR_FILE_NOT_FOUND 0xe1d00208 |
---|
75 | |
---|
76 | /** Unable to read applet version from the card */ |
---|
77 | #define EIDMW_ERR_APPLET_VERSION_NOT_FOUND 0xe1d00209 |
---|
78 | |
---|
79 | /** Card not activated */ |
---|
80 | #define EIDMW_ERR_NOT_ACTIVATED 0xe1d0020A |
---|
81 | |
---|
82 | #define EIDMW_ERR_PINREF_NOT_FOUND 0xe1d0020B |
---|
83 | |
---|
84 | |
---|
85 | // Reader errors |
---|
86 | |
---|
87 | /** Error communicating with the card */ |
---|
88 | #define EIDMW_ERR_CARD_COMM 0xe1d00300 |
---|
89 | |
---|
90 | /** No reader has been found */ |
---|
91 | #define EIDMW_ERR_NO_READER 0xe1d00301 |
---|
92 | |
---|
93 | /** The pinpad reader returned an error */ |
---|
94 | #define EIDMW_ERR_PINPAD 0xe1d00302 |
---|
95 | |
---|
96 | /** A card is present but we can't connect. |
---|
97 | * E.g. no card present, or a synchronous (e.g. SIS card) is |
---|
98 | * inserted in the reader, but no 'reader specific card plugin' |
---|
99 | * is available for that reader */ |
---|
100 | #define EIDMW_ERR_CANT_CONNECT 0xe1d00303 |
---|
101 | |
---|
102 | /** The card has been reset (e.g. by another application) */ |
---|
103 | #define EIDMW_ERR_CARD_RESET 0xe1d00304 |
---|
104 | |
---|
105 | /** The card can't be accessed because of other connections */ |
---|
106 | #define EIDMW_ERR_CARD_SHARING 0xe1d00305 |
---|
107 | |
---|
108 | /** Can't end a transaction that wasn't started (also returned |
---|
109 | * on Mac OS X when multiple apps are access the card simultaneously) */ |
---|
110 | #define EIDMW_ERR_NOT_TRANSACTED 0xe1d00306 |
---|
111 | |
---|
112 | // Internal errors (caused by the middleware) |
---|
113 | |
---|
114 | /** An internal limit has been reached */ |
---|
115 | #define EIDMW_ERR_LIMIT 0xe1d00400 |
---|
116 | |
---|
117 | /** An internal check failed */ |
---|
118 | #define EIDMW_ERR_CHECK 0xe1d00401 |
---|
119 | |
---|
120 | /** The PCSC library could not be located */ |
---|
121 | #define EIDMW_ERR_PCSC_LIB 0xe1d00402 |
---|
122 | |
---|
123 | /** An attempt to resolve a Z-lib address failed */ |
---|
124 | #define EIDMW_ERR_ZLIB_RESOLVE 0xe1d00403 |
---|
125 | |
---|
126 | /** And unknown error occurred */ |
---|
127 | #define EIDMW_ERR_UNKNOWN 0xe1d00404 |
---|
128 | |
---|
129 | /** The pinpad reader received a wrong/unknown value */ |
---|
130 | #define EIDMW_PINPAD_ERR 0xe1d00405 |
---|
131 | |
---|
132 | /** Dynamic library couldn't be loaded (found found at the specified location) */ |
---|
133 | #define EIDMW_CANT_LOAD_LIB 0xe1d00406 |
---|
134 | |
---|
135 | /** Memory error */ |
---|
136 | #define EIDMW_ERR_MEMORY 0xe1d00407 |
---|
137 | |
---|
138 | /** Couldn't delete cache file(s) */ |
---|
139 | #define EIDMW_ERR_DELETE_CACHE 0xe1d00408 |
---|
140 | |
---|
141 | /** Error getting or writing config data */ |
---|
142 | #define EIDMW_CONF 0xe1d00409 |
---|
143 | |
---|
144 | /** The cached files have been tampered with */ |
---|
145 | #define EIDMW_CACHE_TAMPERED 0xe1d0040A |
---|
146 | |
---|
147 | |
---|
148 | // Socket related errors |
---|
149 | |
---|
150 | /** Creation of a socket failed */ |
---|
151 | #define EIDMW_ERR_SOCKET_CREATE 0xe1d00500 |
---|
152 | |
---|
153 | /** Socket 'send()' failed */ |
---|
154 | #define EIDMW_ERR_SOCKET_SEND 0xe1d00501 |
---|
155 | |
---|
156 | /** Socket 'recv()' failed */ |
---|
157 | #define EIDMW_ERR_SOCKET_RECV 0xe1d00502 |
---|
158 | |
---|
159 | /** Call to 'gethostbyname()' in SocketClient failed */ |
---|
160 | #define EIDMW_ERR_SOCKET_GETHOST 0xe1d00503 |
---|
161 | |
---|
162 | /** Call to 'connect()' in SocketClient failed */ |
---|
163 | #define EIDMW_ERR_SOCKET_CONNECT 0xe1d00504 |
---|
164 | |
---|
165 | /** Invalid in SocketServer, call to 'socket()' failed */ |
---|
166 | #define EIDMW_ERR_SOCKET_SOCKET 0xe1d00510 |
---|
167 | |
---|
168 | /** Call to 'bind()' in SocketServer failed */ |
---|
169 | #define EIDMW_ERR_SOCKET_BIND 0xe1d00511 |
---|
170 | |
---|
171 | /** Call to 'Accept()' in SocketServer failed */ |
---|
172 | #define EIDMW_ERR_SOCKET_ACCEPT 0xe1d00512 |
---|
173 | |
---|
174 | |
---|
175 | // User errors/events |
---|
176 | |
---|
177 | /** User pressed Cancel in PIN dialog */ |
---|
178 | #define EIDMW_ERR_PIN_CANCEL 0xe1d00600 |
---|
179 | |
---|
180 | /** Pinpad timeout */ |
---|
181 | #define EIDMW_ERR_TIMEOUT 0xe1d00601 |
---|
182 | |
---|
183 | /** The new PINs that were entered differ */ |
---|
184 | #define EIDMW_NEW_PINS_DIFFER 0xe1d00602 |
---|
185 | |
---|
186 | /** A PIN with invalid length or format was entered */ |
---|
187 | #define EIDMW_WRONG_PIN_FORMAT 0xe1d00603 |
---|
188 | |
---|
189 | |
---|
190 | // Parser errors |
---|
191 | |
---|
192 | /** Could not find expected elements in parsed ASN.1 vector */ |
---|
193 | #define EIDMW_WRONG_ASN1_FORMAT 0xe1d00700 |
---|
194 | |
---|
195 | #define EIDMW_XERCES_INIT_ERROR 0xe1d00701 |
---|
196 | |
---|
197 | |
---|
198 | // I/O errors |
---|
199 | // errors modelled on the definitions in errno.h |
---|
200 | |
---|
201 | /** File could not be opened */ |
---|
202 | #define EIDMW_FILE_NOT_OPENED 0xe1d00800 |
---|
203 | |
---|
204 | /** Search permission is denied for a component of the path prefix of path. */ |
---|
205 | #define EIDMW_PERMISSION_DENIED 0xe1d00801 |
---|
206 | |
---|
207 | /** A loop exists in symbolic links encountered during resolution of the path argument. */ |
---|
208 | /** A component of path does not name an existing file or path is an empty string.*/ |
---|
209 | /** A component of the path prefix is not a directory. */ |
---|
210 | /** The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}. */ |
---|
211 | #define EIDMW_INVALID_PATH 0xe1d00802 |
---|
212 | |
---|
213 | /** {OPEN_MAX} file descriptors are currently open in the calling process. */ |
---|
214 | /** Too many files are currently open in the system.*/ |
---|
215 | #define EIDMW_TOO_MANY_OPENED_FILES 0xe1d00803 |
---|
216 | |
---|
217 | /** The argument of closedir or readdir does not refer to an open directory stream. */ |
---|
218 | #define EIDMW_DIR_NOT_OPENED 0xe1d00804 |
---|
219 | |
---|
220 | /** Interrupted by a signal */ |
---|
221 | #define EIDMW_INTERRUPTION 0xe1d00805 |
---|
222 | |
---|
223 | /** One of the values in the structure to be returned cannot be represented correctly. */ |
---|
224 | #define EIDMW_OVERFLOW 0xe1d00806 |
---|
225 | |
---|
226 | /** An I/O error occurred while reading from the file system.*/ |
---|
227 | #define EIDMW_ERROR_IO 0xe1d00807 |
---|
228 | |
---|
229 | /** Call of the Logger after destruct time */ |
---|
230 | #define EIDMW_ERR_LOGGER_APPLEAVING 0xe1d00900 |
---|
231 | |
---|
232 | |
---|
233 | // SDK error |
---|
234 | /** The document type is unknown for this card */ |
---|
235 | #define EIDMW_ERR_DOCTYPE_UNKNOWN 0xe1d00b00 |
---|
236 | |
---|
237 | /** The card type asked doesn't correspond with the real card type */ |
---|
238 | #define EIDMW_ERR_CARDTYPE_BAD 0xe1d00b01 |
---|
239 | |
---|
240 | /** This card type is unknown */ |
---|
241 | #define EIDMW_ERR_CARDTYPE_UNKNOWN 0xe1d00b02 |
---|
242 | |
---|
243 | /** This Certificate has no issuer (=root) */ |
---|
244 | #define EIDMW_ERR_CERT_NOISSUER 0xe1d00b03 |
---|
245 | |
---|
246 | /** No release of SDK object has been done before closing the application */ |
---|
247 | #define EIDMW_ERR_RELEASE_NEEDED 0xe1d00b04 |
---|
248 | |
---|
249 | /** Bad transaction commande (Unlock without Lock OR Lock without Unlock) */ |
---|
250 | #define EIDMW_ERR_BAD_TRANSACTION 0xe1d00b05 |
---|
251 | |
---|
252 | /** The file type is unknown for this card */ |
---|
253 | #define EIDMW_ERR_FILETYPE_UNKNOWN 0xe1d00b06 |
---|
254 | |
---|
255 | /** The card has been changed */ |
---|
256 | #define EIDMW_ERR_CARD_CHANGED 0xe1d00b07 |
---|
257 | |
---|
258 | /** The reader set has been changed */ |
---|
259 | #define EIDMW_ERR_READERSET_CHANGED 0xe1d00b08 |
---|
260 | |
---|
261 | /** User did not allow to read the card */ |
---|
262 | #define EIDMW_ERR_NOT_ALLOW_BY_USER 0xe1d00b09 |
---|
263 | |
---|
264 | /** This Certificate has no CDP */ |
---|
265 | #define EIDMW_ERR_CERT_NOCRL 0xe1d00b0A |
---|
266 | |
---|
267 | /** This Certificate has no OCSP responder */ |
---|
268 | #define EIDMW_ERR_CERT_NOOCSP 0xe1d00b0B |
---|
269 | |
---|
270 | /** No root is found for the store or certificate */ |
---|
271 | #define EIDMW_ERR_CERT_NOROOT 0xe1d00b0C |
---|
272 | |
---|
273 | /** User did not yet allow or disallow to read the card */ |
---|
274 | #define EIDMW_ERR_USER_MUST_ANSWER 0xe1d00b0D |
---|
275 | |
---|
276 | |
---|
277 | //SOD related errors |
---|
278 | |
---|
279 | #define EIDMW_SOD_UNEXPECTED_VALUE 0xe1d00c01 |
---|
280 | #define EIDMW_SOD_UNEXPECTED_ASN1_TAG 0xe1d00c02 |
---|
281 | #define EIDMW_SOD_UNEXPECTED_ALGO_OID 0xe1d00c03 |
---|
282 | #define EIDMW_SOD_ERR_HASH_NO_MATCH_ID 0xe1d00c04 |
---|
283 | #define EIDMW_SOD_ERR_HASH_NO_MATCH_ADDRESS 0xe1d00c05 |
---|
284 | #define EIDMW_SOD_ERR_HASH_NO_MATCH_PICTURE 0xe1d00c06 |
---|
285 | #define EIDMW_SOD_ERR_HASH_NO_MATCH_PUBLIC_KEY 0xe1d00c07 |
---|
286 | #define EIDMW_SOD_ERR_VERIFY_SOD_SIGN 0xe1d00c08 |
---|
287 | |
---|
288 | #define EIDMW_OTP_CONNECTION_ERROR 0xe1d00d01 |
---|
289 | #define EIDMW_OTP_PROTOCOL_ERROR 0xe1d00d02 |
---|
290 | #define EIDMW_OTP_CERTIFICATE_ERROR 0xe1d00d03 |
---|
291 | #define EIDMW_OTP_UNKNOWN_ERROR 0xe1d00d04 |
---|
292 | |
---|
293 | #define EIDMW_SAM_CONNECTION_ERROR 0xe1d00d05 |
---|
294 | #define EIDMW_SAM_PROTOCOL_ERROR 0xe1d00d06 |
---|
295 | #define EIDMW_SAM_UNKNOWN_ERROR 0xe1d00d07 |
---|
296 | #define EIDMW_SSL_PROTOCOL_ERROR 0xe1d00d08 |
---|
297 | |
---|
298 | |
---|
299 | #define EIDMW_TIMESTAMP_ERROR 0xe1d00e01 |
---|
300 | |
---|
301 | |
---|
302 | // Errors in system calls |
---|
303 | |
---|
304 | /** a system call returned an error */ |
---|
305 | #define EIDMW_ERR_SYSTEM 0xe1d00d01 |
---|
306 | |
---|
307 | /** a signal function returned an error */ |
---|
308 | #define EIDMW_ERR_SIGNAL 0xe1d00d02 |
---|