xref: /titanic_41/usr/src/lib/pkcs11/pkcs11_softtoken/common/softGlobal.h (revision 635216b673cf196ac523ff2a7ab715717e553292)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _SOFTGLOBAL_H
27 #define	_SOFTGLOBAL_H
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #include <security/cryptoki.h>
34 #include <security/pkcs11t.h>
35 
36 /*
37  * The following global variables are defined in softGeneral.c
38  */
39 extern boolean_t softtoken_initialized;
40 extern pthread_mutex_t soft_giant_mutex;
41 extern struct slot soft_slot;
42 extern struct obj_to_be_freed_list obj_delay_freed;
43 extern struct ses_to_be_freed_list ses_delay_freed;
44 extern int softtoken_fips_mode;
45 
46 #define	SOFTTOKEN_SLOTID	1
47 
48 /* CK_INFO: Information about cryptoki */
49 #define	CRYPTOKI_VERSION_MAJOR	2
50 #define	CRYPTOKI_VERSION_MINOR	20
51 #define	LIBRARY_DESCRIPTION	"Sun Crypto Softtoken            "
52 #define	LIBRARY_VERSION_MAJOR	1
53 #define	LIBRARY_VERSION_MINOR	1
54 
55 
56 /* CK_SLOT_INFO: Information about our slot */
57 #define	HARDWARE_VERSION_MAJOR	0
58 #define	HARDWARE_VERSION_MINOR	0
59 #define	FIRMWARE_VERSION_MAJOR	0
60 #define	FIRMWARE_VERSION_MINOR	0
61 
62 /* CK_TOKEN_INFO: More information about token */
63 #define	TOKEN_MODEL		"1.0             "
64 #define	MAX_PIN_LEN		256
65 #define	MIN_PIN_LEN		1
66 
67 #define	SOFT_TOKEN_FLAGS	CKF_RNG|\
68 				CKF_USER_PIN_INITIALIZED|\
69 				CKF_LOGIN_REQUIRED|\
70 				CKF_RESTORE_KEY_NOT_NEEDED|\
71 				CKF_DUAL_CRYPTO_OPERATIONS|\
72 				CKF_TOKEN_INITIALIZED
73 
74 extern CK_RV soft_fips_post(void);
75 
76 #ifdef	__cplusplus
77 }
78 #endif
79 
80 #endif /* _SOFTGLOBAL_H */
81