Blame nss/lib/pk11wrap/secmodt.h

Packit 40b132
/* This Source Code Form is subject to the terms of the Mozilla Public
Packit 40b132
 * License, v. 2.0. If a copy of the MPL was not distributed with this
Packit 40b132
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Packit 40b132
#ifndef _SECMODT_H_
Packit 40b132
#define _SECMODT_H_ 1
Packit 40b132
Packit 40b132
#include "nssrwlkt.h"
Packit 40b132
#include "nssilckt.h"
Packit 40b132
#include "secoid.h"
Packit 40b132
#include "secasn1.h"
Packit 40b132
#include "pkcs11t.h"
Packit 40b132
#include "utilmodt.h"
Packit 40b132
Packit 40b132
SEC_BEGIN_PROTOS
Packit 40b132
Packit 40b132
/* find a better home for these... */
Packit 40b132
extern const SEC_ASN1Template SECKEY_PointerToEncryptedPrivateKeyInfoTemplate[];
Packit 40b132
SEC_ASN1_CHOOSER_DECLARE(SECKEY_PointerToEncryptedPrivateKeyInfoTemplate)
Packit 40b132
extern const SEC_ASN1Template SECKEY_EncryptedPrivateKeyInfoTemplate[];
Packit 40b132
SEC_ASN1_CHOOSER_DECLARE(SECKEY_EncryptedPrivateKeyInfoTemplate)
Packit 40b132
extern const SEC_ASN1Template SECKEY_PrivateKeyInfoTemplate[];
Packit 40b132
SEC_ASN1_CHOOSER_DECLARE(SECKEY_PrivateKeyInfoTemplate)
Packit 40b132
extern const SEC_ASN1Template SECKEY_PointerToPrivateKeyInfoTemplate[];
Packit 40b132
SEC_ASN1_CHOOSER_DECLARE(SECKEY_PointerToPrivateKeyInfoTemplate)
Packit 40b132
Packit 40b132
SEC_END_PROTOS
Packit 40b132
Packit 40b132
/* PKCS11 needs to be included */
Packit 40b132
typedef struct SECMODModuleStr SECMODModule;
Packit 40b132
typedef struct SECMODModuleListStr SECMODModuleList;
Packit 40b132
typedef NSSRWLock SECMODListLock;
Packit 40b132
typedef struct PK11SlotInfoStr PK11SlotInfo; /* defined in secmodti.h */
Packit 40b132
typedef struct NSSUTILPreSlotInfoStr PK11PreSlotInfo; /* defined in secmodti.h */
Packit 40b132
typedef struct PK11SymKeyStr PK11SymKey; /* defined in secmodti.h */
Packit 40b132
typedef struct PK11ContextStr PK11Context; /* defined in secmodti.h */
Packit 40b132
typedef struct PK11SlotListStr PK11SlotList;
Packit 40b132
typedef struct PK11SlotListElementStr PK11SlotListElement;
Packit 40b132
typedef struct PK11RSAGenParamsStr PK11RSAGenParams;
Packit 40b132
typedef unsigned long SECMODModuleID;
Packit 40b132
typedef struct PK11DefaultArrayEntryStr PK11DefaultArrayEntry;
Packit 40b132
typedef struct PK11GenericObjectStr PK11GenericObject;
Packit 40b132
typedef void (*PK11FreeDataFunc)(void *);
Packit 40b132
Packit 40b132
struct SECMODModuleStr {
Packit 40b132
    PLArenaPool	*arena;
Packit 40b132
    PRBool	internal;	/* true of internally linked modules, false
Packit 40b132
				 * for the loaded modules */
Packit 40b132
    PRBool	loaded;		/* Set to true if module has been loaded */
Packit 40b132
    PRBool	isFIPS;		/* Set to true if module is finst internal */
Packit 40b132
    char	*dllName;	/* name of the shared library which implements
Packit 40b132
				 * this module */
Packit 40b132
    char	*commonName;	/* name of the module to display to the user */
Packit 40b132
    void	*library;	/* pointer to the library. opaque. used only by
Packit 40b132
				 * pk11load.c */
Packit 40b132
    void	*functionList; /* The PKCS #11 function table */
Packit 40b132
    PZLock	*refLock;	/* only used pk11db.c */
Packit 40b132
    int		refCount;	/* Module reference count */
Packit 40b132
    PK11SlotInfo **slots;	/* array of slot points attached to this mod*/
Packit 40b132
    int		slotCount;	/* count of slot in above array */
Packit 40b132
    PK11PreSlotInfo *slotInfo;	/* special info about slots default settings */
Packit 40b132
    int		slotInfoCount;  /* count */
Packit 40b132
    SECMODModuleID moduleID;	/* ID so we can find this module again */
Packit 40b132
    PRBool	isThreadSafe;
Packit 40b132
    unsigned long ssl[2];	/* SSL cipher enable flags */
Packit 40b132
    char	*libraryParams;  /* Module specific parameters */
Packit 40b132
    void *moduleDBFunc; /* function to return module configuration data*/
Packit 40b132
    SECMODModule *parent;	/* module that loaded us */
Packit 40b132
    PRBool	isCritical;	/* This module must load successfully */
Packit 40b132
    PRBool	isModuleDB;	/* this module has lists of PKCS #11 modules */
Packit 40b132
    PRBool	moduleDBOnly;	/* this module only has lists of PKCS #11 modules */
Packit 40b132
    int		trustOrder;	/* order for this module's certificate trust rollup */
Packit 40b132
    int		cipherOrder;	/* order for cipher operations */
Packit 40b132
    unsigned long evControlMask; /* control the running and shutdown of slot
Packit 40b132
				  * events (SECMOD_WaitForAnyTokenEvent) */
Packit 40b132
    CK_VERSION  cryptokiVersion; /* version of this library */
Packit 40b132
};
Packit 40b132
Packit 40b132
/* evControlMask flags */
Packit 40b132
/*
Packit 40b132
 * These bits tell the current state of a SECMOD_WaitForAnyTokenEvent.
Packit 40b132
 *
Packit 40b132
 * SECMOD_WAIT_PKCS11_EVENT - we're waiting in the PKCS #11 module in
Packit 40b132
 *  C_WaitForSlotEvent().
Packit 40b132
 * SECMOD_WAIT_SIMULATED_EVENT - we're waiting in the NSS simulation code
Packit 40b132
 *  which polls for token insertion and removal events.
Packit 40b132
 * SECMOD_END_WAIT - SECMOD_CancelWait has been called while the module is
Packit 40b132
 *  waiting in SECMOD_WaitForAnyTokenEvent. SECMOD_WaitForAnyTokenEvent
Packit 40b132
 *  should return immediately to it's caller.
Packit 40b132
 */ 
