17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 237c478bd9Sstevel@tonic-gate * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #ifndef _SYS_CRYPTO_COMMON_H 287c478bd9Sstevel@tonic-gate #define _SYS_CRYPTO_COMMON_H 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gate /* 337c478bd9Sstevel@tonic-gate * Header file for the common data structures of the cryptographic framework 347c478bd9Sstevel@tonic-gate */ 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate #ifdef __cplusplus 377c478bd9Sstevel@tonic-gate extern "C" { 387c478bd9Sstevel@tonic-gate #endif 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate #include <sys/types.h> 417c478bd9Sstevel@tonic-gate #include <sys/uio.h> 427c478bd9Sstevel@tonic-gate #include <sys/stream.h> 437c478bd9Sstevel@tonic-gate #include <sys/mutex.h> 447c478bd9Sstevel@tonic-gate #include <sys/condvar.h> 457c478bd9Sstevel@tonic-gate 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gate /* Cryptographic Mechanisms */ 487c478bd9Sstevel@tonic-gate 497c478bd9Sstevel@tonic-gate #define CRYPTO_MAX_MECH_NAME 32 507c478bd9Sstevel@tonic-gate typedef char crypto_mech_name_t[CRYPTO_MAX_MECH_NAME]; 517c478bd9Sstevel@tonic-gate 527c478bd9Sstevel@tonic-gate typedef uint64_t crypto_mech_type_t; 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate typedef struct crypto_mechanism { 557c478bd9Sstevel@tonic-gate crypto_mech_type_t cm_type; /* mechanism type */ 567c478bd9Sstevel@tonic-gate caddr_t cm_param; /* mech. parameter */ 577c478bd9Sstevel@tonic-gate size_t cm_param_len; /* mech. parameter len */ 587c478bd9Sstevel@tonic-gate } crypto_mechanism_t; 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate /* 617c478bd9Sstevel@tonic-gate * The measurement unit flag for a mechanism's minimum or maximum key size. 627c478bd9Sstevel@tonic-gate * The unit are mechanism dependant. It can be in bits or in bytes. 637c478bd9Sstevel@tonic-gate */ 647c478bd9Sstevel@tonic-gate typedef uint32_t crypto_keysize_unit_t; 657c478bd9Sstevel@tonic-gate 667c478bd9Sstevel@tonic-gate #define CRYPTO_KEYSIZE_UNIT_IN_BITS 0x00000001 677c478bd9Sstevel@tonic-gate #define CRYPTO_KEYSIZE_UNIT_IN_BYTES 0x00000002 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gate 707c478bd9Sstevel@tonic-gate /* Mechanisms supported out-of-the-box */ 717c478bd9Sstevel@tonic-gate #define SUN_CKM_MD5 "CKM_MD5" 727c478bd9Sstevel@tonic-gate #define SUN_CKM_MD5_HMAC "CKM_MD5_HMAC" 737c478bd9Sstevel@tonic-gate #define SUN_CKM_MD5_HMAC_GENERAL "CKM_MD5_HMAC_GENERAL" 747c478bd9Sstevel@tonic-gate #define SUN_CKM_SHA1 "CKM_SHA_1" 757c478bd9Sstevel@tonic-gate #define SUN_CKM_SHA1_HMAC "CKM_SHA_1_HMAC" 767c478bd9Sstevel@tonic-gate #define SUN_CKM_SHA1_HMAC_GENERAL "CKM_SHA_1_HMAC_GENERAL" 777c478bd9Sstevel@tonic-gate #define SUN_CKM_SHA256 "CKM_SHA256" 787c478bd9Sstevel@tonic-gate #define SUN_CKM_SHA256_HMAC "CKM_SHA256_HMAC" 797c478bd9Sstevel@tonic-gate #define SUN_CKM_SHA256_HMAC_GENERAL "CKM_SHA256_HMAC_GENERAL" 807c478bd9Sstevel@tonic-gate #define SUN_CKM_SHA384 "CKM_SHA384" 817c478bd9Sstevel@tonic-gate #define SUN_CKM_SHA384_HMAC "CKM_SHA384_HMAC" 827c478bd9Sstevel@tonic-gate #define SUN_CKM_SHA384_HMAC_GENERAL "CKM_SHA384_HMAC_GENERAL" 837c478bd9Sstevel@tonic-gate #define SUN_CKM_SHA512 "CKM_SHA512" 847c478bd9Sstevel@tonic-gate #define SUN_CKM_SHA512_HMAC "CKM_SHA512_HMAC" 857c478bd9Sstevel@tonic-gate #define SUN_CKM_SHA512_HMAC_GENERAL "CKM_SHA512_HMAC_GENERAL" 867c478bd9Sstevel@tonic-gate #define SUN_CKM_DES_CBC "CKM_DES_CBC" 877c478bd9Sstevel@tonic-gate #define SUN_CKM_DES3_CBC "CKM_DES3_CBC" 887c478bd9Sstevel@tonic-gate #define SUN_CKM_DES_ECB "CKM_DES_ECB" 897c478bd9Sstevel@tonic-gate #define SUN_CKM_DES3_ECB "CKM_DES3_ECB" 90*f66d273dSizick #define SUN_CKM_BLOWFISH_CBC "CKM_BLOWFISH_CBC" 91*f66d273dSizick #define SUN_CKM_BLOWFISH_ECB "CKM_BLOWFISH_ECB" 927c478bd9Sstevel@tonic-gate #define SUN_CKM_AES_CBC "CKM_AES_CBC" 937c478bd9Sstevel@tonic-gate #define SUN_CKM_AES_ECB "CKM_AES_ECB" 947c478bd9Sstevel@tonic-gate #define SUN_CKM_RC4 "CKM_RC4" 957c478bd9Sstevel@tonic-gate #define SUN_CKM_RSA_PKCS "CKM_RSA_PKCS" 967c478bd9Sstevel@tonic-gate #define SUN_CKM_RSA_X_509 "CKM_RSA_X_509" 977c478bd9Sstevel@tonic-gate #define SUN_CKM_MD5_RSA_PKCS "CKM_MD5_RSA_PKCS" 987c478bd9Sstevel@tonic-gate #define SUN_CKM_SHA1_RSA_PKCS "CKM_SHA1_RSA_PKCS" 99*f66d273dSizick #define SUN_CKM_SHA256_RSA_PKCS "CKM_SHA256_RSA_PKCS" 100*f66d273dSizick #define SUN_CKM_SHA384_RSA_PKCS "CKM_SHA384_RSA_PKCS" 101*f66d273dSizick #define SUN_CKM_SHA512_RSA_PKCS "CKM_SHA512_RSA_PKCS" 1027c478bd9Sstevel@tonic-gate 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate /* Data arguments of cryptographic operations */ 1057c478bd9Sstevel@tonic-gate 1067c478bd9Sstevel@tonic-gate typedef enum crypto_data_format { 1077c478bd9Sstevel@tonic-gate CRYPTO_DATA_RAW = 1, 1087c478bd9Sstevel@tonic-gate CRYPTO_DATA_UIO, 1097c478bd9Sstevel@tonic-gate CRYPTO_DATA_MBLK 1107c478bd9Sstevel@tonic-gate } crypto_data_format_t; 1117c478bd9Sstevel@tonic-gate 1127c478bd9Sstevel@tonic-gate typedef struct crypto_data { 1137c478bd9Sstevel@tonic-gate crypto_data_format_t cd_format; /* Format identifier */ 1147c478bd9Sstevel@tonic-gate off_t cd_offset; /* Offset from the beginning */ 1157c478bd9Sstevel@tonic-gate size_t cd_length; /* # of bytes in use */ 1167c478bd9Sstevel@tonic-gate caddr_t cd_miscdata; /* ancillary data */ 1177c478bd9Sstevel@tonic-gate union { 1187c478bd9Sstevel@tonic-gate /* Raw format */ 1197c478bd9Sstevel@tonic-gate iovec_t cdu_raw; /* Pointer and length */ 1207c478bd9Sstevel@tonic-gate 1217c478bd9Sstevel@tonic-gate /* uio scatter-gather format */ 1227c478bd9Sstevel@tonic-gate uio_t *cdu_uio; 1237c478bd9Sstevel@tonic-gate 1247c478bd9Sstevel@tonic-gate /* mblk scatter-gather format */ 1257c478bd9Sstevel@tonic-gate mblk_t *cdu_mp; /* The mblk chain */ 1267c478bd9Sstevel@tonic-gate 1277c478bd9Sstevel@tonic-gate } cdu; /* Crypto Data Union */ 1287c478bd9Sstevel@tonic-gate } crypto_data_t; 1297c478bd9Sstevel@tonic-gate 1307c478bd9Sstevel@tonic-gate #define cd_raw cdu.cdu_raw 1317c478bd9Sstevel@tonic-gate #define cd_uio cdu.cdu_uio 1327c478bd9Sstevel@tonic-gate #define cd_mp cdu.cdu_mp 1337c478bd9Sstevel@tonic-gate 1347c478bd9Sstevel@tonic-gate typedef struct crypto_dual_data { 1357c478bd9Sstevel@tonic-gate crypto_data_t dd_data; /* The data */ 1367c478bd9Sstevel@tonic-gate off_t dd_offset2; /* Used by dual operation */ 1377c478bd9Sstevel@tonic-gate size_t dd_len2; /* # of bytes to take */ 1387c478bd9Sstevel@tonic-gate } crypto_dual_data_t; 1397c478bd9Sstevel@tonic-gate 1407c478bd9Sstevel@tonic-gate #define dd_format dd_data.cd_format 1417c478bd9Sstevel@tonic-gate #define dd_offset1 dd_data.cd_offset 1427c478bd9Sstevel@tonic-gate #define dd_len1 dd_data.cd_length 1437c478bd9Sstevel@tonic-gate #define dd_miscdata dd_data.cd_miscdata 1447c478bd9Sstevel@tonic-gate #define dd_raw dd_data.cd_raw 1457c478bd9Sstevel@tonic-gate #define dd_uio dd_data.cd_uio 1467c478bd9Sstevel@tonic-gate #define dd_mp dd_data.cd_mp 1477c478bd9Sstevel@tonic-gate 1487c478bd9Sstevel@tonic-gate /* The keys, and their contents */ 1497c478bd9Sstevel@tonic-gate 1507c478bd9Sstevel@tonic-gate typedef enum { 1517c478bd9Sstevel@tonic-gate CRYPTO_KEY_RAW = 1, /* ck_data is a cleartext key */ 1527c478bd9Sstevel@tonic-gate CRYPTO_KEY_REFERENCE, /* ck_obj_id is an opaque reference */ 1537c478bd9Sstevel@tonic-gate CRYPTO_KEY_ATTR_LIST /* ck_attrs is a list of object attributes */ 1547c478bd9Sstevel@tonic-gate } crypto_key_format_t; 1557c478bd9Sstevel@tonic-gate 1567c478bd9Sstevel@tonic-gate typedef uint64_t crypto_attr_type_t; 1577c478bd9Sstevel@tonic-gate 1587c478bd9Sstevel@tonic-gate /* Attribute types to use for passing a RSA public key or a private key. */ 1597c478bd9Sstevel@tonic-gate #define SUN_CKA_MODULUS 0x00000120 1607c478bd9Sstevel@tonic-gate #define SUN_CKA_MODULUS_BITS 0x00000121 1617c478bd9Sstevel@tonic-gate #define SUN_CKA_PUBLIC_EXPONENT 0x00000122 1627c478bd9Sstevel@tonic-gate #define SUN_CKA_PRIVATE_EXPONENT 0x00000123 1637c478bd9Sstevel@tonic-gate #define SUN_CKA_PRIME_1 0x00000124 1647c478bd9Sstevel@tonic-gate #define SUN_CKA_PRIME_2 0x00000125 1657c478bd9Sstevel@tonic-gate #define SUN_CKA_EXPONENT_1 0x00000126 1667c478bd9Sstevel@tonic-gate #define SUN_CKA_EXPONENT_2 0x00000127 1677c478bd9Sstevel@tonic-gate #define SUN_CKA_COEFFICIENT 0x00000128 1687c478bd9Sstevel@tonic-gate #define SUN_CKA_PRIME 0x00000130 1697c478bd9Sstevel@tonic-gate #define SUN_CKA_SUBPRIME 0x00000131 1707c478bd9Sstevel@tonic-gate #define SUN_CKA_BASE 0x00000132 1717c478bd9Sstevel@tonic-gate 1727c478bd9Sstevel@tonic-gate typedef uint32_t crypto_object_id_t; 1737c478bd9Sstevel@tonic-gate 1747c478bd9Sstevel@tonic-gate typedef struct crypto_object_attribute { 1757c478bd9Sstevel@tonic-gate crypto_attr_type_t oa_type; /* attribute type */ 1767c478bd9Sstevel@tonic-gate caddr_t oa_value; /* attribute value */ 1777c478bd9Sstevel@tonic-gate ssize_t oa_value_len; /* length of attribute value */ 1787c478bd9Sstevel@tonic-gate } crypto_object_attribute_t; 1797c478bd9Sstevel@tonic-gate 1807c478bd9Sstevel@tonic-gate typedef struct crypto_key { 1817c478bd9Sstevel@tonic-gate crypto_key_format_t ck_format; /* format identifier */ 1827c478bd9Sstevel@tonic-gate union { 1837c478bd9Sstevel@tonic-gate /* for CRYPTO_KEY_RAW ck_format */ 1847c478bd9Sstevel@tonic-gate struct { 1857c478bd9Sstevel@tonic-gate uint_t cku_v_length; /* # of bits in ck_data */ 1867c478bd9Sstevel@tonic-gate void *cku_v_data; /* ptr to key value */ 1877c478bd9Sstevel@tonic-gate } cku_key_value; 1887c478bd9Sstevel@tonic-gate 1897c478bd9Sstevel@tonic-gate /* for CRYPTO_KEY_REFERENCE ck_format */ 1907c478bd9Sstevel@tonic-gate crypto_object_id_t cku_key_id; /* reference to object key */ 1917c478bd9Sstevel@tonic-gate 1927c478bd9Sstevel@tonic-gate /* for CRYPTO_KEY_ATTR_LIST ck_format */ 1937c478bd9Sstevel@tonic-gate struct { 1947c478bd9Sstevel@tonic-gate uint_t cku_a_count; /* number of attributes */ 1957c478bd9Sstevel@tonic-gate crypto_object_attribute_t *cku_a_oattr; 1967c478bd9Sstevel@tonic-gate } cku_key_attrs; 1977c478bd9Sstevel@tonic-gate } cku_data; /* Crypto Key union */ 1987c478bd9Sstevel@tonic-gate } crypto_key_t; 1997c478bd9Sstevel@tonic-gate 2007c478bd9Sstevel@tonic-gate #define ck_data cku_data.cku_key_value.cku_v_data 2017c478bd9Sstevel@tonic-gate #define ck_length cku_data.cku_key_value.cku_v_length 2027c478bd9Sstevel@tonic-gate #define ck_obj_id cku_data.cku_key_id 2037c478bd9Sstevel@tonic-gate #define ck_count cku_data.cku_key_attrs.cku_a_count 2047c478bd9Sstevel@tonic-gate #define ck_attrs cku_data.cku_key_attrs.cku_a_oattr 2057c478bd9Sstevel@tonic-gate 2067c478bd9Sstevel@tonic-gate /* 2077c478bd9Sstevel@tonic-gate * Raw key lengths are expressed in number of bits. 2087c478bd9Sstevel@tonic-gate * The following macro returns the minimum number of 2097c478bd9Sstevel@tonic-gate * bytes that can contain the specified number of bits. 2107c478bd9Sstevel@tonic-gate */ 2117c478bd9Sstevel@tonic-gate #define CRYPTO_BITS2BYTES(n) (((n) + 7) >> 3) 2127c478bd9Sstevel@tonic-gate 2137c478bd9Sstevel@tonic-gate /* Providers */ 2147c478bd9Sstevel@tonic-gate 2157c478bd9Sstevel@tonic-gate typedef enum { 2167c478bd9Sstevel@tonic-gate CRYPTO_HW_PROVIDER = 0, 2177c478bd9Sstevel@tonic-gate CRYPTO_SW_PROVIDER, 2187c478bd9Sstevel@tonic-gate CRYPTO_LOGICAL_PROVIDER 2197c478bd9Sstevel@tonic-gate } crypto_provider_type_t; 2207c478bd9Sstevel@tonic-gate 2217c478bd9Sstevel@tonic-gate typedef uint32_t crypto_provider_id_t; 2227c478bd9Sstevel@tonic-gate #define KCF_PROVID_INVALID ((uint32_t)-1) 2237c478bd9Sstevel@tonic-gate 2247c478bd9Sstevel@tonic-gate typedef struct crypto_provider_entry { 2257c478bd9Sstevel@tonic-gate crypto_provider_id_t pe_provider_id; 2267c478bd9Sstevel@tonic-gate uint_t pe_mechanism_count; 2277c478bd9Sstevel@tonic-gate } crypto_provider_entry_t; 2287c478bd9Sstevel@tonic-gate 2297c478bd9Sstevel@tonic-gate typedef struct crypto_dev_list_entry { 2307c478bd9Sstevel@tonic-gate char le_dev_name[MAXNAMELEN]; 2317c478bd9Sstevel@tonic-gate uint_t le_dev_instance; 2327c478bd9Sstevel@tonic-gate uint_t le_mechanism_count; 2337c478bd9Sstevel@tonic-gate } crypto_dev_list_entry_t; 2347c478bd9Sstevel@tonic-gate 2357c478bd9Sstevel@tonic-gate /* User type for authentication ioctls and SPI entry points */ 2367c478bd9Sstevel@tonic-gate 2377c478bd9Sstevel@tonic-gate typedef enum crypto_user_type { 2387c478bd9Sstevel@tonic-gate CRYPTO_SO = 0, 2397c478bd9Sstevel@tonic-gate CRYPTO_USER 2407c478bd9Sstevel@tonic-gate } crypto_user_type_t; 2417c478bd9Sstevel@tonic-gate 2427c478bd9Sstevel@tonic-gate /* Version for provider management ioctls and SPI entry points */ 2437c478bd9Sstevel@tonic-gate 2447c478bd9Sstevel@tonic-gate typedef struct crypto_version { 2457c478bd9Sstevel@tonic-gate uchar_t cv_major; 2467c478bd9Sstevel@tonic-gate uchar_t cv_minor; 2477c478bd9Sstevel@tonic-gate } crypto_version_t; 2487c478bd9Sstevel@tonic-gate 2497c478bd9Sstevel@tonic-gate /* session data structure opaque to the consumer */ 2507c478bd9Sstevel@tonic-gate typedef void *crypto_session_t; 2517c478bd9Sstevel@tonic-gate 2527c478bd9Sstevel@tonic-gate typedef uint_t crypto_session_id_t; 2537c478bd9Sstevel@tonic-gate 2547c478bd9Sstevel@tonic-gate /* 2557c478bd9Sstevel@tonic-gate * Common cryptographic status and error codes. 2567c478bd9Sstevel@tonic-gate */ 2577c478bd9Sstevel@tonic-gate #define CRYPTO_SUCCESS 0x00000000 2587c478bd9Sstevel@tonic-gate #define CRYPTO_CANCEL 0x00000001 2597c478bd9Sstevel@tonic-gate #define CRYPTO_HOST_MEMORY 0x00000002 2607c478bd9Sstevel@tonic-gate #define CRYPTO_GENERAL_ERROR 0x00000003 2617c478bd9Sstevel@tonic-gate #define CRYPTO_FAILED 0x00000004 2627c478bd9Sstevel@tonic-gate #define CRYPTO_ARGUMENTS_BAD 0x00000005 2637c478bd9Sstevel@tonic-gate #define CRYPTO_ATTRIBUTE_READ_ONLY 0x00000006 2647c478bd9Sstevel@tonic-gate #define CRYPTO_ATTRIBUTE_SENSITIVE 0x00000007 2657c478bd9Sstevel@tonic-gate #define CRYPTO_ATTRIBUTE_TYPE_INVALID 0x00000008 2667c478bd9Sstevel@tonic-gate #define CRYPTO_ATTRIBUTE_VALUE_INVALID 0x00000009 2677c478bd9Sstevel@tonic-gate #define CRYPTO_CANCELED 0x0000000A 2687c478bd9Sstevel@tonic-gate #define CRYPTO_DATA_INVALID 0x0000000B 2697c478bd9Sstevel@tonic-gate #define CRYPTO_DATA_LEN_RANGE 0x0000000C 2707c478bd9Sstevel@tonic-gate #define CRYPTO_DEVICE_ERROR 0x0000000D 2717c478bd9Sstevel@tonic-gate #define CRYPTO_DEVICE_MEMORY 0x0000000E 2727c478bd9Sstevel@tonic-gate #define CRYPTO_DEVICE_REMOVED 0x0000000F 2737c478bd9Sstevel@tonic-gate #define CRYPTO_ENCRYPTED_DATA_INVALID 0x00000010 2747c478bd9Sstevel@tonic-gate #define CRYPTO_ENCRYPTED_DATA_LEN_RANGE 0x00000011 2757c478bd9Sstevel@tonic-gate #define CRYPTO_KEY_HANDLE_INVALID 0x00000012 2767c478bd9Sstevel@tonic-gate #define CRYPTO_KEY_SIZE_RANGE 0x00000013 2777c478bd9Sstevel@tonic-gate #define CRYPTO_KEY_TYPE_INCONSISTENT 0x00000014 2787c478bd9Sstevel@tonic-gate #define CRYPTO_KEY_NOT_NEEDED 0x00000015 2797c478bd9Sstevel@tonic-gate #define CRYPTO_KEY_CHANGED 0x00000016 2807c478bd9Sstevel@tonic-gate #define CRYPTO_KEY_NEEDED 0x00000017 2817c478bd9Sstevel@tonic-gate #define CRYPTO_KEY_INDIGESTIBLE 0x00000018 2827c478bd9Sstevel@tonic-gate #define CRYPTO_KEY_FUNCTION_NOT_PERMITTED 0x00000019 2837c478bd9Sstevel@tonic-gate #define CRYPTO_KEY_NOT_WRAPPABLE 0x0000001A 2847c478bd9Sstevel@tonic-gate #define CRYPTO_KEY_UNEXTRACTABLE 0x0000001B 2857c478bd9Sstevel@tonic-gate #define CRYPTO_MECHANISM_INVALID 0x0000001C 2867c478bd9Sstevel@tonic-gate #define CRYPTO_MECHANISM_PARAM_INVALID 0x0000001D 2877c478bd9Sstevel@tonic-gate #define CRYPTO_OBJECT_HANDLE_INVALID 0x0000001E 2887c478bd9Sstevel@tonic-gate #define CRYPTO_OPERATION_IS_ACTIVE 0x0000001F 2897c478bd9Sstevel@tonic-gate #define CRYPTO_OPERATION_NOT_INITIALIZED 0x00000020 2907c478bd9Sstevel@tonic-gate #define CRYPTO_PIN_INCORRECT 0x00000021 2917c478bd9Sstevel@tonic-gate #define CRYPTO_PIN_INVALID 0x00000022 2927c478bd9Sstevel@tonic-gate #define CRYPTO_PIN_LEN_RANGE 0x00000023 2937c478bd9Sstevel@tonic-gate #define CRYPTO_PIN_EXPIRED 0x00000024 2947c478bd9Sstevel@tonic-gate #define CRYPTO_PIN_LOCKED 0x00000025 2957c478bd9Sstevel@tonic-gate #define CRYPTO_SESSION_CLOSED 0x00000026 2967c478bd9Sstevel@tonic-gate #define CRYPTO_SESSION_COUNT 0x00000027 2977c478bd9Sstevel@tonic-gate #define CRYPTO_SESSION_HANDLE_INVALID 0x00000028 2987c478bd9Sstevel@tonic-gate #define CRYPTO_SESSION_READ_ONLY 0x00000029 2997c478bd9Sstevel@tonic-gate #define CRYPTO_SESSION_EXISTS 0x0000002A 3007c478bd9Sstevel@tonic-gate #define CRYPTO_SESSION_READ_ONLY_EXISTS 0x0000002B 3017c478bd9Sstevel@tonic-gate #define CRYPTO_SESSION_READ_WRITE_SO_EXISTS 0x0000002C 3027c478bd9Sstevel@tonic-gate #define CRYPTO_SIGNATURE_INVALID 0x0000002D 3037c478bd9Sstevel@tonic-gate #define CRYPTO_SIGNATURE_LEN_RANGE 0x0000002E 3047c478bd9Sstevel@tonic-gate #define CRYPTO_TEMPLATE_INCOMPLETE 0x0000002F 3057c478bd9Sstevel@tonic-gate #define CRYPTO_TEMPLATE_INCONSISTENT 0x00000030 3067c478bd9Sstevel@tonic-gate #define CRYPTO_UNWRAPPING_KEY_HANDLE_INVALID 0x00000031 3077c478bd9Sstevel@tonic-gate #define CRYPTO_UNWRAPPING_KEY_SIZE_RANGE 0x00000032 3087c478bd9Sstevel@tonic-gate #define CRYPTO_UNWRAPPING_KEY_TYPE_INCONSISTENT 0x00000033 3097c478bd9Sstevel@tonic-gate #define CRYPTO_USER_ALREADY_LOGGED_IN 0x00000034 3107c478bd9Sstevel@tonic-gate #define CRYPTO_USER_NOT_LOGGED_IN 0x00000035 3117c478bd9Sstevel@tonic-gate #define CRYPTO_USER_PIN_NOT_INITIALIZED 0x00000036 3127c478bd9Sstevel@tonic-gate #define CRYPTO_USER_TYPE_INVALID 0x00000037 3137c478bd9Sstevel@tonic-gate #define CRYPTO_USER_ANOTHER_ALREADY_LOGGED_IN 0x00000038 3147c478bd9Sstevel@tonic-gate #define CRYPTO_USER_TOO_MANY_TYPES 0x00000039 3157c478bd9Sstevel@tonic-gate #define CRYPTO_WRAPPED_KEY_INVALID 0x0000003A 3167c478bd9Sstevel@tonic-gate #define CRYPTO_WRAPPED_KEY_LEN_RANGE 0x0000003B 3177c478bd9Sstevel@tonic-gate #define CRYPTO_WRAPPING_KEY_HANDLE_INVALID 0x0000003C 3187c478bd9Sstevel@tonic-gate #define CRYPTO_WRAPPING_KEY_SIZE_RANGE 0x0000003D 3197c478bd9Sstevel@tonic-gate #define CRYPTO_WRAPPING_KEY_TYPE_INCONSISTENT 0x0000003E 3207c478bd9Sstevel@tonic-gate #define CRYPTO_RANDOM_SEED_NOT_SUPPORTED 0x0000003F 3217c478bd9Sstevel@tonic-gate #define CRYPTO_RANDOM_NO_RNG 0x00000040 3227c478bd9Sstevel@tonic-gate #define CRYPTO_DOMAIN_PARAMS_INVALID 0x00000041 3237c478bd9Sstevel@tonic-gate #define CRYPTO_BUFFER_TOO_SMALL 0x00000042 3247c478bd9Sstevel@tonic-gate #define CRYPTO_INFORMATION_SENSITIVE 0x00000043 3257c478bd9Sstevel@tonic-gate #define CRYPTO_NOT_SUPPORTED 0x00000044 3267c478bd9Sstevel@tonic-gate 3277c478bd9Sstevel@tonic-gate #define CRYPTO_QUEUED 0x00000045 3287c478bd9Sstevel@tonic-gate #define CRYPTO_BUFFER_TOO_BIG 0x00000046 3297c478bd9Sstevel@tonic-gate #define CRYPTO_INVALID_CONTEXT 0x00000047 3307c478bd9Sstevel@tonic-gate #define CRYPTO_INVALID_MAC 0x00000048 3317c478bd9Sstevel@tonic-gate #define CRYPTO_MECH_NOT_SUPPORTED 0x00000049 3327c478bd9Sstevel@tonic-gate #define CRYPTO_INCONSISTENT_ATTRIBUTE 0x0000004A 3337c478bd9Sstevel@tonic-gate #define CRYPTO_NO_PERMISSION 0x0000004B 3347c478bd9Sstevel@tonic-gate #define CRYPTO_INVALID_PROVIDER_ID 0x0000004C 3357c478bd9Sstevel@tonic-gate #define CRYPTO_VERSION_MISMATCH 0x0000004D 3367c478bd9Sstevel@tonic-gate #define CRYPTO_BUSY 0x0000004E 3377c478bd9Sstevel@tonic-gate #define CRYPTO_UNKNOWN_PROVIDER 0x0000004F 3387c478bd9Sstevel@tonic-gate #define CRYPTO_MODVERIFICATION_FAILED 0x00000050 3397c478bd9Sstevel@tonic-gate #define CRYPTO_OLD_CTX_TEMPLATE 0x00000051 3407c478bd9Sstevel@tonic-gate #define CRYPTO_WEAK_KEY 0x00000052 3417c478bd9Sstevel@tonic-gate 3427c478bd9Sstevel@tonic-gate /* 3437c478bd9Sstevel@tonic-gate * Special values that can be used to indicate that information is unavailable 3447c478bd9Sstevel@tonic-gate * or that there is not practical limit. These values can be used 3457c478bd9Sstevel@tonic-gate * by fields of the SPI crypto_provider_ext_info(9S) structure. 3467c478bd9Sstevel@tonic-gate * The value of CRYPTO_UNAVAILABLE_INFO should be the same as 3477c478bd9Sstevel@tonic-gate * CK_UNAVAILABLE_INFO in the PKCS#11 spec. 3487c478bd9Sstevel@tonic-gate */ 3497c478bd9Sstevel@tonic-gate #define CRYPTO_UNAVAILABLE_INFO ((ulong_t)(-1)) 3507c478bd9Sstevel@tonic-gate #define CRYPTO_EFFECTIVELY_INFINITE 0x0 3517c478bd9Sstevel@tonic-gate 3527c478bd9Sstevel@tonic-gate #ifdef __cplusplus 3537c478bd9Sstevel@tonic-gate } 3547c478bd9Sstevel@tonic-gate #endif 3557c478bd9Sstevel@tonic-gate 3567c478bd9Sstevel@tonic-gate #endif /* _SYS_CRYPTO_COMMON_H */ 357