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