Packit 40b132
#define SECMOD_END_WAIT 	    0x01
Packit 40b132
#define SECMOD_WAIT_SIMULATED_EVENT 0x02 
Packit 40b132
#define SECMOD_WAIT_PKCS11_EVENT    0x04
Packit 40b132
Packit 40b132
struct SECMODModuleListStr {
Packit 40b132
    SECMODModuleList	*next;
Packit 40b132
    SECMODModule	*module;
Packit 40b132
};
Packit 40b132
Packit 40b132
struct PK11SlotListStr {
Packit 40b132
    PK11SlotListElement *head;
Packit 40b132
    PK11SlotListElement *tail;
Packit 40b132
    PZLock *lock;
Packit 40b132
};
Packit 40b132
Packit 40b132
struct PK11SlotListElementStr {
Packit 40b132
    PK11SlotListElement *next;
Packit 40b132
    PK11SlotListElement *prev;
Packit 40b132
    PK11SlotInfo *slot;
Packit 40b132
    int refCount;
Packit 40b132
};
Packit 40b132
Packit 40b132
struct PK11RSAGenParamsStr {
Packit 40b132
    int keySizeInBits;
Packit 40b132
    unsigned long pe;
Packit 40b132
};
Packit 40b132
Packit 40b132
typedef enum {
Packit 40b132
     PK11CertListUnique = 0,     /* get one instance of all certs */
Packit 40b132
     PK11CertListUser = 1,       /* get all instances of user certs */
Packit 40b132
     PK11CertListRootUnique = 2, /* get one instance of CA certs without a private key.
Packit 40b132
                                  * deprecated. Use PK11CertListCAUnique
Packit 40b132
                                  */
Packit 40b132
     PK11CertListCA = 3,         /* get all instances of CA certs */
Packit 40b132
     PK11CertListCAUnique = 4,   /* get one instance of CA certs */
Packit 40b132
     PK11CertListUserUnique = 5, /* get one instance of user certs */
Packit 40b132
     PK11CertListAll = 6         /* get all instances of all certs */
Packit 40b132
} PK11CertListType;
Packit 40b132
Packit 40b132
/*
Packit 40b132
 * Entry into the array which lists all the legal bits for the default flags
Packit 40b132
 * in the slot, their definition, and the PKCS #11 mechanism they represent.
Packit 40b132
 * Always statically allocated. 
Packit 40b132
 */
