1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5#ifndef _PKCS11N_H_
6#define _PKCS11N_H_
7
8/*
9 * pkcs11n.h
10 *
11 * This file contains the NSS-specific type definitions for Cryptoki
12 * (PKCS#11).
13 */
14
15/*
16 * NSSCK_VENDOR_NSS
17 *
18 * Cryptoki reserves the high half of all the number spaces for
19 * vendor-defined use. I'd like to keep all of our NSS-
20 * specific values together, but not in the oh-so-obvious
21 * 0x80000001, 0x80000002, etc. area. So I've picked an offset,
22 * and constructed values for the beginnings of our spaces.
23 *
24 * Note that some "historical" Netscape values don't fall within
25 * this range.
26 */
27#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
28
29/*
30 * NSS-defined object classes
31 *
32 */
33#define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
34
35#define CKO_NSS_CRL (CKO_NSS + 1)
36#define CKO_NSS_SMIME (CKO_NSS + 2)
37#define CKO_NSS_TRUST (CKO_NSS + 3)
38#define CKO_NSS_BUILTIN_ROOT_LIST (CKO_NSS + 4)
39#define CKO_NSS_NEWSLOT (CKO_NSS + 5)
40#define CKO_NSS_DELSLOT (CKO_NSS + 6)
41
42/*
43 * NSS-defined key types
44 *
45 */
46#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
47
48#define CKK_NSS_PKCS8 (CKK_NSS + 1)
49
50#define CKK_NSS_JPAKE_ROUND1 (CKK_NSS + 2)
51#define CKK_NSS_JPAKE_ROUND2 (CKK_NSS + 3)
52
53#define CKK_NSS_CHACHA20 (CKK_NSS + 4)
54
55/*
56 * NSS-defined certificate types
57 *
58 */
59#define CKC_NSS (CKC_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
60
61/* FAKE PKCS #11 defines */
62#define CKA_DIGEST 0x81000000L
63#define CKA_FLAGS_ONLY 0 /* CKA_CLASS */
64
65/*
66 * NSS-defined object attributes
67 *
68 */
69#define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
70
71#define CKA_NSS_URL (CKA_NSS + 1)
72#define CKA_NSS_EMAIL (CKA_NSS + 2)
73#define CKA_NSS_SMIME_INFO (CKA_NSS + 3)
74#define CKA_NSS_SMIME_TIMESTAMP (CKA_NSS + 4)
75#define CKA_NSS_PKCS8_SALT (CKA_NSS + 5)
76#define CKA_NSS_PASSWORD_CHECK (CKA_NSS + 6)
77#define CKA_NSS_EXPIRES (CKA_NSS + 7)
78#define CKA_NSS_KRL (CKA_NSS + 8)
79
80#define CKA_NSS_PQG_COUNTER (CKA_NSS + 20)
81#define CKA_NSS_PQG_SEED (CKA_NSS + 21)
82#define CKA_NSS_PQG_H (CKA_NSS + 22)
83#define CKA_NSS_PQG_SEED_BITS (CKA_NSS + 23)
84#define CKA_NSS_MODULE_SPEC (CKA_NSS + 24)
85#define CKA_NSS_OVERRIDE_EXTENSIONS (CKA_NSS + 25)
86
87#define CKA_NSS_JPAKE_SIGNERID (CKA_NSS + 26)
88#define CKA_NSS_JPAKE_PEERID (CKA_NSS + 27)
89#define CKA_NSS_JPAKE_GX1 (CKA_NSS + 28)
90#define CKA_NSS_JPAKE_GX2 (CKA_NSS + 29)
91#define CKA_NSS_JPAKE_GX3 (CKA_NSS + 30)
92#define CKA_NSS_JPAKE_GX4 (CKA_NSS + 31)
93#define CKA_NSS_JPAKE_X2 (CKA_NSS + 32)
94#define CKA_NSS_JPAKE_X2S (CKA_NSS + 33)
95
96#define CKA_NSS_MOZILLA_CA_POLICY (CKA_NSS + 34)
97
98/*
99 * Trust attributes:
100 *
101 * If trust goes standard, these probably will too. So I'll
102 * put them all in one place.
103 */
104
105#define CKA_TRUST (CKA_NSS + 0x2000)
106
107/* "Usage" key information */
108#define CKA_TRUST_DIGITAL_SIGNATURE (CKA_TRUST + 1)
109#define CKA_TRUST_NON_REPUDIATION (CKA_TRUST + 2)
110#define CKA_TRUST_KEY_ENCIPHERMENT (CKA_TRUST + 3)
111#define CKA_TRUST_DATA_ENCIPHERMENT (CKA_TRUST + 4)
112#define CKA_TRUST_KEY_AGREEMENT (CKA_TRUST + 5)
113#define CKA_TRUST_KEY_CERT_SIGN (CKA_TRUST + 6)
114#define CKA_TRUST_CRL_SIGN (CKA_TRUST + 7)
115
116/* "Purpose" trust information */
117#define CKA_TRUST_SERVER_AUTH (CKA_TRUST + 8)
118#define CKA_TRUST_CLIENT_AUTH (CKA_TRUST + 9)
119#define CKA_TRUST_CODE_SIGNING (CKA_TRUST + 10)
120#define CKA_TRUST_EMAIL_PROTECTION (CKA_TRUST + 11)
121#define CKA_TRUST_IPSEC_END_SYSTEM (CKA_TRUST + 12)
122#define CKA_TRUST_IPSEC_TUNNEL (CKA_TRUST + 13)
123#define CKA_TRUST_IPSEC_USER (CKA_TRUST + 14)
124#define CKA_TRUST_TIME_STAMPING (CKA_TRUST + 15)
125#define CKA_TRUST_STEP_UP_APPROVED (CKA_TRUST + 16)
126
127#define CKA_CERT_SHA1_HASH (CKA_TRUST + 100)
128#define CKA_CERT_MD5_HASH (CKA_TRUST + 101)
129
130/* NSS trust stuff */
131
132/* HISTORICAL: define used to pass in the database key for DSA private keys */
133#define CKA_NETSCAPE_DB 0xD5A0DB00L
134#define CKA_NETSCAPE_TRUST 0x80000001L
135
136/* FAKE PKCS #11 defines */
137#define CKM_FAKE_RANDOM 0x80000efeUL
138#define CKM_INVALID_MECHANISM 0xffffffffUL
139
140/*
141 * NSS-defined crypto mechanisms
142 *
143 */
144#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
145
146#define CKM_NSS_AES_KEY_WRAP (CKM_NSS + 1)
147#define CKM_NSS_AES_KEY_WRAP_PAD (CKM_NSS + 2)
148
149/* HKDF key derivation mechanisms. See CK_NSS_HKDFParams for documentation. */
150#define CKM_NSS_HKDF_SHA1 (CKM_NSS + 3)
151#define CKM_NSS_HKDF_SHA256 (CKM_NSS + 4)
152#define CKM_NSS_HKDF_SHA384 (CKM_NSS + 5)
153#define CKM_NSS_HKDF_SHA512 (CKM_NSS + 6)
154
155/* J-PAKE round 1 key generation mechanisms.
156 *
157 * Required template attributes: CKA_PRIME, CKA_SUBPRIME, CKA_BASE,
158 * CKA_NSS_JPAKE_SIGNERID
159 * Output key type: CKK_NSS_JPAKE_ROUND1
160 * Output key class: CKO_PRIVATE_KEY
161 * Parameter type: CK_NSS_JPAKERound1Params
162 *
163 */
164#define CKM_NSS_JPAKE_ROUND1_SHA1 (CKM_NSS + 7)
165#define CKM_NSS_JPAKE_ROUND1_SHA256 (CKM_NSS + 8)
166#define CKM_NSS_JPAKE_ROUND1_SHA384 (CKM_NSS + 9)
167#define CKM_NSS_JPAKE_ROUND1_SHA512 (CKM_NSS + 10)
168
169/* J-PAKE round 2 key derivation mechanisms.
170 *
171 * Required template attributes: CKA_NSS_JPAKE_PEERID
172 * Input key type: CKK_NSS_JPAKE_ROUND1
173 * Output key type: CKK_NSS_JPAKE_ROUND2
174 * Output key class: CKO_PRIVATE_KEY
175 * Parameter type: CK_NSS_JPAKERound2Params
176 */
177#define CKM_NSS_JPAKE_ROUND2_SHA1 (CKM_NSS + 11)
178#define CKM_NSS_JPAKE_ROUND2_SHA256 (CKM_NSS + 12)
179#define CKM_NSS_JPAKE_ROUND2_SHA384 (CKM_NSS + 13)
180#define CKM_NSS_JPAKE_ROUND2_SHA512 (CKM_NSS + 14)
181
182/* J-PAKE final key material derivation mechanisms
183 *
184 * Input key type: CKK_NSS_JPAKE_ROUND2
185 * Output key type: CKK_GENERIC_SECRET
186 * Output key class: CKO_SECRET_KEY
187 * Parameter type: CK_NSS_JPAKEFinalParams
188 *
189 * You must apply a KDF (e.g. CKM_NSS_HKDF_*) to resultant keying material
190 * to get a key with uniformly distributed bits.
191 */
192#define CKM_NSS_JPAKE_FINAL_SHA1 (CKM_NSS + 15)
193#define CKM_NSS_JPAKE_FINAL_SHA256 (CKM_NSS + 16)
194#define CKM_NSS_JPAKE_FINAL_SHA384 (CKM_NSS + 17)
195#define CKM_NSS_JPAKE_FINAL_SHA512 (CKM_NSS + 18)
196
197/* Constant-time MAC mechanisms:
198 *
199 * These operations verify a padded, MAC-then-encrypt block of data in
200 * constant-time. Because of the order of operations, the padding bytes are not
201 * protected by the MAC. However, disclosing the value of the padding bytes
202 * gives an attacker the ability to decrypt ciphertexts. Such disclosure can be
203 * as subtle as taking slightly less time to perform the MAC when the padding
204 * is one byte longer. See https://www.isg.rhul.ac.uk/tls/
205 *
206 * CKM_NSS_HMAC_CONSTANT_TIME: performs an HMAC authentication.
207 * CKM_NSS_SSL3_MAC_CONSTANT_TIME: performs an authentication with SSLv3 MAC.
208 *
209 * Parameter type: CK_NSS_MAC_CONSTANT_TIME_PARAMS
210 */
211#define CKM_NSS_HMAC_CONSTANT_TIME (CKM_NSS + 19)
212#define CKM_NSS_SSL3_MAC_CONSTANT_TIME (CKM_NSS + 20)
213
214/* TLS 1.2 mechanisms */
215#define CKM_NSS_TLS_PRF_GENERAL_SHA256 (CKM_NSS + 21)
216#define CKM_NSS_TLS_MASTER_KEY_DERIVE_SHA256 (CKM_NSS + 22)
217#define CKM_NSS_TLS_KEY_AND_MAC_DERIVE_SHA256 (CKM_NSS + 23)
218#define CKM_NSS_TLS_MASTER_KEY_DERIVE_DH_SHA256 (CKM_NSS + 24)
219
220/* TLS extended master secret derivation */
221#define CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE (CKM_NSS + 25)
222#define CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_DH (CKM_NSS + 26)
223
224#define CKM_NSS_CHACHA20_KEY_GEN (CKM_NSS + 27)
225#define CKM_NSS_CHACHA20_POLY1305 (CKM_NSS + 28)
226
227/* Additional PKCS #12 PBE algorithms defined in v1.1 */
228#define CKM_NSS_PKCS12_PBE_SHA224_HMAC_KEY_GEN (CKM_NSS + 29)
229#define CKM_NSS_PKCS12_PBE_SHA256_HMAC_KEY_GEN (CKM_NSS + 30)
230#define CKM_NSS_PKCS12_PBE_SHA384_HMAC_KEY_GEN (CKM_NSS + 31)
231#define CKM_NSS_PKCS12_PBE_SHA512_HMAC_KEY_GEN (CKM_NSS + 32)
232
233/*
234 * HISTORICAL:
235 * Do not attempt to use these. They are only used by NETSCAPE's internal
236 * PKCS #11 interface. Most of these are place holders for other mechanism
237 * and will change in the future.
238 */
239#define CKM_NETSCAPE_PBE_SHA1_DES_CBC 0x80000002UL
240#define CKM_NETSCAPE_PBE_SHA1_TRIPLE_DES_CBC 0x80000003UL
241#define CKM_NETSCAPE_PBE_SHA1_40_BIT_RC2_CBC 0x80000004UL
242#define CKM_NETSCAPE_PBE_SHA1_128_BIT_RC2_CBC 0x80000005UL
243#define CKM_NETSCAPE_PBE_SHA1_40_BIT_RC4 0x80000006UL
244#define CKM_NETSCAPE_PBE_SHA1_128_BIT_RC4 0x80000007UL
245#define CKM_NETSCAPE_PBE_SHA1_FAULTY_3DES_CBC 0x80000008UL
246#define CKM_NETSCAPE_PBE_SHA1_HMAC_KEY_GEN 0x80000009UL
247#define CKM_NETSCAPE_PBE_MD5_HMAC_KEY_GEN 0x8000000aUL
248#define CKM_NETSCAPE_PBE_MD2_HMAC_KEY_GEN 0x8000000bUL
249
250#define CKM_TLS_PRF_GENERAL 0x80000373UL
251
252typedef struct CK_NSS_JPAKEPublicValue {
253 CK_BYTE *pGX;
254 CK_ULONG ulGXLen;
255 CK_BYTE *pGV;
256 CK_ULONG ulGVLen;
257 CK_BYTE *pR;
258 CK_ULONG ulRLen;
259} CK_NSS_JPAKEPublicValue;
260
261typedef struct CK_NSS_JPAKERound1Params {
262 CK_NSS_JPAKEPublicValue gx1; /* out */
263 CK_NSS_JPAKEPublicValue gx2; /* out */
264} CK_NSS_JPAKERound1Params;
265
266typedef struct CK_NSS_JPAKERound2Params {
267 CK_BYTE *pSharedKey; /* in */
268 CK_ULONG ulSharedKeyLen; /* in */
269 CK_NSS_JPAKEPublicValue gx3; /* in */
270 CK_NSS_JPAKEPublicValue gx4; /* in */
271 CK_NSS_JPAKEPublicValue A; /* out */
272} CK_NSS_JPAKERound2Params;
273
274typedef struct CK_NSS_JPAKEFinalParams {
275 CK_NSS_JPAKEPublicValue B; /* in */
276} CK_NSS_JPAKEFinalParams;
277
278/* macAlg: the MAC algorithm to use. This determines the hash function used in
279 * the HMAC/SSLv3 MAC calculations.
280 * ulBodyTotalLen: the total length of the data, including padding bytes and
281 * padding length.
282 * pHeader: points to a block of data that contains additional data to
283 * authenticate. For TLS this includes the sequence number etc. For SSLv3,
284 * this also includes the initial padding bytes.
285 *
286 * NOTE: the softoken's implementation of CKM_NSS_HMAC_CONSTANT_TIME and
287 * CKM_NSS_SSL3_MAC_CONSTANT_TIME requires that the sum of ulBodyTotalLen
288 * and ulHeaderLen be much smaller than 2^32 / 8 bytes because it uses an
289 * unsigned int variable to represent the length in bits. This should not
290 * be a problem because the SSL/TLS protocol limits the size of an SSL
291 * record to something considerably less than 2^32 bytes.
292 */
293typedef struct CK_NSS_MAC_CONSTANT_TIME_PARAMS {
294 CK_MECHANISM_TYPE macAlg; /* in */
295 CK_ULONG ulBodyTotalLen; /* in */
296 CK_BYTE *pHeader; /* in */
297 CK_ULONG ulHeaderLen; /* in */
298} CK_NSS_MAC_CONSTANT_TIME_PARAMS;
299
300typedef struct CK_NSS_AEAD_PARAMS {
301 CK_BYTE_PTR pNonce;
302 CK_ULONG ulNonceLen;
303 CK_BYTE_PTR pAAD;
304 CK_ULONG ulAADLen;
305 CK_ULONG ulTagLen;
306} CK_NSS_AEAD_PARAMS;
307
308/*
309 * NSS-defined return values
310 *
311 */
312#define CKR_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
313
314#define CKR_NSS_CERTDB_FAILED (CKR_NSS + 1)
315#define CKR_NSS_KEYDB_FAILED (CKR_NSS + 2)
316
317/* Mandatory parameter for the CKM_NSS_HKDF_* key deriviation mechanisms.
318 See RFC 5869.
319
320 bExtract: If set, HKDF-Extract will be applied to the input key. If
321 the optional salt is given, it is used; otherwise, the salt is
322 set to a sequence of zeros equal in length to the HMAC output.
323 If bExpand is not set, then the key template given to
324 C_DeriveKey must indicate an output key size less than or equal
325 to the output size of the HMAC.
326
327 bExpand: If set, HKDF-Expand will be applied to the input key (if
328 bExtract is not set) or to the result of HKDF-Extract (if
329 bExtract is set). Any info given in the optional pInfo field will
330 be included in the calculation.
331
332 The size of the output key must be specified in the template passed to
333 C_DeriveKey.
334*/
335typedef struct CK_NSS_HKDFParams {
336 CK_BBOOL bExtract;
337 CK_BYTE_PTR pSalt;
338 CK_ULONG ulSaltLen;
339 CK_BBOOL bExpand;
340 CK_BYTE_PTR pInfo;
341 CK_ULONG ulInfoLen;
342} CK_NSS_HKDFParams;
343
344/*
345 * Parameter for the TLS extended master secret key derivation mechanisms:
346 *
347 * * CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE
348 * * CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_DH
349 *
350 * For the TLS 1.2 PRF, the prfHashMechanism parameter determines the hash
351 * function used. For earlier versions of the PRF, set the prfHashMechanism
352 * value to CKM_TLS_PRF.
353 *
354 * The session hash input is expected to be the output of the same hash
355 * function as the PRF uses (as required by draft-ietf-tls-session-hash). So
356 * the ulSessionHashLen member must be equal the output length of the hash
357 * function specified by the prfHashMechanism member (or, for pre-TLS 1.2 PRF,
358 * the length of concatenated MD5 and SHA-1 digests).
359 *
360 */
361typedef struct CK_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_PARAMS {
362 CK_MECHANISM_TYPE prfHashMechanism;
363 CK_BYTE_PTR pSessionHash;
364 CK_ULONG ulSessionHashLen;
365 CK_VERSION_PTR pVersion;
366} CK_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_PARAMS;
367
368/*
369 * Trust info
370 *
371 * This isn't part of the Cryptoki standard (yet), so I'm putting
372 * all the definitions here. Some of this would move to nssckt.h
373 * if trust info were made part of the standard. In view of this
374 * possibility, I'm putting my (NSS) values in the NSS
375 * vendor space, like everything else.
376 */
377
378typedef CK_ULONG CK_TRUST;
379
380/* The following trust types are defined: */
381#define CKT_VENDOR_DEFINED 0x80000000
382
383#define CKT_NSS (CKT_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
384
385/* If trust goes standard, these'll probably drop out of vendor space. */
386#define CKT_NSS_TRUSTED (CKT_NSS + 1)
387#define CKT_NSS_TRUSTED_DELEGATOR (CKT_NSS + 2)
388#define CKT_NSS_MUST_VERIFY_TRUST (CKT_NSS + 3)
389#define CKT_NSS_NOT_TRUSTED (CKT_NSS + 10)
390#define CKT_NSS_TRUST_UNKNOWN (CKT_NSS + 5) /* default */
391
392/*
393 * These may well remain NSS-specific; I'm only using them
394 * to cache resolution data.
395 */
396#define CKT_NSS_VALID_DELEGATOR (CKT_NSS + 11)
397
398/*
399 * old definitions. They still exist, but the plain meaning of the
400 * labels have never been accurate to what was really implemented.
401 * The new labels correctly reflect what the values effectively mean.
402 */
403#if defined(__GNUC__) && (__GNUC__ > 3)
404/* make GCC warn when we use these #defines */
405/*
406 * This is really painful because GCC doesn't allow us to mark random
407 * #defines as deprecated. We can only mark the following:
408 * functions, variables, and types.
409 * const variables will create extra storage for everyone including this
410 * header file, so it's undesirable.
411 * functions could be inlined to prevent storage creation, but will fail
412 * when constant values are expected (like switch statements).
413 * enum types do not seem to pay attention to the deprecated attribute.
414 *
415 * That leaves typedefs. We declare new types that we then deprecate, then
416 * cast the resulting value to the deprecated type in the #define, thus
417 * producting the warning when the #define is used.
418 */
419#if (__GNUC__ == 4) && (__GNUC_MINOR__ < 5)
420/* The mac doesn't like the friendlier deprecate messages. I'm assuming this
421 * is a gcc version issue rather than mac or ppc specific */
422typedef CK_TRUST __CKT_NSS_UNTRUSTED __attribute__((deprecated));
423typedef CK_TRUST __CKT_NSS_VALID __attribute__((deprecated));
424typedef CK_TRUST __CKT_NSS_MUST_VERIFY __attribute__((deprecated));
425#else
426/* when possible, get a full deprecation warning. This works on gcc 4.5
427 * it may work on earlier versions of gcc */
428typedef CK_TRUST __CKT_NSS_UNTRUSTED __attribute__((deprecated("CKT_NSS_UNTRUSTED really means CKT_NSS_MUST_VERIFY_TRUST")));
429typedef CK_TRUST __CKT_NSS_VALID __attribute__((deprecated("CKT_NSS_VALID really means CKT_NSS_NOT_TRUSTED")));
430typedef CK_TRUST __CKT_NSS_MUST_VERIFY __attribute__((deprecated("CKT_NSS_MUST_VERIFY really functions as CKT_NSS_TRUST_UNKNOWN")));
431#endif
432#define CKT_NSS_UNTRUSTED ((__CKT_NSS_UNTRUSTED)CKT_NSS_MUST_VERIFY_TRUST)
433#define CKT_NSS_VALID ((__CKT_NSS_VALID)CKT_NSS_NOT_TRUSTED)
434/* keep the old value for compatibility reasons*/
435#define CKT_NSS_MUST_VERIFY ((__CKT_NSS_MUST_VERIFY)(CKT_NSS + 4))
436#else
437#ifdef _WIN32
438/* This magic gets the windows compiler to give us a deprecation
439 * warning */
440#pragma deprecated(CKT_NSS_UNTRUSTED, CKT_NSS_MUST_VERIFY, CKT_NSS_VALID)
441#endif
442/* CKT_NSS_UNTRUSTED really means CKT_NSS_MUST_VERIFY_TRUST */
443#define CKT_NSS_UNTRUSTED CKT_NSS_MUST_VERIFY_TRUST
444/* CKT_NSS_VALID really means CKT_NSS_NOT_TRUSTED */
445#define CKT_NSS_VALID CKT_NSS_NOT_TRUSTED
446/* CKT_NSS_MUST_VERIFY was always treated as CKT_NSS_TRUST_UNKNOWN */
447#define CKT_NSS_MUST_VERIFY (CKT_NSS + 4) /*really means trust unknown*/
448#endif
449
450/* don't leave old programs in a lurch just yet, give them the old NETSCAPE
451 * synonym */
452#define CKO_NETSCAPE_CRL CKO_NSS_CRL
453#define CKO_NETSCAPE_SMIME CKO_NSS_SMIME
454#define CKO_NETSCAPE_TRUST CKO_NSS_TRUST
455#define CKO_NETSCAPE_BUILTIN_ROOT_LIST CKO_NSS_BUILTIN_ROOT_LIST
456#define CKO_NETSCAPE_NEWSLOT CKO_NSS_NEWSLOT
457#define CKO_NETSCAPE_DELSLOT CKO_NSS_DELSLOT
458#define CKK_NETSCAPE_PKCS8 CKK_NSS_PKCS8
459#define CKA_NETSCAPE_URL CKA_NSS_URL
460#define CKA_NETSCAPE_EMAIL CKA_NSS_EMAIL
461#define CKA_NETSCAPE_SMIME_INFO CKA_NSS_SMIME_INFO
462#define CKA_NETSCAPE_SMIME_TIMESTAMP CKA_NSS_SMIME_TIMESTAMP
463#define CKA_NETSCAPE_PKCS8_SALT CKA_NSS_PKCS8_SALT
464#define CKA_NETSCAPE_PASSWORD_CHECK CKA_NSS_PASSWORD_CHECK
465#define CKA_NETSCAPE_EXPIRES CKA_NSS_EXPIRES
466#define CKA_NETSCAPE_KRL CKA_NSS_KRL
467#define CKA_NETSCAPE_PQG_COUNTER CKA_NSS_PQG_COUNTER
468#define CKA_NETSCAPE_PQG_SEED CKA_NSS_PQG_SEED
469#define CKA_NETSCAPE_PQG_H CKA_NSS_PQG_H
470#define CKA_NETSCAPE_PQG_SEED_BITS CKA_NSS_PQG_SEED_BITS
471#define CKA_NETSCAPE_MODULE_SPEC CKA_NSS_MODULE_SPEC
472#define CKM_NETSCAPE_AES_KEY_WRAP CKM_NSS_AES_KEY_WRAP
473#define CKM_NETSCAPE_AES_KEY_WRAP_PAD CKM_NSS_AES_KEY_WRAP_PAD
474#define CKR_NETSCAPE_CERTDB_FAILED CKR_NSS_CERTDB_FAILED
475#define CKR_NETSCAPE_KEYDB_FAILED CKR_NSS_KEYDB_FAILED
476
477#define CKT_NETSCAPE_TRUSTED CKT_NSS_TRUSTED
478#define CKT_NETSCAPE_TRUSTED_DELEGATOR CKT_NSS_TRUSTED_DELEGATOR
479#define CKT_NETSCAPE_UNTRUSTED CKT_NSS_UNTRUSTED
480#define CKT_NETSCAPE_MUST_VERIFY CKT_NSS_MUST_VERIFY
481#define CKT_NETSCAPE_TRUST_UNKNOWN CKT_NSS_TRUST_UNKNOWN
482#define CKT_NETSCAPE_VALID CKT_NSS_VALID
483#define CKT_NETSCAPE_VALID_DELEGATOR CKT_NSS_VALID_DELEGATOR
484
485/*
486 * These are not really PKCS #11 values specifically. They are the 'loadable'
487 * module spec NSS uses. The are available for others to use as well, but not
488 * part of the formal PKCS #11 spec.
489 *
490 * The function 'FIND' returns an array of PKCS #11 initialization strings
491 * The function 'ADD' takes a PKCS #11 initialization string and stores it.
492 * The function 'DEL' takes a 'name= library=' value and deletes the associated
493 * string.
494 * The function 'RELEASE' frees the array returned by 'FIND'
495 */
496#define SECMOD_MODULE_DB_FUNCTION_FIND 0
497#define SECMOD_MODULE_DB_FUNCTION_ADD 1
498#define SECMOD_MODULE_DB_FUNCTION_DEL 2
499#define SECMOD_MODULE_DB_FUNCTION_RELEASE 3
500typedef char **(PR_CALLBACK *SECMODModuleDBFunc)(unsigned long function,
501 char *parameters, void *moduleSpec);
502
503/* softoken slot ID's */
504#define SFTK_MIN_USER_SLOT_ID 4
505#define SFTK_MAX_USER_SLOT_ID 100
506#define SFTK_MIN_FIPS_USER_SLOT_ID 101
507#define SFTK_MAX_FIPS_USER_SLOT_ID 127
508
509#endif /* _PKCS11N_H_ */
510