annotate nss/lib/softoken/legacydb/lgdb.h @ 3:150b72113545

Add DBM and legacydb support
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 05 Aug 2014 18:32:02 +0200
parents
children
rev   line source
3
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
1 /* This Source Code Form is subject to the terms of the Mozilla Public
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
4 /*
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
5 * Internal data structures and functions used by pkcs11.c
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
6 */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
7 #ifndef _LGDB_H_
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
8 #define _LGDB_H_ 1
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
9
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
10 #include "nssilock.h"
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
11 #include "seccomon.h"
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
12 #include "secoidt.h"
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
13 #include "lowkeyti.h"
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
14 #include "pkcs11t.h"
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
15 #include "sdb.h"
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
16 #include "cdbhdl.h"
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
17
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
18
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
19 #define MULTIACCESS "multiaccess:"
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
20
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
21
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
22 /* path stuff (was machine dependent) used by dbinit.c and pk11db.c */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
23 #define PATH_SEPARATOR "/"
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
24 #define SECMOD_DB "secmod.db"
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
25 #define CERT_DB_FMT "%scert%s.db"
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
26 #define KEY_DB_FMT "%skey%s.db"
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
27
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
28 SEC_BEGIN_PROTOS
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
29
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
30
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
31 /* internal utility functions used by pkcs11.c */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
32 extern const CK_ATTRIBUTE *lg_FindAttribute(CK_ATTRIBUTE_TYPE type,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
33 const CK_ATTRIBUTE *templ, CK_ULONG count);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
34 extern CK_RV lg_Attribute2SecItem(PLArenaPool *,CK_ATTRIBUTE_TYPE type,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
35 const CK_ATTRIBUTE *templ, CK_ULONG count,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
36 SECItem *item);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
37 extern CK_RV lg_Attribute2SSecItem(PLArenaPool *,CK_ATTRIBUTE_TYPE type,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
38 const CK_ATTRIBUTE *templ, CK_ULONG count,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
39 SECItem *item);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
40 extern CK_RV lg_PrivAttr2SecItem(PLArenaPool *,CK_ATTRIBUTE_TYPE type,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
41 const CK_ATTRIBUTE *templ, CK_ULONG count,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
42 SECItem *item, SDB *sdbpw);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
43 extern CK_RV lg_PrivAttr2SSecItem(PLArenaPool *,CK_ATTRIBUTE_TYPE type,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
44 const CK_ATTRIBUTE *templ, CK_ULONG count,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
45 SECItem *item, SDB *sdbpw);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
46 extern CK_RV lg_GetULongAttribute(CK_ATTRIBUTE_TYPE type,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
47 const CK_ATTRIBUTE *templ, CK_ULONG count,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
48 CK_ULONG *out);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
49 extern PRBool lg_hasAttribute(CK_ATTRIBUTE_TYPE type,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
50 const CK_ATTRIBUTE *templ, CK_ULONG count);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
51 extern PRBool lg_isTrue(CK_ATTRIBUTE_TYPE type,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
52 const CK_ATTRIBUTE *templ, CK_ULONG count);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
53 extern PRBool lg_isSensitive(CK_ATTRIBUTE_TYPE type, CK_OBJECT_CLASS inClass);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
54 extern char *lg_getString(CK_ATTRIBUTE_TYPE type,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
55 const CK_ATTRIBUTE *templ, CK_ULONG count);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
56 extern unsigned int lg_MapTrust(CK_TRUST trust, PRBool clientAuth);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
57
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
58 /* clear out all the existing object ID to database key mappings.
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
59 * used to reinit a token */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
60 extern CK_RV lg_ClearTokenKeyHashTable(SDB *sdb);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
61
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
62
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
63 extern void lg_FreeSearch(SDBFind *search);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
64
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
65 NSSLOWCERTCertDBHandle *lg_getCertDB(SDB *sdb);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
66 NSSLOWKEYDBHandle *lg_getKeyDB(SDB *sdb);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
67
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
68 const char *lg_EvaluateConfigDir(const char *configdir, char **domain);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
69
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
70
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
71 /*
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
72 * object handle modifiers
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
73 */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
74 #define LG_TOKEN_MASK 0xc0000000L
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
75 #define LG_TOKEN_TYPE_MASK 0x38000000L
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
76 #define LG_TOKEN_TYPE_SHIFT 27
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
77 /* keydb (high bit == 0) */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
78 #define LG_TOKEN_TYPE_PRIV 0x08000000L
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
79 #define LG_TOKEN_TYPE_PUB 0x10000000L
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
80 #define LG_TOKEN_TYPE_KEY 0x18000000L
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
81 /* certdb (high bit == 1) */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
82 #define LG_TOKEN_TYPE_TRUST 0x20000000L
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
83 #define LG_TOKEN_TYPE_CRL 0x28000000L
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
84 #define LG_TOKEN_TYPE_SMIME 0x30000000L
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
85 #define LG_TOKEN_TYPE_CERT 0x38000000L
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
86
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
87 #define LG_TOKEN_KRL_HANDLE (LG_TOKEN_TYPE_CRL|1)
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
88
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
89 #define LG_SEARCH_BLOCK_SIZE 10
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
90 #define LG_BUF_SPACE 50
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
91 #define LG_STRICT PR_FALSE
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
92
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
93 /*
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
94 * token object utilities
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
95 */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
96 void lg_addHandle(SDBFind *search, CK_OBJECT_HANDLE handle);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
97 PRBool lg_poisonHandle(SDB *sdb, SECItem *dbkey, CK_OBJECT_HANDLE handle);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
98 PRBool lg_tokenMatch(SDB *sdb, const SECItem *dbKey, CK_OBJECT_HANDLE class,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
99 const CK_ATTRIBUTE *templ, CK_ULONG count);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
100 const SECItem *lg_lookupTokenKeyByHandle(SDB *sdb, CK_OBJECT_HANDLE handle);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
101 CK_OBJECT_HANDLE lg_mkHandle(SDB *sdb, SECItem *dbKey, CK_OBJECT_HANDLE class);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
102 SECStatus lg_deleteTokenKeyByHandle(SDB *sdb, CK_OBJECT_HANDLE handle);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
103
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
104 SECStatus lg_util_encrypt(PLArenaPool *arena, SDB *sdbpw,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
105 SECItem *plainText, SECItem **cipherText);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
106 SECStatus lg_util_decrypt(SDB *sdbpw,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
107 SECItem *cipherText, SECItem **plainText);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
108 PLHashTable *lg_GetHashTable(SDB *sdb);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
109 void lg_DBLock(SDB *sdb);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
110 void lg_DBUnlock(SDB *sdb);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
111
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
112 typedef void (*LGFreeFunc)(void *);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
113
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
114
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
115 /*
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
116 * database functions
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
117 */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
118
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
119 /* lg_FindObjectsInit initializes a search for token and session objects
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
120 * that match a template. */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
121 CK_RV lg_FindObjectsInit(SDB *sdb, const CK_ATTRIBUTE *pTemplate,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
122 CK_ULONG ulCount, SDBFind **search);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
123 /* lg_FindObjects continues a search for token and session objects
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
124 * that match a template, obtaining additional object handles. */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
125 CK_RV lg_FindObjects(SDB *sdb, SDBFind *search,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
126 CK_OBJECT_HANDLE *phObject,CK_ULONG ulMaxObjectCount,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
127 CK_ULONG *pulObjectCount);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
128
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
129 /* lg_FindObjectsFinal finishes a search for token and session objects. */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
130 CK_RV lg_FindObjectsFinal(SDB* lgdb, SDBFind *search);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
131
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
132 /* lg_CreateObject parses the template and create an object stored in the
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
133 * DB that reflects the object specified in the template. */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
134 CK_RV lg_CreateObject(SDB *sdb, CK_OBJECT_HANDLE *handle,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
135 const CK_ATTRIBUTE *templ, CK_ULONG count);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
136
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
137 CK_RV lg_GetAttributeValue(SDB *sdb, CK_OBJECT_HANDLE object_id,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
138 CK_ATTRIBUTE *template, CK_ULONG count);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
139 CK_RV lg_SetAttributeValue(SDB *sdb, CK_OBJECT_HANDLE object_id,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
140 const CK_ATTRIBUTE *template, CK_ULONG count);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
141 CK_RV lg_DestroyObject(SDB *sdb, CK_OBJECT_HANDLE object_id);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
142
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
143 CK_RV lg_Close(SDB *sdb);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
144 CK_RV lg_Reset(SDB *sdb);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
145
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
146 /*
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
147 * The old database doesn't share and doesn't support
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
148 * transactions.
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
149 */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
150 CK_RV lg_Begin(SDB *sdb);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
151 CK_RV lg_Commit(SDB *sdb);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
152 CK_RV lg_Abort(SDB *sdb);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
153 CK_RV lg_GetMetaData(SDB *sdb, const char *id, SECItem *item1, SECItem *item2);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
154 CK_RV lg_PutMetaData(SDB *sdb, const char *id,
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
155 const SECItem *item1, const SECItem *item2);
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
156
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
157 SEC_END_PROTOS
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
158
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
159 #ifndef XP_UNIX
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
160
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
161 #define NO_FORK_CHECK
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
162
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
163 #endif
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
164
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
165 #ifndef NO_FORK_CHECK
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
166
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
167 extern PRBool lg_parentForkedAfterC_Initialize;
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
168 #define SKIP_AFTER_FORK(x) if (!lg_parentForkedAfterC_Initialize) x
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
169
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
170 #else
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
171
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
172 #define SKIP_AFTER_FORK(x) x
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
173
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
174 #endif /* NO_FORK_CHECK */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
175
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
176 #endif /* _LGDB_H_ */
150b72113545 Add DBM and legacydb support
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
177
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)