Packit 40b132
struct PK11DefaultArrayEntryStr {
Packit 40b132
    const char *name;
Packit 40b132
    unsigned long flag;
Packit 40b132
    unsigned long mechanism; /* this is a long so we don't include the 
Packit 40b132
			      * whole pkcs 11 world to use this header */
Packit 40b132
};
Packit 40b132
Packit 40b132
/*
Packit 40b132
 * PK11AttrFlags
Packit 40b132
 *
Packit 40b132
 * A 32-bit bitmask of PK11_ATTR_XXX flags
Packit 40b132
 */
Packit 40b132
typedef PRUint32 PK11AttrFlags;
Packit 40b132
Packit 40b132
/*
Packit 40b132
 * PK11_ATTR_XXX
Packit 40b132
 *
Packit 40b132
 * The following PK11_ATTR_XXX bitflags are used to specify
Packit 40b132
 * PKCS #11 object attributes that have Boolean values.  Some NSS
Packit 40b132
 * functions have a "PK11AttrFlags attrFlags" parameter whose value
Packit 40b132
 * is the logical OR of these bitflags.  NSS use these bitflags on
Packit 40b132
 * private keys or secret keys.  Some of these bitflags also apply
Packit 40b132
 * to the public keys associated with the private keys.
Packit 40b132
 *
Packit 40b132
 * For each PKCS #11 object attribute, we need two bitflags to
Packit 40b132
 * specify not only "true" and "false" but also "default".  For
Packit 40b132
 * example, PK11_ATTR_PRIVATE and PK11_ATTR_PUBLIC control the
Packit 40b132
 * CKA_PRIVATE attribute.  If PK11_ATTR_PRIVATE is set, we add
Packit 40b132
 *     { CKA_PRIVATE, &cktrue, sizeof(CK_BBOOL) }
Packit 40b132
 * to the template.  If PK11_ATTR_PUBLIC is set, we add
Packit 40b132
 *     { CKA_PRIVATE, &ckfalse, sizeof(CK_BBOOL) }
Packit 40b132
 * to the template.  If neither flag is set, we don't add any
Packit 40b132
 * CKA_PRIVATE entry to the template.
Packit 40b132
 */
Packit 40b132
Packit 40b132
/*
Packit 40b132
 * Attributes for PKCS #11 storage objects, which include not only
Packit 40b132
 * keys but also certificates and domain parameters.
Packit 40b132
 */
Packit 40b132
Packit 40b132
/*
Packit 40b132
 * PK11_ATTR_TOKEN
Packit 40b132
 * PK11_ATTR_SESSION
Packit 40b132
 *
Packit 40b132
 * These two flags determine whether the object is a token or
Packit 40b132
 * session object.
Packit 40b132
 *
Packit 40b132
 * These two flags are related and cannot both be set.
Packit 40b132
 * If the PK11_ATTR_TOKEN flag is set, the object is a token
Packit 40b132
 * object.  If the PK11_ATTR_SESSION flag is set, the object is
Packit 40b132
 * a session object.  If neither flag is set, the object is *by
Packit 40b132
 * default* a session object.
Packit 40b132
 *
Packit 40b132
 * These two flags specify the value of the PKCS #11 CKA_TOKEN
Packit 40b132
 * attribute.
Packit 40b132
 */
