|
1 /* |
|
2 * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. |
|
3 * |
|
4 */ |
|
5 |
|
6 /* |
|
7 * This product includes software developed by the OpenSSL Project for |
|
8 * use in the OpenSSL Toolkit (http://www.openssl.org/). |
|
9 * |
|
10 * This project also referenced hw_pkcs11-0.9.7b.patch written by |
|
11 * Afchine Madjlessi. |
|
12 */ |
|
13 /* |
|
14 * ==================================================================== |
|
15 * Copyright (c) 2000-2001 The OpenSSL Project. All rights reserved. |
|
16 * |
|
17 * Redistribution and use in source and binary forms, with or without |
|
18 * modification, are permitted provided that the following conditions |
|
19 * are met: |
|
20 * |
|
21 * 1. Redistributions of source code must retain the above copyright |
|
22 * notice, this list of conditions and the following disclaimer. |
|
23 * |
|
24 * 2. Redistributions in binary form must reproduce the above copyright |
|
25 * notice, this list of conditions and the following disclaimer in |
|
26 * the documentation and/or other materials provided with the |
|
27 * distribution. |
|
28 * |
|
29 * 3. All advertising materials mentioning features or use of this |
|
30 * software must display the following acknowledgment: |
|
31 * "This product includes software developed by the OpenSSL Project |
|
32 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" |
|
33 * |
|
34 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to |
|
35 * endorse or promote products derived from this software without |
|
36 * prior written permission. For written permission, please contact |
|
37 * [email protected]. |
|
38 * |
|
39 * 5. Products derived from this software may not be called "OpenSSL" |
|
40 * nor may "OpenSSL" appear in their names without prior written |
|
41 * permission of the OpenSSL Project. |
|
42 * |
|
43 * 6. Redistributions of any form whatsoever must retain the following |
|
44 * acknowledgment: |
|
45 * "This product includes software developed by the OpenSSL Project |
|
46 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" |
|
47 * |
|
48 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY |
|
49 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
50 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
|
51 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR |
|
52 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
53 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
|
54 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
55 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
|
56 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
|
57 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|
58 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
|
59 * OF THE POSSIBILITY OF SUCH DAMAGE. |
|
60 * ==================================================================== |
|
61 * |
|
62 * This product includes cryptographic software written by Eric Young |
|
63 * ([email protected]). This product includes software written by Tim |
|
64 * Hudson ([email protected]). |
|
65 * |
|
66 */ |
|
67 |
|
68 #ifndef HW_PK11_ERR_H |
|
69 #define HW_PK11_ERR_H |
|
70 |
|
71 void ERR_pk11_error(int function, int reason, char *file, int line); |
|
72 void PK11err_add_data(int function, int reason, CK_RV rv); |
|
73 #define PK11err(f, r) ERR_pk11_error((f), (r), __FILE__, __LINE__) |
|
74 |
|
75 /* Error codes for the PK11 functions. */ |
|
76 |
|
77 /* Function codes. */ |
|
78 |
|
79 #define PK11_F_INIT 100 |
|
80 #define PK11_F_FINISH 101 |
|
81 #define PK11_F_DESTROY 102 |
|
82 #define PK11_F_CTRL 103 |
|
83 #define PK11_F_RSA_INIT 104 |
|
84 #define PK11_F_RSA_FINISH 105 |
|
85 #define PK11_F_GET_PUB_RSA_KEY 106 |
|
86 #define PK11_F_GET_PRIV_RSA_KEY 107 |
|
87 #define PK11_F_RSA_GEN_KEY 108 |
|
88 #define PK11_F_RSA_PUB_ENC 109 |
|
89 #define PK11_F_RSA_PRIV_ENC 110 |
|
90 #define PK11_F_RSA_PUB_DEC 111 |
|
91 #define PK11_F_RSA_PRIV_DEC 112 |
|
92 #define PK11_F_RSA_SIGN 113 |
|
93 #define PK11_F_RSA_VERIFY 114 |
|
94 #define PK11_F_RAND_ADD 115 |
|
95 #define PK11_F_RAND_BYTES 116 |
|
96 #define PK11_F_GET_SESSION 117 |
|
97 #define PK11_F_FREE_SESSION 118 |
|
98 #define PK11_F_LOAD_PUBKEY 119 |
|
99 #define PK11_F_LOAD_PRIVKEY 120 |
|
100 #define PK11_F_RSA_PUB_ENC_LOW 121 |
|
101 #define PK11_F_RSA_PRIV_ENC_LOW 122 |
|
102 #define PK11_F_RSA_PUB_DEC_LOW 123 |
|
103 #define PK11_F_RSA_PRIV_DEC_LOW 124 |
|
104 #define PK11_F_DSA_SIGN 125 |
|
105 #define PK11_F_DSA_VERIFY 126 |
|
106 #define PK11_F_DSA_INIT 127 |
|
107 #define PK11_F_DSA_FINISH 128 |
|
108 #define PK11_F_GET_PUB_DSA_KEY 129 |
|
109 #define PK11_F_GET_PRIV_DSA_KEY 130 |
|
110 #define PK11_F_DH_INIT 131 |
|
111 #define PK11_F_DH_FINISH 132 |
|
112 #define PK11_F_MOD_EXP_DH 133 |
|
113 #define PK11_F_GET_DH_KEY 134 |
|
114 #define PK11_F_FREE_ALL_SESSIONS 135 |
|
115 #define PK11_F_SETUP_SESSION 136 |
|
116 #define PK11_F_DESTROY_OBJECT 137 |
|
117 #define PK11_F_CIPHER_INIT 138 |
|
118 #define PK11_F_CIPHER_DO_CIPHER 139 |
|
119 #define PK11_F_GET_CIPHER_KEY 140 |
|
120 #define PK11_F_DIGEST_INIT 141 |
|
121 #define PK11_F_DIGEST_UPDATE 142 |
|
122 #define PK11_F_DIGEST_FINAL 143 |
|
123 #define PK11_F_CHOOSE_SLOT 144 |
|
124 #define PK11_F_CIPHER_FINAL 145 |
|
125 #define PK11_F_LIBRARY_INIT 146 |
|
126 #define PK11_F_LOAD 147 |
|
127 #define PK11_F_DH_GEN_KEY 148 |
|
128 #define PK11_F_DH_COMP_KEY 149 |
|
129 #define PK11_F_DIGEST_COPY 150 |
|
130 #define PK11_F_CIPHER_CLEANUP 151 |
|
131 #define PK11_F_ACTIVE_ADD 152 |
|
132 #define PK11_F_ACTIVE_DELETE 153 |
|
133 #define PK11_F_CHECK_HW_MECHANISMS 154 |
|
134 #define PK11_F_INIT_SYMMETRIC 155 |
|
135 #define PK11_F_ADD_AES_CTR_NIDS 156 |
|
136 #define PK11_F_INIT_ALL_LOCKS 157 |
|
137 #define PK11_F_RETURN_SESSION 158 |
|
138 #define PK11_F_GET_PIN 159 |
|
139 #define PK11_F_FIND_ONE_OBJECT 160 |
|
140 #define PK11_F_CHECK_TOKEN_ATTRS 161 |
|
141 #define PK11_F_CACHE_PIN 162 |
|
142 #define PK11_F_MLOCK_PIN_IN_MEMORY 163 |
|
143 #define PK11_F_TOKEN_LOGIN 164 |
|
144 #define PK11_F_TOKEN_RELOGIN 165 |
|
145 #define PK11_F_RUN_ASKPASS 166 |
|
146 |
|
147 /* Reason codes. */ |
|
148 #define PK11_R_ALREADY_LOADED 100 |
|
149 #define PK11_R_DSO_FAILURE 101 |
|
150 #define PK11_R_NOT_LOADED 102 |
|
151 #define PK11_R_PASSED_NULL_PARAMETER 103 |
|
152 #define PK11_R_COMMAND_NOT_IMPLEMENTED 104 |
|
153 #define PK11_R_INITIALIZE 105 |
|
154 #define PK11_R_FINALIZE 106 |
|
155 #define PK11_R_GETINFO 107 |
|
156 #define PK11_R_GETSLOTLIST 108 |
|
157 #define PK11_R_NO_MODULUS_OR_NO_EXPONENT 109 |
|
158 #define PK11_R_ATTRIBUT_SENSITIVE_OR_INVALID 110 |
|
159 #define PK11_R_GETATTRIBUTVALUE 111 |
|
160 #define PK11_R_NO_MODULUS 112 |
|
161 #define PK11_R_NO_EXPONENT 113 |
|
162 #define PK11_R_FINDOBJECTSINIT 114 |
|
163 #define PK11_R_FINDOBJECTS 115 |
|
164 #define PK11_R_FINDOBJECTSFINAL 116 |
|
165 #define PK11_R_CREATEOBJECT 118 |
|
166 #define PK11_R_DESTROYOBJECT 119 |
|
167 #define PK11_R_OPENSESSION 120 |
|
168 #define PK11_R_CLOSESESSION 121 |
|
169 #define PK11_R_ENCRYPTINIT 122 |
|
170 #define PK11_R_ENCRYPT 123 |
|
171 #define PK11_R_SIGNINIT 124 |
|
172 #define PK11_R_SIGN 125 |
|
173 #define PK11_R_DECRYPTINIT 126 |
|
174 #define PK11_R_DECRYPT 127 |
|
175 #define PK11_R_VERIFYINIT 128 |
|
176 #define PK11_R_VERIFY 129 |
|
177 #define PK11_R_VERIFYRECOVERINIT 130 |
|
178 #define PK11_R_VERIFYRECOVER 131 |
|
179 #define PK11_R_GEN_KEY 132 |
|
180 #define PK11_R_SEEDRANDOM 133 |
|
181 #define PK11_R_GENERATERANDOM 134 |
|
182 #define PK11_R_INVALID_MESSAGE_LENGTH 135 |
|
183 #define PK11_R_UNKNOWN_ALGORITHM_TYPE 136 |
|
184 #define PK11_R_UNKNOWN_ASN1_OBJECT_ID 137 |
|
185 #define PK11_R_UNKNOWN_PADDING_TYPE 138 |
|
186 #define PK11_R_PADDING_CHECK_FAILED 139 |
|
187 #define PK11_R_DIGEST_TOO_BIG 140 |
|
188 #define PK11_R_MALLOC_FAILURE 141 |
|
189 #define PK11_R_CTRL_COMMAND_NOT_IMPLEMENTED 142 |
|
190 #define PK11_R_DATA_GREATER_THAN_MOD_LEN 143 |
|
191 #define PK11_R_DATA_TOO_LARGE_FOR_MODULUS 144 |
|
192 #define PK11_R_MISSING_KEY_COMPONENT 145 |
|
193 #define PK11_R_INVALID_SIGNATURE_LENGTH 146 |
|
194 #define PK11_R_INVALID_DSA_SIGNATURE_R 147 |
|
195 #define PK11_R_INVALID_DSA_SIGNATURE_S 148 |
|
196 #define PK11_R_INCONSISTENT_KEY 149 |
|
197 #define PK11_R_ENCRYPTUPDATE 150 |
|
198 #define PK11_R_DECRYPTUPDATE 151 |
|
199 #define PK11_R_DIGESTINIT 152 |
|
200 #define PK11_R_DIGESTUPDATE 153 |
|
201 #define PK11_R_DIGESTFINAL 154 |
|
202 #define PK11_R_ENCRYPTFINAL 155 |
|
203 #define PK11_R_DECRYPTFINAL 156 |
|
204 #define PK11_R_NO_PRNG_SUPPORT 157 |
|
205 #define PK11_R_GETTOKENINFO 158 |
|
206 #define PK11_R_DERIVEKEY 159 |
|
207 #define PK11_R_GET_OPERATION_STATE 160 |
|
208 #define PK11_R_SET_OPERATION_STATE 161 |
|
209 #define PK11_R_INVALID_HANDLE 162 |
|
210 #define PK11_R_KEY_OR_IV_LEN_PROBLEM 163 |
|
211 #define PK11_R_INVALID_OPERATION_TYPE 164 |
|
212 #define PK11_R_ADD_NID_FAILED 165 |
|
213 #define PK11_R_ATFORK_FAILED 166 |
|
214 #define PK11_R_TOKEN_LOGIN_FAILED 167 |
|
215 #define PK11_R_MORE_THAN_ONE_OBJECT_FOUND 168 |
|
216 #define PK11_R_INVALID_PKCS11_URI 169 |
|
217 #define PK11_R_COULD_NOT_READ_PIN 170 |
|
218 #define PK11_R_COULD_NOT_OPEN_COMMAND 171 |
|
219 #define PK11_R_PIPE_FAILED 172 |
|
220 #define PK11_R_PIN_NOT_READ_FROM_COMMAND 173 |
|
221 #define PK11_R_BAD_PASSPHRASE_SPEC 174 |
|
222 #define PK11_R_TOKEN_NOT_INITIALIZED 175 |
|
223 #define PK11_R_TOKEN_PIN_NOT_SET 176 |
|
224 #define PK11_R_TOKEN_PIN_NOT_PROVIDED 177 |
|
225 #define PK11_R_MISSING_OBJECT_LABEL 178 |
|
226 #define PK11_R_TOKEN_ATTRS_DO_NOT_MATCH 179 |
|
227 #define PK11_R_PRIV_KEY_NOT_FOUND 180 |
|
228 #define PK11_R_NO_OBJECT_FOUND 181 |
|
229 #define PK11_R_PIN_CACHING_POLICY_INVALID 182 |
|
230 #define PK11_R_SYSCONF_FAILED 183 |
|
231 #define PK11_R_MMAP_FAILED 183 |
|
232 #define PK11_R_PRIV_PROC_LOCK_MEMORY_MISSING 184 |
|
233 #define PK11_R_MLOCK_FAILED 185 |
|
234 #define PK11_R_FORK_FAILED 186 |
|
235 |
|
236 #endif /* HW_PK11_ERR_H */ |