xref: /titanic_44/usr/src/lib/pkcs11/libpkcs11/common/metaAttrMasters.h (revision 034448fe565200cb042559f50fab6cf751f182c5)
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
5*034448feSmcpowers  * Common Development and Distribution License (the "License").
6*034448feSmcpowers  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*034448feSmcpowers  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef _META_ATTRMASTERS_H
277c478bd9Sstevel@tonic-gate #define	_META_ATTRMASTERS_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
327c478bd9Sstevel@tonic-gate extern "C" {
337c478bd9Sstevel@tonic-gate #endif
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate /*
367c478bd9Sstevel@tonic-gate  * Master object templates
377c478bd9Sstevel@tonic-gate  *
387c478bd9Sstevel@tonic-gate  * [This file should only be included by a single source file. This is a
397c478bd9Sstevel@tonic-gate  * non-traditional header file in that it simply contains a bunch of large,
407c478bd9Sstevel@tonic-gate  * preinitialized static const structures. They're stored here to keep them
417c478bd9Sstevel@tonic-gate  * "out of the way."]
427c478bd9Sstevel@tonic-gate  *
437c478bd9Sstevel@tonic-gate  * In PKCS#11, each object is well-defined... Each object type has an exact
447c478bd9Sstevel@tonic-gate  * set of attributes, and each attribute always has some value. Some
457c478bd9Sstevel@tonic-gate  * attribute values must be specificed when the object is created, others
467c478bd9Sstevel@tonic-gate  * are optional (ie, a default value exisits). Thus, the template an
477c478bd9Sstevel@tonic-gate  * application provides when creating a new object may be a subset of the
487c478bd9Sstevel@tonic-gate  * allowed attributes. The "master" templates presented here, however,
497c478bd9Sstevel@tonic-gate  * are complete.
507c478bd9Sstevel@tonic-gate  */
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate /*
547c478bd9Sstevel@tonic-gate  * Aliases for some field values in generic_attr_t, so that the initialization
557c478bd9Sstevel@tonic-gate  * below isn't just a confusing mess of B_TRUE and B_FALSE. Lint
567c478bd9Sstevel@tonic-gate  * complaints about using "!Foo" in const initializers,
577c478bd9Sstevel@tonic-gate  * so we #define each value.
587c478bd9Sstevel@tonic-gate  */
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate #define	unused		0
617c478bd9Sstevel@tonic-gate #define	Mallocd		B_TRUE
627c478bd9Sstevel@tonic-gate #define	Clone		B_TRUE
637c478bd9Sstevel@tonic-gate #define	EmptyValue	B_TRUE
647c478bd9Sstevel@tonic-gate #define	NotMallocd	B_FALSE
657c478bd9Sstevel@tonic-gate #define	NotClone	B_FALSE
667c478bd9Sstevel@tonic-gate #define	NotEmptyValue	B_FALSE
677c478bd9Sstevel@tonic-gate #define	EMPTYDATE	' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
687c478bd9Sstevel@tonic-gate #define	EMPTY		'\0'
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate /*
717c478bd9Sstevel@tonic-gate  * A note regarding CKA_CLASS and sub-type (eg CKA_KEY_TYPE)
727c478bd9Sstevel@tonic-gate  *
737c478bd9Sstevel@tonic-gate  * These two attributes have been moved to the top of the master template
747c478bd9Sstevel@tonic-gate  * definitions. All the metaslot code assumes that CKA_CLASS resides in index=0,
757c478bd9Sstevel@tonic-gate  * and the sub-type resides in index=1.
767c478bd9Sstevel@tonic-gate  */
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate /*
807c478bd9Sstevel@tonic-gate  * Common storage object attributes, Table 19 (p81) of PKCS#11 2.11r1 spec.
817c478bd9Sstevel@tonic-gate  */
827c478bd9Sstevel@tonic-gate #define	COMMON_STORAGE_ATTRIBUTES					\
837c478bd9Sstevel@tonic-gate 	{ { CKA_TOKEN, NULL, sizeof (CK_BBOOL) },			\
84*034448feSmcpowers 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
857c478bd9Sstevel@tonic-gate 		CK_FALSE, unused, { unused } },				\
867c478bd9Sstevel@tonic-gate 	{ { CKA_PRIVATE, NULL, sizeof (CK_BBOOL) },			\
87*034448feSmcpowers 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
887c478bd9Sstevel@tonic-gate 		CK_FALSE, unused, { unused } },				\
897c478bd9Sstevel@tonic-gate 	{ { CKA_MODIFIABLE, NULL, sizeof (CK_BBOOL) },			\
907c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
917c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
927c478bd9Sstevel@tonic-gate 	{ { CKA_LABEL, NULL, 0 },					\
937c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,			\
947c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } }
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate /*
977c478bd9Sstevel@tonic-gate  * Common certificate attributes, Table 21 (p83) of PKCS#11 2.11r1 spec.
987c478bd9Sstevel@tonic-gate  * (CKA_CERTIFICATE_TYPE has been moved, to place at top of template)
997c478bd9Sstevel@tonic-gate  *
1007c478bd9Sstevel@tonic-gate  */
1017c478bd9Sstevel@tonic-gate #define	COMMON_CERTIFICATE_ATTRIBUTES					\
1027c478bd9Sstevel@tonic-gate 	{ { CKA_TRUSTED, NULL, sizeof (CK_BBOOL) },			\
1037c478bd9Sstevel@tonic-gate 		NotMallocd, NotClone, NotEmptyValue, B_FALSE,		\
1047c478bd9Sstevel@tonic-gate 		CK_FALSE, unused, { unused } }
1057c478bd9Sstevel@tonic-gate 
1067c478bd9Sstevel@tonic-gate /*
1077c478bd9Sstevel@tonic-gate  * Common key attributes, Table 25 (p89) of PKCS#11 2.11r1 spec.
1087c478bd9Sstevel@tonic-gate  * (CKA_KEY_TYPE has been moved, to place at top of template)
1097c478bd9Sstevel@tonic-gate  *
1107c478bd9Sstevel@tonic-gate  */
1117c478bd9Sstevel@tonic-gate #define	COMMON_KEY_ATTRIBUTES						\
1127c478bd9Sstevel@tonic-gate 	{ { CKA_ID, NULL, 0 },						\
1137c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,			\
1147c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },				\
1157c478bd9Sstevel@tonic-gate 	{ { CKA_START_DATE, NULL, sizeof (CK_DATE) },			\
1167c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,			\
1177c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTYDATE } },			\
1187c478bd9Sstevel@tonic-gate 	{ { CKA_END_DATE, NULL, sizeof (CK_DATE) },			\
1197c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,			\
1207c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTYDATE } },			\
1217c478bd9Sstevel@tonic-gate 	{ { CKA_DERIVE, NULL, sizeof (CK_BBOOL) },			\
1227c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
1237c478bd9Sstevel@tonic-gate 		CK_FALSE, unused, { unused } },				\
1247c478bd9Sstevel@tonic-gate 	{ { CKA_LOCAL, NULL, sizeof (CK_BBOOL) },			\
1257c478bd9Sstevel@tonic-gate 		NotMallocd, NotClone, NotEmptyValue, B_FALSE,		\
1267c478bd9Sstevel@tonic-gate 		CK_FALSE, unused, { unused } },				\
1277c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_GEN_MECHANISM, NULL, sizeof (CK_MECHANISM_TYPE) },	\
1287c478bd9Sstevel@tonic-gate 		NotMallocd, NotClone, EmptyValue, B_FALSE,		\
1297c478bd9Sstevel@tonic-gate 		unused, CK_UNAVAILABLE_INFORMATION, { unused } }
1307c478bd9Sstevel@tonic-gate 
1317c478bd9Sstevel@tonic-gate /*
1327c478bd9Sstevel@tonic-gate  * Common public-key attributes, Table 26 (p90) of PKCS#11 2.11r1 spec.
1337c478bd9Sstevel@tonic-gate  *
1347c478bd9Sstevel@tonic-gate  * CKA_SUBJECT has the PKCS#11-specified default. The object-usage attributes
1357c478bd9Sstevel@tonic-gate  * are token-specific defaults.
1367c478bd9Sstevel@tonic-gate  *
1377c478bd9Sstevel@tonic-gate  */
1387c478bd9Sstevel@tonic-gate #define	COMMON_PUBKEY_ATTRIBUTES					\
1397c478bd9Sstevel@tonic-gate 	{ { CKA_SUBJECT, NULL, 0 },					\
1407c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,			\
1417c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },				\
1427c478bd9Sstevel@tonic-gate 	{ { CKA_ENCRYPT, NULL, sizeof (CK_BBOOL) },			\
1437c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
1447c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
1457c478bd9Sstevel@tonic-gate 	{ { CKA_VERIFY, NULL, sizeof (CK_BBOOL) },			\
1467c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
1477c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
1487c478bd9Sstevel@tonic-gate 	{ { CKA_VERIFY_RECOVER, NULL, sizeof (CK_BBOOL) },		\
1497c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
1507c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
1517c478bd9Sstevel@tonic-gate 	{ { CKA_WRAP, NULL, sizeof (CK_BBOOL) },			\
1527c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
1537c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
1547c478bd9Sstevel@tonic-gate 	{ { CKA_TRUSTED, NULL, sizeof (CK_BBOOL) },			\
1557c478bd9Sstevel@tonic-gate 		NotMallocd, NotClone, NotEmptyValue, B_FALSE,		\
1567c478bd9Sstevel@tonic-gate 		CK_FALSE, unused, { unused } }
1577c478bd9Sstevel@tonic-gate 
1587c478bd9Sstevel@tonic-gate /*
1597c478bd9Sstevel@tonic-gate  * Common private-key attributes, Table 34 (p97) of PKCS#11 2.11r1 spec.
1607c478bd9Sstevel@tonic-gate  */
1617c478bd9Sstevel@tonic-gate #define	COMMON_PRIVKEY_ATTRIBUTES					\
1627c478bd9Sstevel@tonic-gate 	{ { CKA_SUBJECT, NULL, 0 },					\
1637c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,			\
1647c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },				\
1657c478bd9Sstevel@tonic-gate 	{ { CKA_SENSITIVE, NULL, sizeof (CK_BBOOL) },			\
1667c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
1677c478bd9Sstevel@tonic-gate 		CK_FALSE, unused, { unused } },				\
1687c478bd9Sstevel@tonic-gate 	{ { CKA_SECONDARY_AUTH, NULL, sizeof (CK_BBOOL) },		\
1697c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,			\
1707c478bd9Sstevel@tonic-gate 		CK_FALSE, unused, { unused } },				\
1717c478bd9Sstevel@tonic-gate 	{ { CKA_DECRYPT, NULL, sizeof (CK_BBOOL) },			\
1727c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
1737c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
1747c478bd9Sstevel@tonic-gate 	{ { CKA_SIGN, NULL, sizeof (CK_BBOOL) },			\
1757c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
1767c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
1777c478bd9Sstevel@tonic-gate 	{ { CKA_SIGN_RECOVER, NULL, sizeof (CK_BBOOL) },		\
1787c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
1797c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
1807c478bd9Sstevel@tonic-gate 	{ { CKA_UNWRAP, NULL, sizeof (CK_BBOOL) },			\
1817c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
1827c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
1837c478bd9Sstevel@tonic-gate 	{ { CKA_EXTRACTABLE, NULL, sizeof (CK_BBOOL) },			\
1847c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
1857c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
1867c478bd9Sstevel@tonic-gate 	{ { CKA_ALWAYS_SENSITIVE, NULL, sizeof (CK_BBOOL) },		\
1877c478bd9Sstevel@tonic-gate 		NotMallocd, NotClone, NotEmptyValue, B_FALSE,		\
1887c478bd9Sstevel@tonic-gate 		CK_FALSE, unused, { unused } },				\
1897c478bd9Sstevel@tonic-gate 	{ { CKA_NEVER_EXTRACTABLE, NULL, sizeof (CK_BBOOL) },		\
1907c478bd9Sstevel@tonic-gate 		NotMallocd, NotClone, NotEmptyValue, B_FALSE,		\
1917c478bd9Sstevel@tonic-gate 		CK_FALSE, unused, { unused } }
1927c478bd9Sstevel@tonic-gate 
1937c478bd9Sstevel@tonic-gate 
1947c478bd9Sstevel@tonic-gate /*
1957c478bd9Sstevel@tonic-gate  * Common secret-key attributes, Table 42 (p108) of PKCS#11 2.11r1 spec.
1967c478bd9Sstevel@tonic-gate  */
1977c478bd9Sstevel@tonic-gate #define	COMMON_SECKEY_ATTRIBUTES					\
1987c478bd9Sstevel@tonic-gate 	{ { CKA_SENSITIVE, NULL, sizeof (CK_BBOOL) },			\
1997c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
2007c478bd9Sstevel@tonic-gate 		CK_FALSE, unused, { unused } },				\
2017c478bd9Sstevel@tonic-gate 	{ { CKA_ENCRYPT, NULL, sizeof (CK_BBOOL) },			\
2027c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
2037c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
2047c478bd9Sstevel@tonic-gate 	{ { CKA_DECRYPT, NULL, sizeof (CK_BBOOL) },			\
2057c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
2067c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
2077c478bd9Sstevel@tonic-gate 	{ { CKA_SIGN, NULL, sizeof (CK_BBOOL) },			\
2087c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
2097c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
2107c478bd9Sstevel@tonic-gate 	{ { CKA_VERIFY, NULL, sizeof (CK_BBOOL) },			\
2117c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
2127c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
2137c478bd9Sstevel@tonic-gate 	{ { CKA_WRAP, NULL, sizeof (CK_BBOOL) },			\
2147c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
2157c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
2167c478bd9Sstevel@tonic-gate 	{ { CKA_UNWRAP, NULL, sizeof (CK_BBOOL) },			\
2177c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
2187c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
2197c478bd9Sstevel@tonic-gate 	{ { CKA_EXTRACTABLE, NULL, sizeof (CK_BBOOL) },			\
2207c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
2217c478bd9Sstevel@tonic-gate 		CK_TRUE, unused, { unused } },				\
2227c478bd9Sstevel@tonic-gate 	{ { CKA_ALWAYS_SENSITIVE, NULL, sizeof (CK_BBOOL) },		\
2237c478bd9Sstevel@tonic-gate 		NotMallocd, NotClone, NotEmptyValue, B_FALSE,		\
2247c478bd9Sstevel@tonic-gate 		CK_FALSE, unused, { unused } },				\
2257c478bd9Sstevel@tonic-gate 	{ { CKA_NEVER_EXTRACTABLE, NULL, sizeof (CK_BBOOL) },		\
2267c478bd9Sstevel@tonic-gate 		NotMallocd, NotClone, NotEmptyValue, B_FALSE,		\
2277c478bd9Sstevel@tonic-gate 		CK_FALSE, unused, { unused } }
2287c478bd9Sstevel@tonic-gate 
2297c478bd9Sstevel@tonic-gate /*
2307c478bd9Sstevel@tonic-gate  * Common domain-paramaters attributes, Table 60 (p123) of PKCS#11 2.11r1 spec.
2317c478bd9Sstevel@tonic-gate  * (CKA_KEY_TYPE has been removed, to place elsewhere)
2327c478bd9Sstevel@tonic-gate  */
2337c478bd9Sstevel@tonic-gate #define	COMMON_DOMAIN_ATTRIBUTES					\
2347c478bd9Sstevel@tonic-gate 	{ { CKA_LOCAL, NULL, sizeof (CK_BBOOL) },			\
2357c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,		\
2367c478bd9Sstevel@tonic-gate 		CK_FALSE, unused, { unused } }
2377c478bd9Sstevel@tonic-gate 
2387c478bd9Sstevel@tonic-gate 
2397c478bd9Sstevel@tonic-gate /* ========================= HW Objects ========================= */
2407c478bd9Sstevel@tonic-gate 
2417c478bd9Sstevel@tonic-gate 
2427c478bd9Sstevel@tonic-gate /*
2437c478bd9Sstevel@tonic-gate  * Master template for: CKO_HW_FEATURE + CKH_CLOCK
2447c478bd9Sstevel@tonic-gate  */
2457c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_HW_CLOCK[] =
2467c478bd9Sstevel@tonic-gate {
2477c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
2487c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
2497c478bd9Sstevel@tonic-gate 		unused, CKO_HW_FEATURE, { unused } },
2507c478bd9Sstevel@tonic-gate 	{ { CKA_HW_FEATURE_TYPE, NULL, sizeof (CK_HW_FEATURE_TYPE) },
2517c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
2527c478bd9Sstevel@tonic-gate 		unused, CKH_CLOCK, { unused } },
2537c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE, NULL, 16 },
2547c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
2557c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTYDATE, EMPTYDATE } }
2567c478bd9Sstevel@tonic-gate };
2577c478bd9Sstevel@tonic-gate 
2587c478bd9Sstevel@tonic-gate 
2597c478bd9Sstevel@tonic-gate /*
2607c478bd9Sstevel@tonic-gate  * Master template for: CKO_HW_FEATURE + CKH_MONOTONIC_COUNTER
2617c478bd9Sstevel@tonic-gate  *
2627c478bd9Sstevel@tonic-gate  * NOTE: no sub-type for this class!
2637c478bd9Sstevel@tonic-gate  */
2647c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_HW_MONOTONIC[] =
2657c478bd9Sstevel@tonic-gate {
2667c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
2677c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
2687c478bd9Sstevel@tonic-gate 		unused, CKO_HW_FEATURE, { unused } },
2697c478bd9Sstevel@tonic-gate 	{ { CKA_HW_FEATURE_TYPE, NULL, sizeof (CK_HW_FEATURE_TYPE) },
2707c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
2717c478bd9Sstevel@tonic-gate 		unused, CKH_MONOTONIC_COUNTER, { unused } },
2727c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE, NULL, 0 },
2737c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
2747c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
2757c478bd9Sstevel@tonic-gate 	{ { CKA_RESET_ON_INIT, NULL, sizeof (CK_BBOOL) },
2767c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
2777c478bd9Sstevel@tonic-gate 		CK_FALSE, unused, { unused } },
2787c478bd9Sstevel@tonic-gate 	{ { CKA_HAS_RESET, NULL, sizeof (CK_BBOOL) },
2797c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
2807c478bd9Sstevel@tonic-gate 		CK_FALSE, unused, { unused } }
2817c478bd9Sstevel@tonic-gate };
2827c478bd9Sstevel@tonic-gate 
2837c478bd9Sstevel@tonic-gate 
2847c478bd9Sstevel@tonic-gate /* ========================= Data Objects ========================= */
2857c478bd9Sstevel@tonic-gate 
2867c478bd9Sstevel@tonic-gate 
2877c478bd9Sstevel@tonic-gate /*
2887c478bd9Sstevel@tonic-gate  * Master template for CKO_DATA + (no subtypes for this class)
2897c478bd9Sstevel@tonic-gate  *
2907c478bd9Sstevel@tonic-gate  * Defaults are according to PKCS#11.
2917c478bd9Sstevel@tonic-gate  *
2927c478bd9Sstevel@tonic-gate  * NOTE: no sub-type for this class!
2937c478bd9Sstevel@tonic-gate  */
2947c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_DATA[] =
2957c478bd9Sstevel@tonic-gate {
2967c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
2977c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
2987c478bd9Sstevel@tonic-gate 		unused, CKO_DATA, { unused } },
2997c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
3007c478bd9Sstevel@tonic-gate 	{ { CKA_APPLICATION, NULL, 0 },
3017c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
3027c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
3037c478bd9Sstevel@tonic-gate 	{ { CKA_OBJECT_ID, NULL, 0 },
3047c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
3057c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
3067c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE, NULL, 0 },
3077c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
3087c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } }
3097c478bd9Sstevel@tonic-gate };
3107c478bd9Sstevel@tonic-gate 
3117c478bd9Sstevel@tonic-gate 
3127c478bd9Sstevel@tonic-gate /* ========================= Certificate Objects ========================= */
3137c478bd9Sstevel@tonic-gate 
3147c478bd9Sstevel@tonic-gate 
3157c478bd9Sstevel@tonic-gate /*
3167c478bd9Sstevel@tonic-gate  * Master template for CKO_CERTIFICATE + CKC_X_509
3177c478bd9Sstevel@tonic-gate  *
3187c478bd9Sstevel@tonic-gate  * Defaults are according to PKCS#11.
3197c478bd9Sstevel@tonic-gate  */
3207c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_CERT_X509[] =
3217c478bd9Sstevel@tonic-gate {
3227c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
3237c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
3247c478bd9Sstevel@tonic-gate 		unused, CKO_CERTIFICATE, { unused } },
3257c478bd9Sstevel@tonic-gate 	{ { CKA_CERTIFICATE_TYPE, NULL, sizeof (CK_CERTIFICATE_TYPE) },
3267c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
3277c478bd9Sstevel@tonic-gate 		unused, CKC_X_509, { unused } },
3287c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
3297c478bd9Sstevel@tonic-gate 	COMMON_CERTIFICATE_ATTRIBUTES,
3307c478bd9Sstevel@tonic-gate 	{ { CKA_SUBJECT, NULL, 0 },
3317c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
3327c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
3337c478bd9Sstevel@tonic-gate 	{ { CKA_ID, NULL, 0 },
3347c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,
3357c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
3367c478bd9Sstevel@tonic-gate 	{ { CKA_ISSUER, NULL, 0 },
3377c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,
3387c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
3397c478bd9Sstevel@tonic-gate 	{ { CKA_SERIAL_NUMBER, NULL, 0 },
3407c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,
3417c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
3427c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE, NULL, 0 },
3437c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
3447c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } }
3457c478bd9Sstevel@tonic-gate };
3467c478bd9Sstevel@tonic-gate 
3477c478bd9Sstevel@tonic-gate 
3487c478bd9Sstevel@tonic-gate /*
3497c478bd9Sstevel@tonic-gate  * Master template for CKO_CERTIFICATE + CKC_X_509_ATTR_CERT
3507c478bd9Sstevel@tonic-gate  *
3517c478bd9Sstevel@tonic-gate  * Defaults are according to PKCS#11.
3527c478bd9Sstevel@tonic-gate  */
3537c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_CERT_X509ATTR[] =
3547c478bd9Sstevel@tonic-gate {
3557c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
3567c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
3577c478bd9Sstevel@tonic-gate 		unused, CKO_CERTIFICATE, { unused } },
3587c478bd9Sstevel@tonic-gate 	{ { CKA_CERTIFICATE_TYPE, NULL, sizeof (CK_CERTIFICATE_TYPE) },
3597c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
3607c478bd9Sstevel@tonic-gate 		unused, CKC_X_509_ATTR_CERT, { unused } },
3617c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
3627c478bd9Sstevel@tonic-gate 	COMMON_CERTIFICATE_ATTRIBUTES,
3637c478bd9Sstevel@tonic-gate 	{ { CKA_OWNER, NULL, 0 },
3647c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
3657c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
3667c478bd9Sstevel@tonic-gate 	{ { CKA_AC_ISSUER, NULL, 0 },
3677c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,
3687c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
3697c478bd9Sstevel@tonic-gate 	{ { CKA_SERIAL_NUMBER, NULL, 0 },
3707c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,
3717c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
3727c478bd9Sstevel@tonic-gate 	{ { CKA_ATTR_TYPES, NULL, 0 },
3737c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,
3747c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
3757c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE, NULL, 0 },
3767c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
3777c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } }
3787c478bd9Sstevel@tonic-gate };
3797c478bd9Sstevel@tonic-gate 
3807c478bd9Sstevel@tonic-gate 
3817c478bd9Sstevel@tonic-gate /* ========================= Public Keys ========================= */
3827c478bd9Sstevel@tonic-gate 
3837c478bd9Sstevel@tonic-gate 
3847c478bd9Sstevel@tonic-gate /*
3857c478bd9Sstevel@tonic-gate  * Master template for CKO_PUBLIC_KEY + CKK_RSA
3867c478bd9Sstevel@tonic-gate  */
3877c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_PUBKEY_RSA[] =
3887c478bd9Sstevel@tonic-gate {
3897c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
3907c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
3917c478bd9Sstevel@tonic-gate 		unused, CKO_PUBLIC_KEY, { unused } },
3927c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
3937c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
3947c478bd9Sstevel@tonic-gate 		unused, CKK_RSA, { unused } },
3957c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
3967c478bd9Sstevel@tonic-gate 	COMMON_KEY_ATTRIBUTES,
3977c478bd9Sstevel@tonic-gate 	COMMON_PUBKEY_ATTRIBUTES,
3987c478bd9Sstevel@tonic-gate 	{ { CKA_MODULUS, NULL, 0 },
3997c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4007c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
4017c478bd9Sstevel@tonic-gate 	{ { CKA_MODULUS_BITS, NULL, sizeof (CK_ULONG)},
4027c478bd9Sstevel@tonic-gate 		NotMallocd, NotClone, NotEmptyValue, B_FALSE,
4037c478bd9Sstevel@tonic-gate 		unused, 0, { unused } },
4047c478bd9Sstevel@tonic-gate 	{ { CKA_PUBLIC_EXPONENT, NULL, 0 },
4057c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4067c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } }
4077c478bd9Sstevel@tonic-gate };
4087c478bd9Sstevel@tonic-gate 
4097c478bd9Sstevel@tonic-gate 
4107c478bd9Sstevel@tonic-gate /*
4117c478bd9Sstevel@tonic-gate  * Master template for CKO_PUBLIC_KEY + CKK_DSA
4127c478bd9Sstevel@tonic-gate  *
4137c478bd9Sstevel@tonic-gate  */
4147c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_PUBKEY_DSA[] =
4157c478bd9Sstevel@tonic-gate {
4167c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
4177c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4187c478bd9Sstevel@tonic-gate 		unused, CKO_PUBLIC_KEY, { unused } },
4197c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
4207c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4217c478bd9Sstevel@tonic-gate 		unused, CKK_DSA, { unused } },
4227c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
4237c478bd9Sstevel@tonic-gate 	COMMON_KEY_ATTRIBUTES,
4247c478bd9Sstevel@tonic-gate 	COMMON_PUBKEY_ATTRIBUTES,
4257c478bd9Sstevel@tonic-gate 	{ { CKA_PRIME, NULL, 0 },
4267c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4277c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
4287c478bd9Sstevel@tonic-gate 	{ { CKA_SUBPRIME, NULL, 0 },
4297c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4307c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
4317c478bd9Sstevel@tonic-gate 	{ { CKA_BASE, NULL, 0 },
4327c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4337c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
4347c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE, NULL, 0 },
4357c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4367c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } }
4377c478bd9Sstevel@tonic-gate };
4387c478bd9Sstevel@tonic-gate 
4397c478bd9Sstevel@tonic-gate 
4407c478bd9Sstevel@tonic-gate /*
4417c478bd9Sstevel@tonic-gate  * Master template for CKO_PUBLIC_KEY + CKK_EC
4427c478bd9Sstevel@tonic-gate  *
4437c478bd9Sstevel@tonic-gate  */
4447c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_PUBKEY_EC[] =
4457c478bd9Sstevel@tonic-gate {
4467c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
4477c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4487c478bd9Sstevel@tonic-gate 		unused, CKO_PUBLIC_KEY, { unused } },
4497c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
4507c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4517c478bd9Sstevel@tonic-gate 		unused, CKK_EC, { unused } },
4527c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
4537c478bd9Sstevel@tonic-gate 	COMMON_KEY_ATTRIBUTES,
4547c478bd9Sstevel@tonic-gate 	COMMON_PUBKEY_ATTRIBUTES,
4557c478bd9Sstevel@tonic-gate 	{ { CKA_EC_PARAMS, NULL, 0 },
4567c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4577c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
4587c478bd9Sstevel@tonic-gate 	{ { CKA_EC_POINT, NULL, 0 },
4597c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4607c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } }
4617c478bd9Sstevel@tonic-gate };
4627c478bd9Sstevel@tonic-gate 
4637c478bd9Sstevel@tonic-gate 
4647c478bd9Sstevel@tonic-gate /*
4657c478bd9Sstevel@tonic-gate  * Master template for CKO_PUBLIC_KEY + CKK_DH
4667c478bd9Sstevel@tonic-gate  *
4677c478bd9Sstevel@tonic-gate  */
4687c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_PUBKEY_DH[] =
4697c478bd9Sstevel@tonic-gate {
4707c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
4717c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4727c478bd9Sstevel@tonic-gate 		unused, CKO_PUBLIC_KEY, { unused } },
4737c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
4747c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4757c478bd9Sstevel@tonic-gate 		unused, CKK_DH, { unused } },
4767c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
4777c478bd9Sstevel@tonic-gate 	COMMON_KEY_ATTRIBUTES,
4787c478bd9Sstevel@tonic-gate 	COMMON_PUBKEY_ATTRIBUTES,
4797c478bd9Sstevel@tonic-gate 	{ { CKA_PRIME, NULL, 0 },
4807c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4817c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
4827c478bd9Sstevel@tonic-gate 	{ { CKA_BASE, NULL, 0 },
4837c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4847c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
4857c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE, NULL, 0 },
4867c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4877c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } }
4887c478bd9Sstevel@tonic-gate };
4897c478bd9Sstevel@tonic-gate 
4907c478bd9Sstevel@tonic-gate 
4917c478bd9Sstevel@tonic-gate /*
4927c478bd9Sstevel@tonic-gate  * Master template for CKO_PUBLIC_KEY + CKK_X9_42_DH
4937c478bd9Sstevel@tonic-gate  *
4947c478bd9Sstevel@tonic-gate  */
4957c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_PUBKEY_X942DH[] =
4967c478bd9Sstevel@tonic-gate {
4977c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
4987c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
4997c478bd9Sstevel@tonic-gate 		unused, CKO_PUBLIC_KEY, { unused } },
5007c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
5017c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
5027c478bd9Sstevel@tonic-gate 		unused, CKK_X9_42_DH, { unused } },
5037c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
5047c478bd9Sstevel@tonic-gate 	COMMON_KEY_ATTRIBUTES,
5057c478bd9Sstevel@tonic-gate 	COMMON_PUBKEY_ATTRIBUTES,
5067c478bd9Sstevel@tonic-gate 	{ { CKA_PRIME, NULL, 0 },
5077c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
5087c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
5097c478bd9Sstevel@tonic-gate 	{ { CKA_BASE, NULL, 0 },
5107c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
5117c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
5127c478bd9Sstevel@tonic-gate 	{ { CKA_SUBPRIME, NULL, 0 },
5137c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
5147c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
5157c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE, NULL, 0 },
5167c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
5177c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } }
5187c478bd9Sstevel@tonic-gate };
5197c478bd9Sstevel@tonic-gate 
5207c478bd9Sstevel@tonic-gate 
5217c478bd9Sstevel@tonic-gate /*
5227c478bd9Sstevel@tonic-gate  * Master template for CKO_PUBLIC_KEY + CKK_KEA
5237c478bd9Sstevel@tonic-gate  *
5247c478bd9Sstevel@tonic-gate  */
5257c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_PUBKEY_KEA[] =
5267c478bd9Sstevel@tonic-gate {
5277c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
5287c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
5297c478bd9Sstevel@tonic-gate 		unused, CKO_PUBLIC_KEY, { unused } },
5307c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
5317c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
5327c478bd9Sstevel@tonic-gate 		unused, CKK_KEA, { unused } },
5337c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
5347c478bd9Sstevel@tonic-gate 	COMMON_KEY_ATTRIBUTES,
5357c478bd9Sstevel@tonic-gate 	COMMON_PUBKEY_ATTRIBUTES,
5367c478bd9Sstevel@tonic-gate 	{ { CKA_PRIME, NULL, 0 },
5377c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
5387c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
5397c478bd9Sstevel@tonic-gate 	{ { CKA_BASE, NULL, 0 },
5407c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
5417c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
5427c478bd9Sstevel@tonic-gate 	{ { CKA_SUBPRIME, NULL, 0 },
5437c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
5447c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
5457c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE, NULL, 0 },
5467c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
5477c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } }
5487c478bd9Sstevel@tonic-gate };
5497c478bd9Sstevel@tonic-gate 
5507c478bd9Sstevel@tonic-gate 
5517c478bd9Sstevel@tonic-gate /* ========================= Private Keys ========================= */
5527c478bd9Sstevel@tonic-gate 
5537c478bd9Sstevel@tonic-gate 
5547c478bd9Sstevel@tonic-gate /*
5557c478bd9Sstevel@tonic-gate  * Master template for CKO_PRIVATE_KEY + CKK_RSA
5567c478bd9Sstevel@tonic-gate  *
5577c478bd9Sstevel@tonic-gate  */
5587c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_PRIVKEY_RSA[] =
5597c478bd9Sstevel@tonic-gate {
5607c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
5617c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
5627c478bd9Sstevel@tonic-gate 		unused, CKO_PRIVATE_KEY, { unused } },
5637c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
5647c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
5657c478bd9Sstevel@tonic-gate 		unused, CKK_RSA, { unused } },
5667c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
5677c478bd9Sstevel@tonic-gate 	COMMON_KEY_ATTRIBUTES,
5687c478bd9Sstevel@tonic-gate 	COMMON_PRIVKEY_ATTRIBUTES,
5697c478bd9Sstevel@tonic-gate 	{ { CKA_MODULUS, NULL, 0 },
5707c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
5717c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
5727c478bd9Sstevel@tonic-gate 	{ { CKA_PRIVATE_EXPONENT, NULL, 0 },
5737c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
5747c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
5757c478bd9Sstevel@tonic-gate 	{ { CKA_PUBLIC_EXPONENT, NULL, 0 },
5767c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,
5777c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
5787c478bd9Sstevel@tonic-gate 	{ { CKA_PRIME_1, NULL, 0 },
5797c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,
5807c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
5817c478bd9Sstevel@tonic-gate 	{ { CKA_PRIME_2, NULL, 0 },
5827c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,
5837c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
5847c478bd9Sstevel@tonic-gate 	{ { CKA_EXPONENT_1, NULL, 0 },
5857c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,
5867c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
5877c478bd9Sstevel@tonic-gate 	{ { CKA_EXPONENT_2, NULL, 0 },
5887c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,
5897c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
5907c478bd9Sstevel@tonic-gate 	{ { CKA_COEFFICIENT, NULL, 0 },
5917c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, EmptyValue, B_FALSE,
5927c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } }
5937c478bd9Sstevel@tonic-gate };
5947c478bd9Sstevel@tonic-gate 
5957c478bd9Sstevel@tonic-gate 
5967c478bd9Sstevel@tonic-gate /*
5977c478bd9Sstevel@tonic-gate  * Master template for CKO_PRIVATE_KEY + CKK_DSA
5987c478bd9Sstevel@tonic-gate  *
5997c478bd9Sstevel@tonic-gate  */
6007c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_PRIVKEY_DSA[] =
6017c478bd9Sstevel@tonic-gate {
6027c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
6037c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6047c478bd9Sstevel@tonic-gate 		unused, CKO_PRIVATE_KEY, { unused } },
6057c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
6067c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6077c478bd9Sstevel@tonic-gate 		unused, CKK_DSA, { unused } },
6087c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
6097c478bd9Sstevel@tonic-gate 	COMMON_KEY_ATTRIBUTES,
6107c478bd9Sstevel@tonic-gate 	COMMON_PRIVKEY_ATTRIBUTES,
6117c478bd9Sstevel@tonic-gate 	{ { CKA_PRIME, NULL, 0 },
6127c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6137c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
6147c478bd9Sstevel@tonic-gate 	{ { CKA_SUBPRIME, NULL, 0 },
6157c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6167c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
6177c478bd9Sstevel@tonic-gate 	{ { CKA_BASE, NULL, 0 },
6187c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6197c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
6207c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE, NULL, 0 },
6217c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6227c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } }
6237c478bd9Sstevel@tonic-gate };
6247c478bd9Sstevel@tonic-gate 
6257c478bd9Sstevel@tonic-gate 
6267c478bd9Sstevel@tonic-gate /*
6277c478bd9Sstevel@tonic-gate  * Master template for CKO_PRIVATE_KEY + CKK_EC
6287c478bd9Sstevel@tonic-gate  *
6297c478bd9Sstevel@tonic-gate  */
6307c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_PRIVKEY_EC[] =
6317c478bd9Sstevel@tonic-gate {
6327c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
6337c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6347c478bd9Sstevel@tonic-gate 		unused, CKO_PRIVATE_KEY, { unused } },
6357c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
6367c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6377c478bd9Sstevel@tonic-gate 		unused, CKK_EC, { unused } },
6387c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
6397c478bd9Sstevel@tonic-gate 	COMMON_KEY_ATTRIBUTES,
6407c478bd9Sstevel@tonic-gate 	COMMON_PRIVKEY_ATTRIBUTES,
6417c478bd9Sstevel@tonic-gate 	{ { CKA_EC_PARAMS, NULL, 0 },
6427c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6437c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
6447c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE, NULL, 0 },
6457c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6467c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } }
6477c478bd9Sstevel@tonic-gate };
6487c478bd9Sstevel@tonic-gate 
6497c478bd9Sstevel@tonic-gate 
6507c478bd9Sstevel@tonic-gate /*
6517c478bd9Sstevel@tonic-gate  * Master template for CKO_PRIVATE_KEY + CKK_DH
6527c478bd9Sstevel@tonic-gate  */
6537c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_PRIVKEY_DH[] =
6547c478bd9Sstevel@tonic-gate {
6557c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
6567c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6577c478bd9Sstevel@tonic-gate 		unused, CKO_PRIVATE_KEY, { unused } },
6587c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
6597c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6607c478bd9Sstevel@tonic-gate 		unused, CKK_DH, { unused } },
6617c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
6627c478bd9Sstevel@tonic-gate 	COMMON_KEY_ATTRIBUTES,
6637c478bd9Sstevel@tonic-gate 	COMMON_PRIVKEY_ATTRIBUTES,
6647c478bd9Sstevel@tonic-gate 	{ { CKA_PRIME, NULL, 0 },
6657c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6667c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
6677c478bd9Sstevel@tonic-gate 	{ { CKA_BASE, NULL, 0 },
6687c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6697c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
6707c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE, NULL, 0 },
6717c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6727c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
6737c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE_BITS, NULL, sizeof (CK_ULONG) },
6747c478bd9Sstevel@tonic-gate 		NotMallocd, NotClone, NotEmptyValue, B_FALSE,
6757c478bd9Sstevel@tonic-gate 		unused, 0, { unused } }
6767c478bd9Sstevel@tonic-gate };
6777c478bd9Sstevel@tonic-gate 
6787c478bd9Sstevel@tonic-gate 
6797c478bd9Sstevel@tonic-gate /*
6807c478bd9Sstevel@tonic-gate  * Master template for CKO_PRIVATE_KEY + CKK_X9_42_DH
6817c478bd9Sstevel@tonic-gate  *
6827c478bd9Sstevel@tonic-gate  */
6837c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_PRIVKEY_X942DH[] =
6847c478bd9Sstevel@tonic-gate {
6857c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
6867c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6877c478bd9Sstevel@tonic-gate 		unused, CKO_PRIVATE_KEY, { unused } },
6887c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
6897c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6907c478bd9Sstevel@tonic-gate 		unused, CKK_X9_42_DH, { unused } },
6917c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
6927c478bd9Sstevel@tonic-gate 	COMMON_KEY_ATTRIBUTES,
6937c478bd9Sstevel@tonic-gate 	COMMON_PRIVKEY_ATTRIBUTES,
6947c478bd9Sstevel@tonic-gate 	{ { CKA_PRIME, NULL, 0 },
6957c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6967c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
6977c478bd9Sstevel@tonic-gate 	{ { CKA_SUBPRIME, NULL, 0 },
6987c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
6997c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
7007c478bd9Sstevel@tonic-gate 	{ { CKA_BASE, NULL, 0 },
7017c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
7027c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
7037c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE, NULL, 0 },
7047c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
7057c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } }
7067c478bd9Sstevel@tonic-gate };
7077c478bd9Sstevel@tonic-gate 
7087c478bd9Sstevel@tonic-gate 
7097c478bd9Sstevel@tonic-gate /*
7107c478bd9Sstevel@tonic-gate  * Master template for CKO_PRIVATE_KEY + CKK_KEA
7117c478bd9Sstevel@tonic-gate  *
7127c478bd9Sstevel@tonic-gate  */
7137c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_PRIVKEY_KEA[] =
7147c478bd9Sstevel@tonic-gate {
7157c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
7167c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
7177c478bd9Sstevel@tonic-gate 		unused, CKO_PRIVATE_KEY, { unused } },
7187c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
7197c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
7207c478bd9Sstevel@tonic-gate 		unused, CKK_KEA, { unused } },
7217c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
7227c478bd9Sstevel@tonic-gate 	COMMON_KEY_ATTRIBUTES,
7237c478bd9Sstevel@tonic-gate 	COMMON_PRIVKEY_ATTRIBUTES,
7247c478bd9Sstevel@tonic-gate 	{ { CKA_PRIME, NULL, 0 },
7257c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
7267c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
7277c478bd9Sstevel@tonic-gate 	{ { CKA_BASE, NULL, 0 },
7287c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
7297c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
7307c478bd9Sstevel@tonic-gate 	{ { CKA_SUBPRIME, NULL, 0 },
7317c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
7327c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
7337c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE, NULL, 0 },
7347c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
7357c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } }
7367c478bd9Sstevel@tonic-gate };
7377c478bd9Sstevel@tonic-gate 
7387c478bd9Sstevel@tonic-gate 
7397c478bd9Sstevel@tonic-gate /* ========================= Secret Keys ========================= */
7407c478bd9Sstevel@tonic-gate 
7417c478bd9Sstevel@tonic-gate 
7427c478bd9Sstevel@tonic-gate /*
7437c478bd9Sstevel@tonic-gate  * Master template for CKO_SECRET_KEY + (fixed-length keytype)
7447c478bd9Sstevel@tonic-gate  */
7457c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_SECKEY[] =
7467c478bd9Sstevel@tonic-gate {
7477c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
7487c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
7497c478bd9Sstevel@tonic-gate 		unused, CKO_SECRET_KEY, { unused } },
7507c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
7517c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
7527c478bd9Sstevel@tonic-gate 		unused, CKK_GENERIC_SECRET, { unused } },
7537c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
7547c478bd9Sstevel@tonic-gate 	COMMON_KEY_ATTRIBUTES,
7557c478bd9Sstevel@tonic-gate 	COMMON_SECKEY_ATTRIBUTES,
7567c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE, NULL, 0 },
7577c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
7587c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } }
7597c478bd9Sstevel@tonic-gate };
7607c478bd9Sstevel@tonic-gate 
7617c478bd9Sstevel@tonic-gate 
7627c478bd9Sstevel@tonic-gate /*
7637c478bd9Sstevel@tonic-gate  * Master template for CKO_SECRET_KEY + (variable-length keytype)
7647c478bd9Sstevel@tonic-gate  *
7657c478bd9Sstevel@tonic-gate  */
7667c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_SECKEY_WITHLEN[] =
7677c478bd9Sstevel@tonic-gate {
7687c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
7697c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
7707c478bd9Sstevel@tonic-gate 		unused, CKO_SECRET_KEY, { unused } },
7717c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
7727c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
7737c478bd9Sstevel@tonic-gate 		unused, CKK_GENERIC_SECRET, { unused } },
7747c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
7757c478bd9Sstevel@tonic-gate 	COMMON_KEY_ATTRIBUTES,
7767c478bd9Sstevel@tonic-gate 	COMMON_SECKEY_ATTRIBUTES,
7777c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE, NULL, 0 },
7787c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
7797c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
7807c478bd9Sstevel@tonic-gate 	{ { CKA_VALUE_LEN, NULL, sizeof (CK_ULONG) },
7817c478bd9Sstevel@tonic-gate 		NotMallocd, NotClone, NotEmptyValue, B_FALSE,
7827c478bd9Sstevel@tonic-gate 		unused, 0, { unused } }
7837c478bd9Sstevel@tonic-gate };
7847c478bd9Sstevel@tonic-gate 
7857c478bd9Sstevel@tonic-gate 
7867c478bd9Sstevel@tonic-gate /* ========================= Domain Parameters ========================= */
7877c478bd9Sstevel@tonic-gate 
7887c478bd9Sstevel@tonic-gate 
7897c478bd9Sstevel@tonic-gate /*
7907c478bd9Sstevel@tonic-gate  * Master template for CKO_DOMAIN_PARAMETERS + CKK_DSA
7917c478bd9Sstevel@tonic-gate  *
7927c478bd9Sstevel@tonic-gate  */
7937c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_DOM_DSA[] =
7947c478bd9Sstevel@tonic-gate {
7957c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
7967c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
7977c478bd9Sstevel@tonic-gate 		unused, CKO_DOMAIN_PARAMETERS, { unused } },
7987c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
7997c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
8007c478bd9Sstevel@tonic-gate 		unused, CKK_DSA, { unused } },
8017c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
8027c478bd9Sstevel@tonic-gate 	COMMON_DOMAIN_ATTRIBUTES,
8037c478bd9Sstevel@tonic-gate 	{ { CKA_PRIME, NULL, 0 },
8047c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
8057c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
8067c478bd9Sstevel@tonic-gate 	{ { CKA_SUBPRIME, NULL, 0 },
8077c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
8087c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
8097c478bd9Sstevel@tonic-gate 	{ { CKA_BASE, NULL, 0 },
8107c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
8117c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
8127c478bd9Sstevel@tonic-gate 	{ { CKA_PRIME_BITS, NULL, sizeof (CK_ULONG) },
8137c478bd9Sstevel@tonic-gate 		NotMallocd, NotClone, NotEmptyValue, B_FALSE,
8147c478bd9Sstevel@tonic-gate 		unused, 0, { unused } }
8157c478bd9Sstevel@tonic-gate };
8167c478bd9Sstevel@tonic-gate 
8177c478bd9Sstevel@tonic-gate /*
8187c478bd9Sstevel@tonic-gate  * Master template for CKO_DOMAIN_PARAMETERS + CKK_DH
8197c478bd9Sstevel@tonic-gate  *
8207c478bd9Sstevel@tonic-gate  */
8217c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_DOM_DH[] =
8227c478bd9Sstevel@tonic-gate {
8237c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
8247c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
8257c478bd9Sstevel@tonic-gate 		unused, CKO_DOMAIN_PARAMETERS, { unused } },
8267c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
8277c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
8287c478bd9Sstevel@tonic-gate 		unused, CKK_DH, { unused } },
8297c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
8307c478bd9Sstevel@tonic-gate 	COMMON_DOMAIN_ATTRIBUTES,
8317c478bd9Sstevel@tonic-gate 	{ { CKA_PRIME, NULL, 0 },
8327c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
8337c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
8347c478bd9Sstevel@tonic-gate 	{ { CKA_BASE, NULL, 0 },
8357c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
8367c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
8377c478bd9Sstevel@tonic-gate 	{ { CKA_PRIME_BITS, NULL, sizeof (CK_ULONG) },
8387c478bd9Sstevel@tonic-gate 		NotMallocd, NotClone, NotEmptyValue, B_FALSE,
8397c478bd9Sstevel@tonic-gate 		unused, 0, { unused } }
8407c478bd9Sstevel@tonic-gate };
8417c478bd9Sstevel@tonic-gate 
8427c478bd9Sstevel@tonic-gate /*
8437c478bd9Sstevel@tonic-gate  * Master template for CKO_DOMAIN_PARAMETERS + CKK_X9_42_DH
8447c478bd9Sstevel@tonic-gate  *
8457c478bd9Sstevel@tonic-gate  */
8467c478bd9Sstevel@tonic-gate static const generic_attr_t OBJ_DOM_X942DH[] =
8477c478bd9Sstevel@tonic-gate {
8487c478bd9Sstevel@tonic-gate 	{ { CKA_CLASS, NULL, sizeof (CK_OBJECT_CLASS) },
8497c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
8507c478bd9Sstevel@tonic-gate 		unused, CKO_DOMAIN_PARAMETERS, { unused } },
8517c478bd9Sstevel@tonic-gate 	{ { CKA_KEY_TYPE, NULL, sizeof (CK_KEY_TYPE) },
8527c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
8537c478bd9Sstevel@tonic-gate 		unused, CKK_X9_42_DH, { unused } },
8547c478bd9Sstevel@tonic-gate 	COMMON_STORAGE_ATTRIBUTES,
8557c478bd9Sstevel@tonic-gate 	COMMON_DOMAIN_ATTRIBUTES,
8567c478bd9Sstevel@tonic-gate 	{ { CKA_PRIME, NULL, 0 },
8577c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
8587c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
8597c478bd9Sstevel@tonic-gate 	{ { CKA_BASE, NULL, 0 },
8607c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
8617c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
8627c478bd9Sstevel@tonic-gate 	{ { CKA_SUBPRIME, NULL, 0 },
8637c478bd9Sstevel@tonic-gate 		NotMallocd, Clone, NotEmptyValue, B_FALSE,
8647c478bd9Sstevel@tonic-gate 		unused, unused, { EMPTY } },
8657c478bd9Sstevel@tonic-gate 	{ { CKA_PRIME_BITS, NULL, sizeof (CK_ULONG) },
8667c478bd9Sstevel@tonic-gate 		NotMallocd, NotClone, NotEmptyValue, B_FALSE,
8677c478bd9Sstevel@tonic-gate 		unused, 0, { unused } },
8687c478bd9Sstevel@tonic-gate 	{ { CKA_SUBPRIME_BITS, NULL, sizeof (CK_ULONG) },
8697c478bd9Sstevel@tonic-gate 		NotMallocd, NotClone, NotEmptyValue, B_FALSE,
8707c478bd9Sstevel@tonic-gate 		unused, 0, { unused } }
8717c478bd9Sstevel@tonic-gate };
8727c478bd9Sstevel@tonic-gate 
8737c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
8747c478bd9Sstevel@tonic-gate }
8757c478bd9Sstevel@tonic-gate #endif
8767c478bd9Sstevel@tonic-gate 
8777c478bd9Sstevel@tonic-gate #endif /* _META_ATTRMASTERS_H */
878