Packit 40b132
#define PK11_ATTR_TOKEN         0x00000001L
Packit 40b132
#define PK11_ATTR_SESSION       0x00000002L
Packit 40b132
Packit 40b132
/*
Packit 40b132
 * PK11_ATTR_PRIVATE
Packit 40b132
 * PK11_ATTR_PUBLIC
Packit 40b132
 *
Packit 40b132
 * These two flags determine whether the object is a private or
Packit 40b132
 * public object.  A user may not access a private object until the
Packit 40b132
 * user has authenticated to the token.
Packit 40b132
 *
Packit 40b132
 * These two flags are related and cannot both be set.
Packit 40b132
 * If the PK11_ATTR_PRIVATE flag is set, the object is a private
Packit 40b132
 * object.  If the PK11_ATTR_PUBLIC flag is set, the object is a
Packit 40b132
 * public object.  If neither flag is set, it is token-specific
Packit 40b132
 * whether the object is private or public.
Packit 40b132
 *
Packit 40b132
 * These two flags specify the value of the PKCS #11 CKA_PRIVATE
Packit 40b132
 * attribute.  NSS only uses this attribute on private and secret
Packit 40b132
 * keys, so public keys created by NSS get the token-specific
Packit 40b132
 * default value of the CKA_PRIVATE attribute.
Packit 40b132
 */
Packit 40b132
#define PK11_ATTR_PRIVATE       0x00000004L
Packit 40b132
#define PK11_ATTR_PUBLIC        0x00000008L
Packit 40b132
Packit 40b132
/*
Packit 40b132
 * PK11_ATTR_MODIFIABLE
Packit 40b132
 * PK11_ATTR_UNMODIFIABLE
Packit 40b132
 *
Packit 40b132
 * These two flags determine whether the object is modifiable or
Packit 40b132
 * read-only.
Packit 40b132
 *
Packit 40b132
 * These two flags are related and cannot both be set.
Packit 40b132
 * If the PK11_ATTR_MODIFIABLE flag is set, the object can be
Packit 40b132
 * modified.  If the PK11_ATTR_UNMODIFIABLE flag is set, the object
Packit 40b132
 * is read-only.  If neither flag is set, the object is *by default*
Packit 40b132
 * modifiable.
Packit 40b132
 *
Packit 40b132
 * These two flags specify the value of the PKCS #11 CKA_MODIFIABLE
Packit 40b132
 * attribute.
Packit 40b132
 */
Packit 40b132
#define PK11_ATTR_MODIFIABLE    0x00000010L
Packit 40b132
#define PK11_ATTR_UNMODIFIABLE  0x00000020L
Packit 40b132
Packit 40b132
/* Attributes for PKCS #11 key objects. */
Packit 40b132
Packit 40b132
/*
Packit 40b132
 * PK11_ATTR_SENSITIVE
Packit 40b132
 * PK11_ATTR_INSENSITIVE
Packit 40b132
 *
Packit 40b132
 * These two flags are related and cannot both be set.
Packit 40b132
 * If the PK11_ATTR_SENSITIVE flag is set, the key is sensitive.
Packit 40b132
 * If the PK11_ATTR_INSENSITIVE flag is set, the key is not
Packit 40b132
 * sensitive.  If neither flag is set, it is token-specific whether
Packit 40b132
 * the key is sensitive or not.
Packit 40b132
 *
Packit 40b132
 * If a key is sensitive, certain attributes of the key cannot be
Packit 40b132
 * revealed in plaintext outside the token.
Packit 40b132
 *
Packit 40b132
 * This flag specifies the value of the PKCS #11 CKA_SENSITIVE
Packit 40b132
 * attribute.  Although the default value of the CKA_SENSITIVE
Packit 40b132
 * attribute for secret keys is CK_FALSE per PKCS #11, some FIPS
Packit 40b132
 * tokens set the default value to CK_TRUE because only CK_TRUE
Packit 40b132
 * is allowed.  So in practice the default value of this attribute
Packit 40b132
 * is token-specific, hence the need for two bitflags.
Packit 40b132
 */
