Print this page
6652716 Need an ARCFOUR implementation optimized for Intel EM64T
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/crypto/common.h
+++ new/usr/src/uts/common/sys/crypto/common.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 26 #ifndef _SYS_CRYPTO_COMMON_H
27 27 #define _SYS_CRYPTO_COMMON_H
28 28
29 -#pragma ident "@(#)common.h 1.26 08/01/04 SMI"
29 +#pragma ident "@(#)common.h 1.27 08/03/20 SMI"
30 30
31 31 /*
32 32 * Header file for the common data structures of the cryptographic framework
33 33 */
34 34
35 35 #ifdef __cplusplus
36 36 extern "C" {
37 37 #endif
38 38
39 39 #include <sys/types.h>
40 40 #include <sys/uio.h>
41 41 #include <sys/stream.h>
42 42 #include <sys/mutex.h>
43 43 #include <sys/condvar.h>
44 44
45 45
46 46 /* Cryptographic Mechanisms */
47 47
48 48 #define CRYPTO_MAX_MECH_NAME 32
49 49 typedef char crypto_mech_name_t[CRYPTO_MAX_MECH_NAME];
50 50
51 51 typedef uint64_t crypto_mech_type_t;
52 52
53 53 typedef struct crypto_mechanism {
54 54 crypto_mech_type_t cm_type; /* mechanism type */
55 55 caddr_t cm_param; /* mech. parameter */
56 56 size_t cm_param_len; /* mech. parameter len */
57 57 } crypto_mechanism_t;
58 58
59 59 #ifdef _SYSCALL32
60 60
61 61 typedef struct crypto_mechanism32 {
62 62 crypto_mech_type_t cm_type; /* mechanism type */
63 63 caddr32_t cm_param; /* mech. parameter */
64 64 size32_t cm_param_len; /* mech. parameter len */
65 65 } crypto_mechanism32_t;
66 66
67 67 #endif /* _SYSCALL32 */
68 68
69 69 #ifdef _KERNEL
70 70 /* CK_AES_CTR_PARAMS provides parameters to the CKM_AES_CTR mechanism */
71 71 typedef struct CK_AES_CTR_PARAMS {
72 72 ulong_t ulCounterBits;
73 73 uint8_t cb[16];
74 74 } CK_AES_CTR_PARAMS;
75 75 #endif
76 76
77 77 /* CK_AES_CCM_PARAMS provides parameters to the CKM_AES_CCM mechanism */
78 78 typedef struct CK_AES_CCM_PARAMS {
79 79 ulong_t ulMACSize;
80 80 ulong_t ulNonceSize;
81 81 ulong_t ulAuthDataSize;
82 82 ulong_t ulDataSize; /* used for plaintext or ciphertext */
83 83 uchar_t *nonce;
84 84 uchar_t *authData;
85 85 } CK_AES_CCM_PARAMS;
86 86
87 87 #ifdef _KERNEL
88 88 /*
89 89 * CK_ECDH1_DERIVE_PARAMS provides the parameters to the
90 90 * CKM_ECDH1_KEY_DERIVE mechanism
91 91 */
92 92 typedef struct CK_ECDH1_DERIVE_PARAMS {
93 93 ulong_t kdf;
94 94 ulong_t ulSharedDataLen;
95 95 uchar_t *pSharedData;
96 96 ulong_t ulPublicDataLen;
97 97 uchar_t *pPublicData;
98 98 } CK_ECDH1_DERIVE_PARAMS;
99 99 #endif
100 100
101 101 #ifdef _KERNEL
102 102 #ifdef _SYSCALL32
103 103
104 104 /* needed for 32-bit applications running on 64-bit kernels */
105 105 typedef struct CK_AES_CTR_PARAMS32 {
106 106 uint32_t ulCounterBits;
107 107 uint8_t cb[16];
108 108 } CK_AES_CTR_PARAMS32;
109 109
110 110 /* needed for 32-bit applications running on 64-bit kernels */
111 111 typedef struct CK_AES_CCM_PARAMS32 {
112 112 uint32_t ulMACSize;
113 113 uint32_t ulNonceSize;
114 114 uint32_t ulAuthDataSize;
115 115 uint32_t ulDataSize;
116 116 caddr32_t nonce;
117 117 caddr32_t authData;
118 118 } CK_AES_CCM_PARAMS32;
119 119
120 120 typedef struct CK_ECDH1_DERIVE_PARAMS32 {
121 121 uint32_t kdf;
122 122 uint32_t ulSharedDataLen;
123 123 caddr32_t pSharedData;
124 124 uint32_t ulPublicDataLen;
125 125 caddr32_t pPublicData;
126 126 } CK_ECDH1_DERIVE_PARAMS32;
127 127
128 128 #endif /* _SYSCALL32 */
129 129 #endif /* _KERNEL */
130 130
131 131 /*
132 132 * The measurement unit bit flag for a mechanism's minimum or maximum key size.
133 133 * The unit are mechanism dependant. It can be in bits or in bytes.
134 134 */
135 135 typedef uint32_t crypto_keysize_unit_t;
136 136
137 137 /*
138 138 * The following bit flags are valid in cm_mech_flags field in
139 139 * the crypto_mech_info_t structure of the SPI.
140 140 *
141 141 * Only the first two bit flags are valid in mi_keysize_unit
142 142 * field in the crypto_mechanism_info_t structure of the API.
143 143 */
144 144 #define CRYPTO_KEYSIZE_UNIT_IN_BITS 0x00000001
145 145 #define CRYPTO_KEYSIZE_UNIT_IN_BYTES 0x00000002
146 146 #define CRYPTO_CAN_SHARE_OPSTATE 0x00000004 /* supports sharing */
147 147
148 148
149 149 /* Mechanisms supported out-of-the-box */
150 150 #define SUN_CKM_MD4 "CKM_MD4"
151 151 #define SUN_CKM_MD5 "CKM_MD5"
152 152 #define SUN_CKM_MD5_HMAC "CKM_MD5_HMAC"
153 153 #define SUN_CKM_MD5_HMAC_GENERAL "CKM_MD5_HMAC_GENERAL"
154 154 #define SUN_CKM_SHA1 "CKM_SHA_1"
155 155 #define SUN_CKM_SHA1_HMAC "CKM_SHA_1_HMAC"
156 156 #define SUN_CKM_SHA1_HMAC_GENERAL "CKM_SHA_1_HMAC_GENERAL"
157 157 #define SUN_CKM_SHA256 "CKM_SHA256"
158 158 #define SUN_CKM_SHA256_HMAC "CKM_SHA256_HMAC"
159 159 #define SUN_CKM_SHA256_HMAC_GENERAL "CKM_SHA256_HMAC_GENERAL"
160 160 #define SUN_CKM_SHA384 "CKM_SHA384"
161 161 #define SUN_CKM_SHA384_HMAC "CKM_SHA384_HMAC"
162 162 #define SUN_CKM_SHA384_HMAC_GENERAL "CKM_SHA384_HMAC_GENERAL"
163 163 #define SUN_CKM_SHA512 "CKM_SHA512"
164 164 #define SUN_CKM_SHA512_HMAC "CKM_SHA512_HMAC"
165 165 #define SUN_CKM_SHA512_HMAC_GENERAL "CKM_SHA512_HMAC_GENERAL"
166 166 #define SUN_CKM_DES_CBC "CKM_DES_CBC"
167 167 #define SUN_CKM_DES3_CBC "CKM_DES3_CBC"
168 168 #define SUN_CKM_DES_ECB "CKM_DES_ECB"
169 169 #define SUN_CKM_DES3_ECB "CKM_DES3_ECB"
170 170 #define SUN_CKM_BLOWFISH_CBC "CKM_BLOWFISH_CBC"
171 171 #define SUN_CKM_BLOWFISH_ECB "CKM_BLOWFISH_ECB"
172 172 #define SUN_CKM_AES_CBC "CKM_AES_CBC"
173 173 #define SUN_CKM_AES_ECB "CKM_AES_ECB"
174 174 #define SUN_CKM_AES_CTR "CKM_AES_CTR"
175 175 #define SUN_CKM_AES_CCM "CKM_AES_CCM"
176 176 #define SUN_CKM_RC4 "CKM_RC4"
177 177 #define SUN_CKM_RSA_PKCS "CKM_RSA_PKCS"
178 178 #define SUN_CKM_RSA_X_509 "CKM_RSA_X_509"
179 179 #define SUN_CKM_MD5_RSA_PKCS "CKM_MD5_RSA_PKCS"
↓ open down ↓ |
140 lines elided |
↑ open up ↑ |
180 180 #define SUN_CKM_SHA1_RSA_PKCS "CKM_SHA1_RSA_PKCS"
181 181 #define SUN_CKM_SHA256_RSA_PKCS "CKM_SHA256_RSA_PKCS"
182 182 #define SUN_CKM_SHA384_RSA_PKCS "CKM_SHA384_RSA_PKCS"
183 183 #define SUN_CKM_SHA512_RSA_PKCS "CKM_SHA512_RSA_PKCS"
184 184 #define SUN_CKM_EC_KEY_PAIR_GEN "CKM_EC_KEY_PAIR_GEN"
185 185 #define SUN_CKM_ECDH1_DERIVE "CKM_ECDH1_DERIVE"
186 186 #define SUN_CKM_ECDSA_SHA1 "CKM_ECDSA_SHA1"
187 187 #define SUN_CKM_ECDSA "CKM_ECDSA"
188 188
189 189 /* Shared operation context format for CKM_RC4 */
190 +typedef struct {
190 191 #if defined(__amd64)
191 -typedef uint64_t arcfour_key_int_t;
192 + uint32_t i, j;
193 + uint32_t arr[256];
192 194 #else
193 -typedef uchar_t arcfour_key_int_t;
195 + uchar_t arr[256];
196 + uchar_t i, j;
194 197 #endif /* __amd64 */
195 -
196 -typedef struct {
197 - arcfour_key_int_t arr[256];
198 - arcfour_key_int_t i, j;
199 198 uint64_t pad; /* For 64-bit alignment */
200 199 } arcfour_state_t;
201 200
202 201 /* Data arguments of cryptographic operations */
203 202
204 203 typedef enum crypto_data_format {
205 204 CRYPTO_DATA_RAW = 1,
206 205 CRYPTO_DATA_UIO,
207 206 CRYPTO_DATA_MBLK
208 207 } crypto_data_format_t;
209 208
210 209 typedef struct crypto_data {
211 210 crypto_data_format_t cd_format; /* Format identifier */
212 211 off_t cd_offset; /* Offset from the beginning */
213 212 size_t cd_length; /* # of bytes in use */
214 213 caddr_t cd_miscdata; /* ancillary data */
215 214 union {
216 215 /* Raw format */
217 216 iovec_t cdu_raw; /* Pointer and length */
218 217
219 218 /* uio scatter-gather format */
220 219 uio_t *cdu_uio;
221 220
222 221 /* mblk scatter-gather format */
223 222 mblk_t *cdu_mp; /* The mblk chain */
224 223
225 224 } cdu; /* Crypto Data Union */
226 225 } crypto_data_t;
227 226
228 227 #define cd_raw cdu.cdu_raw
229 228 #define cd_uio cdu.cdu_uio
230 229 #define cd_mp cdu.cdu_mp
231 230
232 231 typedef struct crypto_dual_data {
233 232 crypto_data_t dd_data; /* The data */
234 233 off_t dd_offset2; /* Used by dual operation */
235 234 size_t dd_len2; /* # of bytes to take */
236 235 } crypto_dual_data_t;
237 236
238 237 #define dd_format dd_data.cd_format
239 238 #define dd_offset1 dd_data.cd_offset
240 239 #define dd_len1 dd_data.cd_length
241 240 #define dd_miscdata dd_data.cd_miscdata
242 241 #define dd_raw dd_data.cd_raw
243 242 #define dd_uio dd_data.cd_uio
244 243 #define dd_mp dd_data.cd_mp
245 244
246 245 /* The keys, and their contents */
247 246
248 247 typedef enum {
249 248 CRYPTO_KEY_RAW = 1, /* ck_data is a cleartext key */
250 249 CRYPTO_KEY_REFERENCE, /* ck_obj_id is an opaque reference */
251 250 CRYPTO_KEY_ATTR_LIST /* ck_attrs is a list of object attributes */
252 251 } crypto_key_format_t;
253 252
254 253 typedef uint64_t crypto_attr_type_t;
255 254
256 255 /* Attribute types to use for passing a RSA public key or a private key. */
257 256 #define SUN_CKA_MODULUS 0x00000120
258 257 #define SUN_CKA_MODULUS_BITS 0x00000121
259 258 #define SUN_CKA_PUBLIC_EXPONENT 0x00000122
260 259 #define SUN_CKA_PRIVATE_EXPONENT 0x00000123
261 260 #define SUN_CKA_PRIME_1 0x00000124
262 261 #define SUN_CKA_PRIME_2 0x00000125
263 262 #define SUN_CKA_EXPONENT_1 0x00000126
264 263 #define SUN_CKA_EXPONENT_2 0x00000127
265 264 #define SUN_CKA_COEFFICIENT 0x00000128
266 265 #define SUN_CKA_PRIME 0x00000130
267 266 #define SUN_CKA_SUBPRIME 0x00000131
268 267 #define SUN_CKA_BASE 0x00000132
269 268
270 269 #define CKK_EC 0x00000003
271 270 #define CKK_GENERIC_SECRET 0x00000010
272 271 #define CKK_RC4 0x00000012
273 272 #define CKK_AES 0x0000001F
274 273 #define CKK_DES 0x00000013
275 274 #define CKK_DES2 0x00000014
276 275 #define CKK_DES3 0x00000015
277 276
278 277 #define CKO_PUBLIC_KEY 0x00000002
279 278 #define CKO_PRIVATE_KEY 0x00000003
280 279 #define CKA_CLASS 0x00000000
281 280 #define CKA_VALUE 0x00000011
282 281 #define CKA_KEY_TYPE 0x00000100
283 282 #define CKA_VALUE_LEN 0x00000161
284 283 #define CKA_EC_PARAMS 0x00000180
285 284 #define CKA_EC_POINT 0x00000181
286 285
287 286 typedef uint32_t crypto_object_id_t;
288 287
289 288 typedef struct crypto_object_attribute {
290 289 crypto_attr_type_t oa_type; /* attribute type */
291 290 caddr_t oa_value; /* attribute value */
292 291 ssize_t oa_value_len; /* length of attribute value */
293 292 } crypto_object_attribute_t;
294 293
295 294 typedef struct crypto_key {
296 295 crypto_key_format_t ck_format; /* format identifier */
297 296 union {
298 297 /* for CRYPTO_KEY_RAW ck_format */
299 298 struct {
300 299 uint_t cku_v_length; /* # of bits in ck_data */
301 300 void *cku_v_data; /* ptr to key value */
302 301 } cku_key_value;
303 302
304 303 /* for CRYPTO_KEY_REFERENCE ck_format */
305 304 crypto_object_id_t cku_key_id; /* reference to object key */
306 305
307 306 /* for CRYPTO_KEY_ATTR_LIST ck_format */
308 307 struct {
309 308 uint_t cku_a_count; /* number of attributes */
310 309 crypto_object_attribute_t *cku_a_oattr;
311 310 } cku_key_attrs;
312 311 } cku_data; /* Crypto Key union */
313 312 } crypto_key_t;
314 313
315 314 #ifdef _SYSCALL32
316 315
317 316 typedef struct crypto_object_attribute32 {
318 317 uint64_t oa_type; /* attribute type */
319 318 caddr32_t oa_value; /* attribute value */
320 319 ssize32_t oa_value_len; /* length of attribute value */
321 320 } crypto_object_attribute32_t;
322 321
323 322 typedef struct crypto_key32 {
324 323 crypto_key_format_t ck_format; /* format identifier */
325 324 union {
326 325 /* for CRYPTO_KEY_RAW ck_format */
327 326 struct {
328 327 uint32_t cku_v_length; /* # of bytes in ck_data */
329 328 caddr32_t cku_v_data; /* ptr to key value */
330 329 } cku_key_value;
331 330
332 331 /* for CRYPTO_KEY_REFERENCE ck_format */
333 332 crypto_object_id_t cku_key_id; /* reference to object key */
334 333
335 334 /* for CRYPTO_KEY_ATTR_LIST ck_format */
336 335 struct {
337 336 uint32_t cku_a_count; /* number of attributes */
338 337 caddr32_t cku_a_oattr;
339 338 } cku_key_attrs;
340 339 } cku_data; /* Crypto Key union */
341 340 } crypto_key32_t;
342 341
343 342 #endif /* _SYSCALL32 */
344 343
345 344 #define ck_data cku_data.cku_key_value.cku_v_data
346 345 #define ck_length cku_data.cku_key_value.cku_v_length
347 346 #define ck_obj_id cku_data.cku_key_id
348 347 #define ck_count cku_data.cku_key_attrs.cku_a_count
349 348 #define ck_attrs cku_data.cku_key_attrs.cku_a_oattr
350 349
351 350 /*
352 351 * Raw key lengths are expressed in number of bits.
353 352 * The following macro returns the minimum number of
354 353 * bytes that can contain the specified number of bits.
355 354 */
356 355 #define CRYPTO_BITS2BYTES(n) (((n) + 7) >> 3)
357 356
358 357 /* Providers */
359 358
360 359 typedef enum {
361 360 CRYPTO_HW_PROVIDER = 0,
362 361 CRYPTO_SW_PROVIDER,
363 362 CRYPTO_LOGICAL_PROVIDER
364 363 } crypto_provider_type_t;
365 364
366 365 typedef uint32_t crypto_provider_id_t;
367 366 #define KCF_PROVID_INVALID ((uint32_t)-1)
368 367
369 368 typedef struct crypto_provider_entry {
370 369 crypto_provider_id_t pe_provider_id;
371 370 uint_t pe_mechanism_count;
372 371 } crypto_provider_entry_t;
373 372
374 373 typedef struct crypto_dev_list_entry {
375 374 char le_dev_name[MAXNAMELEN];
376 375 uint_t le_dev_instance;
377 376 uint_t le_mechanism_count;
378 377 } crypto_dev_list_entry_t;
379 378
380 379 /* User type for authentication ioctls and SPI entry points */
381 380
382 381 typedef enum crypto_user_type {
383 382 CRYPTO_SO = 0,
384 383 CRYPTO_USER
385 384 } crypto_user_type_t;
386 385
387 386 /* Version for provider management ioctls and SPI entry points */
388 387
389 388 typedef struct crypto_version {
390 389 uchar_t cv_major;
391 390 uchar_t cv_minor;
392 391 } crypto_version_t;
393 392
394 393 /* session data structure opaque to the consumer */
395 394 typedef void *crypto_session_t;
396 395
397 396 /* provider data structure opaque to the consumer */
398 397 typedef void *crypto_provider_t;
399 398
400 399 /* Limits used by both consumers and providers */
401 400 #define CRYPTO_EXT_SIZE_LABEL 32
402 401 #define CRYPTO_EXT_SIZE_MANUF 32
403 402 #define CRYPTO_EXT_SIZE_MODEL 16
404 403 #define CRYPTO_EXT_SIZE_SERIAL 16
405 404 #define CRYPTO_EXT_SIZE_TIME 16
406 405
407 406 typedef struct crypto_provider_ext_info {
408 407 uchar_t ei_label[CRYPTO_EXT_SIZE_LABEL];
409 408 uchar_t ei_manufacturerID[CRYPTO_EXT_SIZE_MANUF];
410 409 uchar_t ei_model[CRYPTO_EXT_SIZE_MODEL];
411 410 uchar_t ei_serial_number[CRYPTO_EXT_SIZE_SERIAL];
412 411 ulong_t ei_flags;
413 412 ulong_t ei_max_session_count;
414 413 ulong_t ei_max_pin_len;
415 414 ulong_t ei_min_pin_len;
416 415 ulong_t ei_total_public_memory;
417 416 ulong_t ei_free_public_memory;
418 417 ulong_t ei_total_private_memory;
419 418 ulong_t ei_free_private_memory;
420 419 crypto_version_t ei_hardware_version;
421 420 crypto_version_t ei_firmware_version;
422 421 uchar_t ei_time[CRYPTO_EXT_SIZE_TIME];
423 422 } crypto_provider_ext_info_t;
424 423
425 424 typedef uint_t crypto_session_id_t;
426 425
427 426 /*
428 427 * Common cryptographic status and error codes.
429 428 */
430 429 #define CRYPTO_SUCCESS 0x00000000
431 430 #define CRYPTO_CANCEL 0x00000001
432 431 #define CRYPTO_HOST_MEMORY 0x00000002
433 432 #define CRYPTO_GENERAL_ERROR 0x00000003
434 433 #define CRYPTO_FAILED 0x00000004
435 434 #define CRYPTO_ARGUMENTS_BAD 0x00000005
436 435 #define CRYPTO_ATTRIBUTE_READ_ONLY 0x00000006
437 436 #define CRYPTO_ATTRIBUTE_SENSITIVE 0x00000007
438 437 #define CRYPTO_ATTRIBUTE_TYPE_INVALID 0x00000008
439 438 #define CRYPTO_ATTRIBUTE_VALUE_INVALID 0x00000009
440 439 #define CRYPTO_CANCELED 0x0000000A
441 440 #define CRYPTO_DATA_INVALID 0x0000000B
442 441 #define CRYPTO_DATA_LEN_RANGE 0x0000000C
443 442 #define CRYPTO_DEVICE_ERROR 0x0000000D
444 443 #define CRYPTO_DEVICE_MEMORY 0x0000000E
445 444 #define CRYPTO_DEVICE_REMOVED 0x0000000F
446 445 #define CRYPTO_ENCRYPTED_DATA_INVALID 0x00000010
447 446 #define CRYPTO_ENCRYPTED_DATA_LEN_RANGE 0x00000011
448 447 #define CRYPTO_KEY_HANDLE_INVALID 0x00000012
449 448 #define CRYPTO_KEY_SIZE_RANGE 0x00000013
450 449 #define CRYPTO_KEY_TYPE_INCONSISTENT 0x00000014
451 450 #define CRYPTO_KEY_NOT_NEEDED 0x00000015
452 451 #define CRYPTO_KEY_CHANGED 0x00000016
453 452 #define CRYPTO_KEY_NEEDED 0x00000017
454 453 #define CRYPTO_KEY_INDIGESTIBLE 0x00000018
455 454 #define CRYPTO_KEY_FUNCTION_NOT_PERMITTED 0x00000019
456 455 #define CRYPTO_KEY_NOT_WRAPPABLE 0x0000001A
457 456 #define CRYPTO_KEY_UNEXTRACTABLE 0x0000001B
458 457 #define CRYPTO_MECHANISM_INVALID 0x0000001C
459 458 #define CRYPTO_MECHANISM_PARAM_INVALID 0x0000001D
460 459 #define CRYPTO_OBJECT_HANDLE_INVALID 0x0000001E
461 460 #define CRYPTO_OPERATION_IS_ACTIVE 0x0000001F
462 461 #define CRYPTO_OPERATION_NOT_INITIALIZED 0x00000020
463 462 #define CRYPTO_PIN_INCORRECT 0x00000021
464 463 #define CRYPTO_PIN_INVALID 0x00000022
465 464 #define CRYPTO_PIN_LEN_RANGE 0x00000023
466 465 #define CRYPTO_PIN_EXPIRED 0x00000024
467 466 #define CRYPTO_PIN_LOCKED 0x00000025
468 467 #define CRYPTO_SESSION_CLOSED 0x00000026
469 468 #define CRYPTO_SESSION_COUNT 0x00000027
470 469 #define CRYPTO_SESSION_HANDLE_INVALID 0x00000028
471 470 #define CRYPTO_SESSION_READ_ONLY 0x00000029
472 471 #define CRYPTO_SESSION_EXISTS 0x0000002A
473 472 #define CRYPTO_SESSION_READ_ONLY_EXISTS 0x0000002B
474 473 #define CRYPTO_SESSION_READ_WRITE_SO_EXISTS 0x0000002C
475 474 #define CRYPTO_SIGNATURE_INVALID 0x0000002D
476 475 #define CRYPTO_SIGNATURE_LEN_RANGE 0x0000002E
477 476 #define CRYPTO_TEMPLATE_INCOMPLETE 0x0000002F
478 477 #define CRYPTO_TEMPLATE_INCONSISTENT 0x00000030
479 478 #define CRYPTO_UNWRAPPING_KEY_HANDLE_INVALID 0x00000031
480 479 #define CRYPTO_UNWRAPPING_KEY_SIZE_RANGE 0x00000032
481 480 #define CRYPTO_UNWRAPPING_KEY_TYPE_INCONSISTENT 0x00000033
482 481 #define CRYPTO_USER_ALREADY_LOGGED_IN 0x00000034
483 482 #define CRYPTO_USER_NOT_LOGGED_IN 0x00000035
484 483 #define CRYPTO_USER_PIN_NOT_INITIALIZED 0x00000036
485 484 #define CRYPTO_USER_TYPE_INVALID 0x00000037
486 485 #define CRYPTO_USER_ANOTHER_ALREADY_LOGGED_IN 0x00000038
487 486 #define CRYPTO_USER_TOO_MANY_TYPES 0x00000039
488 487 #define CRYPTO_WRAPPED_KEY_INVALID 0x0000003A
489 488 #define CRYPTO_WRAPPED_KEY_LEN_RANGE 0x0000003B
490 489 #define CRYPTO_WRAPPING_KEY_HANDLE_INVALID 0x0000003C
491 490 #define CRYPTO_WRAPPING_KEY_SIZE_RANGE 0x0000003D
492 491 #define CRYPTO_WRAPPING_KEY_TYPE_INCONSISTENT 0x0000003E
493 492 #define CRYPTO_RANDOM_SEED_NOT_SUPPORTED 0x0000003F
494 493 #define CRYPTO_RANDOM_NO_RNG 0x00000040
495 494 #define CRYPTO_DOMAIN_PARAMS_INVALID 0x00000041
496 495 #define CRYPTO_BUFFER_TOO_SMALL 0x00000042
497 496 #define CRYPTO_INFORMATION_SENSITIVE 0x00000043
498 497 #define CRYPTO_NOT_SUPPORTED 0x00000044
499 498
500 499 #define CRYPTO_QUEUED 0x00000045
501 500 #define CRYPTO_BUFFER_TOO_BIG 0x00000046
502 501 #define CRYPTO_INVALID_CONTEXT 0x00000047
503 502 #define CRYPTO_INVALID_MAC 0x00000048
504 503 #define CRYPTO_MECH_NOT_SUPPORTED 0x00000049
505 504 #define CRYPTO_INCONSISTENT_ATTRIBUTE 0x0000004A
506 505 #define CRYPTO_NO_PERMISSION 0x0000004B
507 506 #define CRYPTO_INVALID_PROVIDER_ID 0x0000004C
508 507 #define CRYPTO_VERSION_MISMATCH 0x0000004D
509 508 #define CRYPTO_BUSY 0x0000004E
510 509 #define CRYPTO_UNKNOWN_PROVIDER 0x0000004F
511 510 #define CRYPTO_MODVERIFICATION_FAILED 0x00000050
512 511 #define CRYPTO_OLD_CTX_TEMPLATE 0x00000051
513 512 #define CRYPTO_WEAK_KEY 0x00000052
514 513
515 514 /*
516 515 * Special values that can be used to indicate that information is unavailable
517 516 * or that there is not practical limit. These values can be used
518 517 * by fields of the SPI crypto_provider_ext_info(9S) structure.
519 518 * The value of CRYPTO_UNAVAILABLE_INFO should be the same as
520 519 * CK_UNAVAILABLE_INFO in the PKCS#11 spec.
521 520 */
522 521 #define CRYPTO_UNAVAILABLE_INFO ((ulong_t)(-1))
523 522 #define CRYPTO_EFFECTIVELY_INFINITE 0x0
524 523
525 524 #ifdef __cplusplus
526 525 }
527 526 #endif
528 527
529 528 #endif /* _SYS_CRYPTO_COMMON_H */
↓ open down ↓ |
321 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX