~ubuntu-branches/ubuntu/lucid/seamonkey/lucid-security

« back to all changes in this revision

Viewing changes to security/nss-fips/lib/pk11wrap/secmodt.h

  • Committer: Bazaar Package Importer
  • Author(s): Fabien Tassin
  • Date: 2008-07-29 21:29:02 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080729212902-spm9kpvchp9udwbw
Tags: 1.1.11+nobinonly-0ubuntu1
* New security upstream release: 1.1.11 (LP: #218534)
  Fixes USN-602-1, USN-619-1, USN-623-1 and USN-629-1
* Refresh diverged patch:
  - update debian/patches/80_security_build.patch
* Fix FTBFS with missing -lfontconfig
  - add debian/patches/11_fix_ftbfs_with_fontconfig.patch
  - update debian/patches/series
* Build with default gcc (hardy: 4.2, intrepid: 4.3)
  - update debian/rules
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ***** BEGIN LICENSE BLOCK *****
 
2
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
3
 *
 
4
 * The contents of this file are subject to the Mozilla Public License Version
 
5
 * 1.1 (the "License"); you may not use this file except in compliance with
 
6
 * the License. You may obtain a copy of the License at
 
7
 * http://www.mozilla.org/MPL/
 
8
 *
 
9
 * Software distributed under the License is distributed on an "AS IS" basis,
 
10
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
11
 * for the specific language governing rights and limitations under the
 
12
 * License.
 
13
 *
 
14
 * The Original Code is the Netscape security libraries.
 
15
 *
 
16
 * The Initial Developer of the Original Code is
 
17
 * Netscape Communications Corporation.
 
18
 * Portions created by the Initial Developer are Copyright (C) 1994-2000
 
19
 * the Initial Developer. All Rights Reserved.
 
20
 *
 
21
 * Contributor(s):
 
22
 *
 
23
 * Alternatively, the contents of this file may be used under the terms of
 
24
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 
25
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
26
 * in which case the provisions of the GPL or the LGPL are applicable instead
 
27
 * of those above. If you wish to allow use of your version of this file only
 
28
 * under the terms of either the GPL or the LGPL, and not to allow others to
 
29
 * use your version of this file under the terms of the MPL, indicate your
 
30
 * decision by deleting the provisions above and replace them with the notice
 
31
 * and other provisions required by the GPL or the LGPL. If you do not delete
 
32
 * the provisions above, a recipient may use your version of this file under
 
33
 * the terms of any one of the MPL, the GPL or the LGPL.
 
34
 *
 
35
 * ***** END LICENSE BLOCK ***** */
 
36
#ifndef _SECMODT_H_
 
37
#define _SECMODT_H_ 1
 
38
 
 
39
#include "nssrwlkt.h"
 
40
#include "nssilckt.h"
 
41
#include "secoid.h"
 
42
#include "secasn1.h"
 
43
#include "pkcs11t.h"
 
44
 
 
45
/* find a better home for these... */
 
46
extern const SEC_ASN1Template SECKEY_PointerToEncryptedPrivateKeyInfoTemplate[];
 
47
extern SEC_ASN1TemplateChooser NSS_Get_SECKEY_PointerToEncryptedPrivateKeyInfoTemplate;
 
48
extern const SEC_ASN1Template SECKEY_EncryptedPrivateKeyInfoTemplate[];
 
49
extern SEC_ASN1TemplateChooser NSS_Get_SECKEY_EncryptedPrivateKeyInfoTemplate;
 
50
extern const SEC_ASN1Template SECKEY_PrivateKeyInfoTemplate[];
 
51
extern SEC_ASN1TemplateChooser NSS_Get_SECKEY_PrivateKeyInfoTemplate;
 
52
extern const SEC_ASN1Template SECKEY_PointerToPrivateKeyInfoTemplate[];
 
53
extern SEC_ASN1TemplateChooser NSS_Get_SECKEY_PointerToPrivateKeyInfoTemplate;
 
54
 
 
55
/* PKCS11 needs to be included */
 
56
typedef struct SECMODModuleStr SECMODModule;
 
57
typedef struct SECMODModuleListStr SECMODModuleList;
 
58
typedef NSSRWLock SECMODListLock;
 
59
typedef struct PK11SlotInfoStr PK11SlotInfo; /* defined in secmodti.h */
 
60
typedef struct PK11PreSlotInfoStr PK11PreSlotInfo; /* defined in secmodti.h */
 
61
typedef struct PK11SymKeyStr PK11SymKey; /* defined in secmodti.h */
 
62
typedef struct PK11ContextStr PK11Context; /* defined in secmodti.h */
 
63
typedef struct PK11SlotListStr PK11SlotList;
 
64
typedef struct PK11SlotListElementStr PK11SlotListElement;
 
65
typedef struct PK11RSAGenParamsStr PK11RSAGenParams;
 
66
typedef unsigned long SECMODModuleID;
 
67
typedef struct PK11DefaultArrayEntryStr PK11DefaultArrayEntry;
 
68
typedef struct PK11GenericObjectStr PK11GenericObject;
 
69
typedef void (*PK11FreeDataFunc)(void *);
 
70
 
 
71
struct SECMODModuleStr {
 
72
    PRArenaPool *arena;
 
73
    PRBool      internal;       /* true of internally linked modules, false
 
74
                                 * for the loaded modules */
 
75
    PRBool      loaded;         /* Set to true if module has been loaded */
 
76
    PRBool      isFIPS;         /* Set to true if module is finst internal */
 
77
    char        *dllName;       /* name of the shared library which implements
 
78
                                 * this module */
 
79
    char        *commonName;    /* name of the module to display to the user */
 
80
    void        *library;       /* pointer to the library. opaque. used only by
 
81
                                 * pk11load.c */
 
82
    void        *functionList; /* The PKCS #11 function table */
 
83
    PZLock      *refLock;       /* only used pk11db.c */
 
84
    int         refCount;       /* Module reference count */
 
85
    PK11SlotInfo **slots;       /* array of slot points attached to this mod*/
 
86
    int         slotCount;      /* count of slot in above array */
 
87
    PK11PreSlotInfo *slotInfo;  /* special info about slots default settings */
 
88
    int         slotInfoCount;  /* count */
 
89
    SECMODModuleID moduleID;    /* ID so we can find this module again */
 
90
    PRBool      isThreadSafe;
 
91
    unsigned long ssl[2];       /* SSL cipher enable flags */
 
92
    char        *libraryParams;  /* Module specific parameters */
 
93
    void *moduleDBFunc; /* function to return module configuration data*/
 
94
    SECMODModule *parent;       /* module that loaded us */
 
95
    PRBool      isCritical;     /* This module must load successfully */
 
96
    PRBool      isModuleDB;     /* this module has lists of PKCS #11 modules */
 
97
    PRBool      moduleDBOnly;   /* this module only has lists of PKCS #11 modules */
 
98
    int         trustOrder;     /* order for this module's certificate trust rollup */
 
99
    int         cipherOrder;    /* order for cipher operations */
 
100
    unsigned long evControlMask; /* control the running and shutdown of slot
 
101
                                  * events (SECMOD_WaitForAnyTokenEvent) */
 
102
    CK_VERSION  cryptokiVersion; /* version of this library */
 
103
};
 
104
 
 
105
/* evControlMask flags */
 
106
/*
 
107
 * These bits tell the current state of a SECMOD_WaitForAnyTokenEvent.
 
108
 *
 
109
 * SECMOD_WAIT_PKCS11_EVENT - we're waiting in the PKCS #11 module in
 
110
 *  C_WaitForSlotEvent().
 
111
 * SECMOD_WAIT_SIMULATED_EVENT - we're waiting in the NSS simulation code
 
112
 *  which polls for token insertion and removal events.
 
113
 * SECMOD_END_WAIT - SECMOD_CancelWait has been called while the module is
 
114
 *  waiting in SECMOD_WaitForAnyTokenEvent. SECMOD_WaitForAnyTokenEvent
 
115
 *  should return immediately to it's caller.
 
116
 */ 
 
117
#define SECMOD_END_WAIT             0x01
 
118
#define SECMOD_WAIT_SIMULATED_EVENT 0x02 
 
119
#define SECMOD_WAIT_PKCS11_EVENT    0x04
 
120
 
 
121
struct SECMODModuleListStr {
 
122
    SECMODModuleList    *next;
 
123
    SECMODModule        *module;
 
124
};
 
125
 
 
126
struct PK11SlotListStr {
 
127
    PK11SlotListElement *head;
 
128
    PK11SlotListElement *tail;
 
129
    PZLock *lock;
 
130
};
 
131
 
 
132
struct PK11SlotListElementStr {
 
133
    PK11SlotListElement *next;
 
134
    PK11SlotListElement *prev;
 
135
    PK11SlotInfo *slot;
 
136
    int refCount;
 
137
};
 
138
 
 
139
struct PK11RSAGenParamsStr {
 
140
    int keySizeInBits;
 
141
    unsigned long pe;
 
142
};
 
143
 
 
144
typedef enum {
 
145
     PK11CertListUnique = 0,     /* get one instance of all certs */
 
146
     PK11CertListUser = 1,       /* get all instances of user certs */
 
147
     PK11CertListRootUnique = 2, /* get one instance of CA certs without a private key.
 
148
                                  * deprecated. Use PK11CertListCAUnique
 
149
                                  */
 
150
     PK11CertListCA = 3,         /* get all instances of CA certs */
 
151
     PK11CertListCAUnique = 4,   /* get one instance of CA certs */
 
152
     PK11CertListUserUnique = 5, /* get one instance of user certs */
 
153
     PK11CertListAll = 6         /* get all instances of all certs */
 
154
} PK11CertListType;
 
155
 
 
156
/*
 
157
 * Entry into the Array which lists all the legal bits for the default flags
 
158
 * in the slot, their definition, and the PKCS #11 mechanism the represent
 
159
 * Always Statically allocated. 
 
160
 */
 
161
struct PK11DefaultArrayEntryStr {
 
162
    char *name;
 
163
    unsigned long flag;
 
164
    unsigned long mechanism; /* this is a long so we don't include the 
 
165
                              * whole pkcs 11 world to use this header */
 
166
};
 
167
 
 
168
 
 
169
#define SECMOD_RSA_FLAG         0x00000001L
 
170
#define SECMOD_DSA_FLAG         0x00000002L
 
171
#define SECMOD_RC2_FLAG         0x00000004L
 
172
#define SECMOD_RC4_FLAG         0x00000008L
 
173
#define SECMOD_DES_FLAG         0x00000010L
 
174
#define SECMOD_DH_FLAG          0x00000020L
 
175
#define SECMOD_FORTEZZA_FLAG    0x00000040L
 
176
#define SECMOD_RC5_FLAG         0x00000080L
 
177
#define SECMOD_SHA1_FLAG        0x00000100L
 
178
#define SECMOD_MD5_FLAG         0x00000200L
 
179
#define SECMOD_MD2_FLAG         0x00000400L
 
180
#define SECMOD_SSL_FLAG         0x00000800L
 
181
#define SECMOD_TLS_FLAG         0x00001000L
 
182
#define SECMOD_AES_FLAG         0x00002000L
 
183
#define SECMOD_SHA256_FLAG      0x00004000L
 
184
#define SECMOD_SHA512_FLAG      0x00008000L     /* also for SHA384 */
 
185
/* reserved bit for future, do not use */
 
186
#define SECMOD_RESERVED_FLAG    0X08000000L
 
187
#define SECMOD_FRIENDLY_FLAG    0x10000000L
 
188
#define SECMOD_RANDOM_FLAG      0x80000000L
 
189
 
 
190
/* need to make SECMOD and PK11 prefixes consistant. */
 
191
#define PK11_OWN_PW_DEFAULTS 0x20000000L
 
192
#define PK11_DISABLE_FLAG    0x40000000L
 
193
 
 
194
/* FAKE PKCS #11 defines */
 
195
#define CKM_FAKE_RANDOM       0x80000efeL
 
196
#define CKM_INVALID_MECHANISM 0xffffffffL
 
197
#define CKA_DIGEST            0x81000000L
 
198
#define CKA_FLAGS_ONLY        0 /* CKA_CLASS */
 
199
 
 
200
/*
 
201
 * PK11AttrFlags
 
202
 *
 
203
 * A 32-bit bitmask of PK11_ATTR_XXX flags
 
204
 */
 
205
typedef PRUint32 PK11AttrFlags;
 
206
 
 
207
/*
 
208
 * PK11_ATTR_XXX
 
209
 *
 
210
 * The following PK11_ATTR_XXX bitflags are used to specify
 
211
 * PKCS #11 object attributes that have Boolean values.  Some NSS
 
212
 * functions have a "PK11AttrFlags attrFlags" parameter whose value
 
213
 * is the logical OR of these bitflags.  NSS use these bitflags on
 
214
 * private keys or secret keys.  Some of these bitflags also apply
 
215
 * to the public keys associated with the private keys.
 
216
 *
 
217
 * For each PKCS #11 object attribute, we need two bitflags to
 
218
 * specify not only "true" and "false" but also "default".  For
 
219
 * example, PK11_ATTR_PRIVATE and PK11_ATTR_PUBLIC control the
 
220
 * CKA_PRIVATE attribute.  If PK11_ATTR_PRIVATE is set, we add
 
221
 *     { CKA_PRIVATE, &cktrue, sizeof(CK_BBOOL) }
 
222
 * to the template.  If PK11_ATTR_PUBLIC is set, we add
 
223
 *     { CKA_PRIVATE, &ckfalse, sizeof(CK_BBOOL) }
 
224
 * to the template.  If neither flag is set, we don't add any
 
225
 * CKA_PRIVATE entry to the template.
 
226
 */
 
227
 
 
228
/*
 
229
 * Attributes for PKCS #11 storage objects, which include not only
 
230
 * keys but also certificates and domain parameters.
 
231
 */
 
232
 
 
233
/*
 
234
 * PK11_ATTR_TOKEN
 
235
 * PK11_ATTR_SESSION
 
236
 *
 
237
 * These two flags determine whether the object is a token or
 
238
 * session object.
 
239
 *
 
240
 * These two flags are related and cannot both be set.
 
241
 * If the PK11_ATTR_TOKEN flag is set, the object is a token
 
242
 * object.  If the PK11_ATTR_SESSION flag is set, the object is
 
243
 * a session object.  If neither flag is set, the object is *by
 
244
 * default* a session object.
 
245
 *
 
246
 * These two flags specify the value of the PKCS #11 CKA_TOKEN
 
247
 * attribute.
 
248
 */
 
249
#define PK11_ATTR_TOKEN         0x00000001L
 
250
#define PK11_ATTR_SESSION       0x00000002L
 
251
 
 
252
/*
 
253
 * PK11_ATTR_PRIVATE
 
254
 * PK11_ATTR_PUBLIC
 
255
 *
 
256
 * These two flags determine whether the object is a private or
 
257
 * public object.  A user may not access a private object until the
 
258
 * user has authenticated to the token.
 
259
 *
 
260
 * These two flags are related and cannot both be set.
 
261
 * If the PK11_ATTR_PRIVATE flag is set, the object is a private
 
262
 * object.  If the PK11_ATTR_PUBLIC flag is set, the object is a
 
263
 * public object.  If neither flag is set, it is token-specific
 
264
 * whether the object is private or public.
 
265
 *
 
266
 * These two flags specify the value of the PKCS #11 CKA_PRIVATE
 
267
 * attribute.  NSS only uses this attribute on private and secret
 
268
 * keys, so public keys created by NSS get the token-specific
 
269
 * default value of the CKA_PRIVATE attribute.
 
270
 */
 
271
#define PK11_ATTR_PRIVATE       0x00000004L
 
272
#define PK11_ATTR_PUBLIC        0x00000008L
 
273
 
 
274
/*
 
275
 * PK11_ATTR_MODIFIABLE
 
276
 * PK11_ATTR_UNMODIFIABLE
 
277
 *
 
278
 * These two flags determine whether the object is modifiable or
 
279
 * read-only.
 
280
 *
 
281
 * These two flags are related and cannot both be set.
 
282
 * If the PK11_ATTR_MODIFIABLE flag is set, the object can be
 
283
 * modified.  If the PK11_ATTR_UNMODIFIABLE flag is set, the object
 
284
 * is read-only.  If neither flag is set, the object is *by default*
 
285
 * modifiable.
 
286
 *
 
287
 * These two flags specify the value of the PKCS #11 CKA_MODIFIABLE
 
288
 * attribute.
 
289
 */
 
290
#define PK11_ATTR_MODIFIABLE    0x00000010L
 
291
#define PK11_ATTR_UNMODIFIABLE  0x00000020L
 
292
 
 
293
/* Attributes for PKCS #11 key objects. */
 
294
 
 
295
/*
 
296
 * PK11_ATTR_SENSITIVE
 
297
 * PK11_ATTR_INSENSITIVE
 
298
 *
 
299
 * These two flags are related and cannot both be set.
 
300
 * If the PK11_ATTR_SENSITIVE flag is set, the key is sensitive.
 
301
 * If the PK11_ATTR_INSENSITIVE flag is set, the key is not
 
302
 * sensitive.  If neither flag is set, it is token-specific whether
 
303
 * the key is sensitive or not.
 
304
 *
 
305
 * If a key is sensitive, certain attributes of the key cannot be
 
306
 * revealed in plaintext outside the token.
 
307
 *
 
308
 * This flag specifies the value of the PKCS #11 CKA_SENSITIVE
 
309
 * attribute.  Although the default value of the CKA_SENSITIVE
 
310
 * attribute for secret keys is CK_FALSE per PKCS #11, some FIPS
 
311
 * tokens set the default value to CK_TRUE because only CK_TRUE
 
312
 * is allowed.  So in practice the default value of this attribute
 
313
 * is token-specific, hence the need for two bitflags.
 
314
 */
 
315
#define PK11_ATTR_SENSITIVE     0x00000040L
 
316
#define PK11_ATTR_INSENSITIVE   0x00000080L
 
317
 
 
318
/*
 
319
 * PK11_ATTR_EXTRACTABLE
 
320
 * PK11_ATTR_UNEXTRACTABLE
 
321
 *
 
322
 * These two flags are related and cannot both be set.
 
323
 * If the PK11_ATTR_EXTRACTABLE flag is set, the key is extractable
 
324
 * and can be wrapped.  If the PK11_ATTR_UNEXTRACTABLE flag is set,
 
325
 * the key is not extractable, and certain attributes of the key
 
326
 * cannot be revealed in plaintext outside the token (just like a
 
327
 * sensitive key).  If neither flag is set, it is token-specific
 
328
 * whether the key is extractable or not.
 
329
 *
 
330
 * These two flags specify the value of the PKCS #11 CKA_EXTRACTABLE
 
331
 * attribute.
 
332
 */
 
333
#define PK11_ATTR_EXTRACTABLE   0x00000100L
 
334
#define PK11_ATTR_UNEXTRACTABLE 0x00000200L
 
335
 
 
336
/* Cryptographic module types */
 
337
#define SECMOD_EXTERNAL 0       /* external module */
 
338
#define SECMOD_INTERNAL 1       /* internal default module */
 
339
#define SECMOD_FIPS     2       /* internal fips module */
 
340
 
 
341
/* default module configuration strings */
 
342
#define SECMOD_SLOT_FLAGS "slotFlags=[RSA,DSA,DH,RC2,RC4,DES,RANDOM,SHA1,MD5,MD2,SSL,TLS,AES,SHA256,SHA512]"
 
343
 
 
344
#define SECMOD_MAKE_NSS_FLAGS(fips,slot) \
 
345
"Flags=internal,critical"fips" slotparams=("#slot"={"SECMOD_SLOT_FLAGS"})"
 
346
 
 
347
#define SECMOD_INT_NAME "NSS Internal PKCS #11 Module"
 
348
#define SECMOD_INT_FLAGS SECMOD_MAKE_NSS_FLAGS("",1)
 
349
#define SECMOD_FIPS_NAME "NSS Internal FIPS PKCS #11 Module"
 
350
#define SECMOD_FIPS_FLAGS SECMOD_MAKE_NSS_FLAGS(",fips",3)
 
351
 
 
352
/*
 
353
 * What is the origin of a given Key. Normally this doesn't matter, but
 
354
 * the fortezza code needs to know if it needs to invoke the SSL3 fortezza
 
355
 * hack.
 
356
 */
 
357
typedef enum {
 
358
    PK11_OriginNULL = 0,        /* There is not key, it's a null SymKey */
 
359
    PK11_OriginDerive = 1,      /* Key was derived from some other key */
 
360
    PK11_OriginGenerated = 2,   /* Key was generated (also PBE keys) */
 
361
    PK11_OriginFortezzaHack = 3,/* Key was marked for fortezza hack */
 
362
    PK11_OriginUnwrap = 4       /* Key was unwrapped or decrypted */
 
363
} PK11Origin;
 
364
 
 
365
/* PKCS #11 disable reasons */
 
366
typedef enum {
 
367
    PK11_DIS_NONE = 0,
 
368
    PK11_DIS_USER_SELECTED = 1,
 
369
    PK11_DIS_COULD_NOT_INIT_TOKEN = 2,
 
370
    PK11_DIS_TOKEN_VERIFY_FAILED = 3,
 
371
    PK11_DIS_TOKEN_NOT_PRESENT = 4
 
372
} PK11DisableReasons;
 
373
 
 
374
/* types of PKCS #11 objects */
 
375
typedef enum {
 
376
   PK11_TypeGeneric = 0,
 
377
   PK11_TypePrivKey = 1,
 
378
   PK11_TypePubKey = 2,
 
379
   PK11_TypeCert = 3,
 
380
   PK11_TypeSymKey = 4
 
381
} PK11ObjectType;
 
382
 
 
383
 
 
384
 
 
385
/* function pointer type for password callback function.
 
386
 * This type is passed in to PK11_SetPasswordFunc() 
 
387
 */
 
388
typedef char *(PR_CALLBACK *PK11PasswordFunc)(PK11SlotInfo *slot, PRBool retry, void *arg);
 
389
typedef PRBool (PR_CALLBACK *PK11VerifyPasswordFunc)(PK11SlotInfo *slot, void *arg);
 
390
typedef PRBool (PR_CALLBACK *PK11IsLoggedInFunc)(PK11SlotInfo *slot, void *arg);
 
391
 
 
392
/*
 
393
 * Special strings the password callback function can return only if
 
394
 * the slot is an protected auth path slot.
 
395
 */ 
 
396
#define PK11_PW_RETRY           "RETRY" /* an failed attempt to authenticate
 
397
                                         * has already been made, just retry
 
398
                                         * the operation */
 
399
#define PK11_PW_AUTHENTICATED   "AUTH"  /* a successful attempt to authenticate
 
400
                                         * has completed. Continue without
 
401
                                         * another call to C_Login */
 
402
/* All other non-null values mean that that NSS could call C_Login to force
 
403
 * the authentication. The following define is to aid applications in 
 
404
 * documenting that is what it's trying to do */
 
405
#define PK11_PW_TRY             "TRY"   /* Default: a prompt has been presented
 
406
                                         * to the user, initiate a C_Login
 
407
                                         * to authenticate the token */
 
408
 
 
409
/*
 
410
 * PKCS #11 key structures
 
411
 */
 
412
 
 
413
/*
 
414
** Attributes
 
415
*/
 
416
struct SECKEYAttributeStr {
 
417
    SECItem attrType;
 
418
    SECItem **attrValue;
 
419
};
 
420
typedef struct SECKEYAttributeStr SECKEYAttribute;
 
421
 
 
422
/*
 
423
** A PKCS#8 private key info object
 
424
*/
 
425
struct SECKEYPrivateKeyInfoStr {
 
426
    PLArenaPool *arena;
 
427
    SECItem version;
 
428
    SECAlgorithmID algorithm;
 
429
    SECItem privateKey;
 
430
    SECKEYAttribute **attributes;
 
431
};
 
432
typedef struct SECKEYPrivateKeyInfoStr SECKEYPrivateKeyInfo;
 
433
 
 
434
/*
 
435
** A PKCS#8 private key info object
 
436
*/
 
437
struct SECKEYEncryptedPrivateKeyInfoStr {
 
438
    PLArenaPool *arena;
 
439
    SECAlgorithmID algorithm;
 
440
    SECItem encryptedData;
 
441
};
 
442
typedef struct SECKEYEncryptedPrivateKeyInfoStr SECKEYEncryptedPrivateKeyInfo;
 
443
 
 
444
/*
 
445
 * token removal detection
 
446
 */
 
447
typedef enum {
 
448
   PK11TokenNotRemovable = 0,
 
449
   PK11TokenPresent = 1,
 
450
   PK11TokenChanged = 2,
 
451
   PK11TokenRemoved = 3
 
452
} PK11TokenStatus;
 
453
 
 
454
typedef enum {
 
455
   PK11TokenRemovedOrChangedEvent = 0,
 
456
   PK11TokenPresentEvent = 1
 
457
} PK11TokenEvent;
 
458
 
 
459
/*
 
460
 * CRL Import Flags
 
461
 */
 
462
#define CRL_IMPORT_DEFAULT_OPTIONS 0x00000000
 
463
#define CRL_IMPORT_BYPASS_CHECKS   0x00000001
 
464
 
 
465
#endif /*_SECMODT_H_ */