Packit 40b132
#define PK11_ATTR_SENSITIVE     0x00000040L
Packit 40b132
#define PK11_ATTR_INSENSITIVE   0x00000080L
Packit 40b132
Packit 40b132
/*
Packit 40b132
 * PK11_ATTR_EXTRACTABLE
Packit 40b132
 * PK11_ATTR_UNEXTRACTABLE
Packit 40b132
 *
Packit 40b132
 * These two flags are related and cannot both be set.
Packit 40b132
 * If the PK11_ATTR_EXTRACTABLE flag is set, the key is extractable
Packit 40b132
 * and can be wrapped.  If the PK11_ATTR_UNEXTRACTABLE flag is set,
Packit 40b132
 * the key is not extractable, and certain attributes of the key
Packit 40b132
 * cannot be revealed in plaintext outside the token (just like a
Packit 40b132
 * sensitive key).  If neither flag is set, it is token-specific
Packit 40b132
 * whether the key is extractable or not.
Packit 40b132
 *
Packit 40b132
 * These two flags specify the value of the PKCS #11 CKA_EXTRACTABLE
Packit 40b132
 * attribute.
Packit 40b132
 */
Packit 40b132
#define PK11_ATTR_EXTRACTABLE   0x00000100L
Packit 40b132
#define PK11_ATTR_UNEXTRACTABLE 0x00000200L
Packit 40b132
Packit 40b132
/* Cryptographic module types */
Packit 40b132
#define SECMOD_EXTERNAL	0	/* external module */
Packit 40b132
#define SECMOD_INTERNAL 1	/* internal default module */
Packit 40b132
#define SECMOD_FIPS	2	/* internal fips module */
Packit 40b132
Packit 40b132
/* default module configuration strings */
Packit 40b132
#define SECMOD_SLOT_FLAGS "slotFlags=[RSA,DSA,DH,RC2,RC4,DES,RANDOM,SHA1,MD5,MD2,SSL,TLS,AES,Camellia,SEED,SHA256,SHA512]"
Packit 40b132
Packit 40b132
#define SECMOD_MAKE_NSS_FLAGS(fips,slot) \
Packit 40b132
"Flags=internal,critical" fips " slotparams=(" #slot "={" SECMOD_SLOT_FLAGS "})"
Packit 40b132
Packit 40b132
#define SECMOD_INT_NAME "NSS Internal PKCS #11 Module"
Packit 40b132
#define SECMOD_INT_FLAGS SECMOD_MAKE_NSS_FLAGS("",1)
Packit 40b132
#define SECMOD_FIPS_NAME "NSS Internal FIPS PKCS #11 Module"
Packit 40b132
#define SECMOD_FIPS_FLAGS SECMOD_MAKE_NSS_FLAGS(",fips",3)
Packit 40b132
Packit 40b132
/*
Packit 40b132
 * What is the origin of a given Key. Normally this doesn't matter, but
Packit 40b132
 * the fortezza code needs to know if it needs to invoke the SSL3 fortezza
Packit 40b132
 * hack.
Packit 40b132
 */
Packit 40b132
typedef enum {
Packit 40b132
    PK11_OriginNULL = 0,	/* There is not key, it's a null SymKey */
Packit 40b132
    PK11_OriginDerive = 1,	/* Key was derived from some other key */
Packit 40b132
    PK11_OriginGenerated = 2,	/* Key was generated (also PBE keys) */
Packit 40b132
    PK11_OriginFortezzaHack = 3,/* Key was marked for fortezza hack */
Packit 40b132
    PK11_OriginUnwrap = 4	/* Key was unwrapped or decrypted */
Packit 40b132
} PK11Origin;
Packit 40b132
Packit 40b132
/* PKCS #11 disable reasons */
Packit 40b132
typedef enum {
Packit 40b132
    PK11_DIS_NONE = 0,
Packit 40b132
    PK11_DIS_USER_SELECTED = 1,
Packit 40b132
    PK11_DIS_COULD_NOT_INIT_TOKEN = 2,
Packit 40b132
    PK11_DIS_TOKEN_VERIFY_FAILED = 3,
Packit 40b132
    PK11_DIS_TOKEN_NOT_PRESENT = 4
Packit 40b132
} PK11DisableReasons;
Packit 40b132
Packit 40b132
/* types of PKCS #11 objects 
Packit 40b132
 * used to identify which NSS data structure is 
Packit 40b132
 * passed to the PK11_Raw* functions. Types map as follows:
Packit 40b132
 *   PK11_TypeGeneric            PK11GenericObject *
Packit 40b132
 *   PK11_TypePrivKey            SECKEYPrivateKey *
Packit 40b132
 *   PK11_TypePubKey             SECKEYPublicKey *
Packit 40b132
 *   PK11_TypeSymKey             PK11SymKey *
Packit 40b132
 *   PK11_TypeCert               CERTCertificate * (currently not used).
Packit 40b132
 */
Packit 40b132
typedef enum {
Packit 40b132
   PK11_TypeGeneric = 0,
Packit 40b132
   PK11_TypePrivKey = 1,
Packit 40b132
   PK11_TypePubKey = 2,
Packit 40b132
   PK11_TypeCert = 3,
Packit 40b132
   PK11_TypeSymKey = 4
Packit 40b132
} PK11ObjectType;
Packit 40b132
Packit 40b132
Packit 40b132
Packit 40b132
/* function pointer type for password callback function.
Packit 40b132
 * This type is passed in to PK11_SetPasswordFunc() 
Packit 40b132
 */
Packit 40b132
typedef char *(PR_CALLBACK *PK11PasswordFunc)(PK11SlotInfo *slot, PRBool retry, void *arg);
Packit 40b132
typedef PRBool (PR_CALLBACK *PK11VerifyPasswordFunc)(PK11SlotInfo *slot, void *arg);
Packit 40b132
typedef PRBool (PR_CALLBACK *PK11IsLoggedInFunc)(PK11SlotInfo *slot, void *arg);
Packit 40b132
Packit 40b132
/*
Packit 40b132
 * Special strings the password callback function can return only if
Packit 40b132
 * the slot is an protected auth path slot.
Packit 40b132
 */ 
Packit 40b132
#define PK11_PW_RETRY		"RETRY"	/* an failed attempt to authenticate
Packit 40b132
					 * has already been made, just retry
Packit 40b132
					 * the operation */
Packit 40b132
#define PK11_PW_AUTHENTICATED	"AUTH"  /* a successful attempt to authenticate
Packit 40b132
					 * has completed. Continue without
Packit 40b132
					 * another call to C_Login */
Packit 40b132
/* All other non-null values mean that that NSS could call C_Login to force
Packit 40b132
 * the authentication. The following define is to aid applications in 
Packit 40b132
 * documenting that is what it's trying to do */
Packit 40b132
#define PK11_PW_TRY		"TRY"   /* Default: a prompt has been presented
Packit 40b132
					 * to the user, initiate a C_Login
Packit 40b132
					 * to authenticate the token */
Packit 40b132
Packit 40b132
/*
Packit 40b132
 * PKCS #11 key structures
Packit 40b132
 */
Packit 40b132
Packit 40b132
/*
Packit 40b132
** Attributes
Packit 40b132
*/
Packit 40b132
struct SECKEYAttributeStr {
Packit 40b132
    SECItem attrType;
Packit 40b132
    SECItem **attrValue;
Packit 40b132
};
Packit 40b132
typedef struct SECKEYAttributeStr SECKEYAttribute;
Packit 40b132
Packit 40b132
/*
Packit 40b132
** A PKCS#8 private key info object
Packit 40b132
*/
Packit 40b132
struct SECKEYPrivateKeyInfoStr {
Packit 40b132
    PLArenaPool *arena;
Packit 40b132
    SECItem version;
Packit 40b132
    SECAlgorithmID algorithm;
Packit 40b132
    SECItem privateKey;
Packit 40b132
    SECKEYAttribute **attributes;
Packit 40b132
};
Packit 40b132
typedef struct SECKEYPrivateKeyInfoStr SECKEYPrivateKeyInfo;
Packit 40b132
Packit 40b132
/*
Packit 40b132
** A PKCS#8 private key info object
Packit 40b132
*/
Packit 40b132
struct SECKEYEncryptedPrivateKeyInfoStr {
Packit 40b132
    PLArenaPool *arena;
Packit 40b132
    SECAlgorithmID algorithm;
Packit 40b132
    SECItem encryptedData;
Packit 40b132
};
Packit 40b132
typedef struct SECKEYEncryptedPrivateKeyInfoStr SECKEYEncryptedPrivateKeyInfo;
Packit 40b132
Packit 40b132
/*
Packit 40b132
 * token removal detection
Packit 40b132
 */
Packit 40b132
typedef enum {
Packit 40b132
   PK11TokenNotRemovable = 0,
Packit 40b132
   PK11TokenPresent = 1,
Packit 40b132
   PK11TokenChanged = 2,
Packit 40b132
   PK11TokenRemoved = 3
Packit 40b132
} PK11TokenStatus;
Packit 40b132
Packit 40b132
typedef enum {
Packit 40b132
   PK11TokenRemovedOrChangedEvent = 0,
Packit 40b132
   PK11TokenPresentEvent = 1
Packit 40b132
} PK11TokenEvent;
Packit 40b132
Packit 40b132
/*
Packit 40b132
 * CRL Import Flags
Packit 40b132
 */
Packit 40b132
#define CRL_IMPORT_DEFAULT_OPTIONS 0x00000000
Packit 40b132
#define CRL_IMPORT_BYPASS_CHECKS   0x00000001
Packit 40b132
Packit 40b132
Packit 40b132
/*
Packit 40b132
 * Merge Error Log
Packit 40b132
 */
Packit 40b132
typedef struct PK11MergeLogStr PK11MergeLog;
Packit 40b132
typedef struct PK11MergeLogNodeStr PK11MergeLogNode;
Packit 40b132
Packit 40b132
/* These need to be global, leave some open fields so we can 'expand'
Packit 40b132
 * these without breaking binary compatibility */
Packit 40b132
struct PK11MergeLogNodeStr {
Packit 40b132
    PK11MergeLogNode *next;   /* next entry in the list */
Packit 40b132
    PK11MergeLogNode *prev;   /* last entry in the list */
Packit 40b132
    PK11GenericObject *object; /* object that failed */
Packit 40b132
    int	error;		       /* what the error was */
Packit 40b132
    CK_RV reserved1;
Packit 40b132
    unsigned long reserved2; /* future flags */
Packit 40b132
    unsigned long reserved3; /* future scalar */
Packit 40b132
    void *reserved4; 	      /* future pointer */
Packit 40b132
    void *reserved5;	      /* future expansion pointer */
Packit 40b132
};
Packit 40b132
Packit 40b132
struct PK11MergeLogStr {
Packit 40b132
    PK11MergeLogNode *head;
Packit 40b132
    PK11MergeLogNode *tail;
Packit 40b132
    PLArenaPool *arena;
Packit 40b132
    int version;
Packit 40b132
    unsigned long reserved1;
Packit 40b132
    unsigned long reserved2;
Packit 40b132
    unsigned long reserved3;
Packit 40b132
    void *reserverd4;
Packit 40b132
    void *reserverd5;
Packit 40b132
};
Packit 40b132
    
Packit 40b132
Packit 40b132
#endif /*_SECMODT_H_ */