~ubuntu-branches/ubuntu/lucid/nss/lucid-security

« back to all changes in this revision

Viewing changes to mozilla/security/nss/lib/ckfw/dbm/ckdbm.h

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2013-11-15 08:08:08 UTC
  • mfrom: (1.2.7)
  • Revision ID: package-import@ubuntu.com-20131115080808-dba1asgnjl9tc66s
Tags: 3.15.3-0ubuntu0.10.04.1
* SECURITY UPDATE: New upstream release to fix multiple security issues
  and add TLSv1.2 support.
  - CVE-2013-1739
  - CVE-2013-1741
  - CVE-2013-5605
  - CVE-2013-5606
* Adjusted packaging for 3.15.3:
  - debian/patches/*: refreshed.
  - debian/patches/01_dont_build_nspr.patch: removed, changed build
    options in debian/rules instead.
  - debian/libnss3-1d.symbols: added new symbols.
  - debian/rules: updated for new source layout.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
#ifdef DEBUG
6
 
static const char CKDBM_CVS_ID[] = "@(#) $RCSfile: ckdbm.h,v $ $Revision: 1.4 $ $Date: 2012/04/25 14:49:30 $";
7
 
#endif /* DEBUG */
8
 
 
9
 
#ifndef CKDBM_H
10
 
#define CKDBM_H
11
 
 
12
 
#include "nssckmdt.h"
13
 
#include "nssckfw.h"
14
 
 
15
 
/*
16
 
 * I'm including this for access to the arena functions.
17
 
 * Looks like we should publish that API.
18
 
 */
19
 
#ifndef BASE_H
20
 
#include "base.h"
21
 
#endif /* BASE_H */
22
 
 
23
 
/*
24
 
 * This is where the Netscape extensions live, at least for now.
25
 
 */
26
 
#ifndef CKT_H
27
 
#include "ckt.h"
28
 
#endif /* CKT_H */
29
 
 
30
 
#include "mcom_db.h"
31
 
 
32
 
NSS_EXTERN_DATA NSSCKMDInstance nss_dbm_mdInstance;
33
 
 
34
 
typedef struct nss_dbm_db_struct nss_dbm_db_t;
35
 
struct nss_dbm_db_struct {
36
 
  DB *db;
37
 
  NSSCKFWMutex *crustylock;
38
 
};
39
 
 
40
 
typedef struct nss_dbm_dbt_struct nss_dbm_dbt_t;
41
 
struct nss_dbm_dbt_struct {
42
 
  DBT dbt;
43
 
  nss_dbm_db_t *my_db;
44
 
};
45
 
 
46
 
typedef struct nss_dbm_instance_struct nss_dbm_instance_t;
47
 
struct nss_dbm_instance_struct {
48
 
  NSSArena *arena;
49
 
  CK_ULONG nSlots;
50
 
  char **filenames;
51
 
  int *flags; /* e.g. O_RDONLY, O_RDWR */
52
 
};
53
 
 
54
 
typedef struct nss_dbm_slot_struct nss_dbm_slot_t;
55
 
struct nss_dbm_slot_struct {
56
 
  nss_dbm_instance_t *instance;
57
 
  char *filename;
58
 
  int flags;
59
 
  nss_dbm_db_t *token_db;
60
 
};
61
 
 
62
 
typedef struct nss_dbm_token_struct nss_dbm_token_t;
63
 
struct nss_dbm_token_struct {
64
 
  NSSArena *arena;
65
 
  nss_dbm_slot_t *slot;
66
 
  nss_dbm_db_t *session_db;
67
 
  NSSUTF8 *label;
68
 
};
69
 
 
70
 
struct nss_dbm_dbt_node {
71
 
  struct nss_dbm_dbt_node *next;
72
 
  nss_dbm_dbt_t *dbt;
73
 
};
74
 
 
75
 
typedef struct nss_dbm_session_struct nss_dbm_session_t;
76
 
struct nss_dbm_session_struct {
77
 
  NSSArena *arena;
78
 
  nss_dbm_token_t *token;
79
 
  CK_ULONG deviceError;
80
 
  struct nss_dbm_dbt_node *session_objects;
81
 
  NSSCKFWMutex *list_lock;
82
 
};
83
 
 
84
 
typedef struct nss_dbm_object_struct nss_dbm_object_t;
85
 
struct nss_dbm_object_struct {
86
 
  NSSArena *arena; /* token or session */
87
 
  nss_dbm_dbt_t *handle;
88
 
};
89
 
 
90
 
typedef struct nss_dbm_find_struct nss_dbm_find_t;
91
 
struct nss_dbm_find_struct {
92
 
  NSSArena *arena;
93
 
  struct nss_dbm_dbt_node *found;
94
 
  NSSCKFWMutex *list_lock;
95
 
};
96
 
 
97
 
NSS_EXTERN NSSCKMDSlot *
98
 
nss_dbm_mdSlot_factory
99
 
(
100
 
  nss_dbm_instance_t *instance,
101
 
  char *filename,
102
 
  int flags,
103
 
  CK_RV *pError
104
 
);
105
 
 
106
 
NSS_EXTERN NSSCKMDToken *
107
 
nss_dbm_mdToken_factory
108
 
(
109
 
  nss_dbm_slot_t *slot,
110
 
  CK_RV *pError
111
 
);
112
 
 
113
 
NSS_EXTERN NSSCKMDSession *
114
 
nss_dbm_mdSession_factory
115
 
(
116
 
  nss_dbm_token_t *token,
117
 
  NSSCKFWSession *fwSession,
118
 
  NSSCKFWInstance *fwInstance,
119
 
  CK_BBOOL rw,
120
 
  CK_RV *pError
121
 
);
122
 
 
123
 
NSS_EXTERN NSSCKMDObject *
124
 
nss_dbm_mdObject_factory
125
 
(
126
 
  nss_dbm_object_t *object,
127
 
  CK_RV *pError
128
 
);
129
 
 
130
 
NSS_EXTERN NSSCKMDFindObjects *
131
 
nss_dbm_mdFindObjects_factory
132
 
(
133
 
  nss_dbm_find_t *find,
134
 
  CK_RV *pError
135
 
);
136
 
 
137
 
NSS_EXTERN nss_dbm_db_t *
138
 
nss_dbm_db_open
139
 
(
140
 
  NSSArena *arena,
141
 
  NSSCKFWInstance *fwInstance,
142
 
  char *filename,
143
 
  int flags,
144
 
  CK_RV *pError
145
 
);
146
 
 
147
 
NSS_EXTERN void
148
 
nss_dbm_db_close
149
 
(
150
 
  nss_dbm_db_t *db
151
 
);
152
 
 
153
 
NSS_EXTERN CK_VERSION
154
 
nss_dbm_db_get_format_version
155
 
(
156
 
  nss_dbm_db_t *db
157
 
);
158
 
 
159
 
NSS_EXTERN CK_RV
160
 
nss_dbm_db_set_label
161
 
(
162
 
  nss_dbm_db_t *db,
163
 
  NSSUTF8 *label
164
 
);
165
 
 
166
 
NSS_EXTERN NSSUTF8 *
167
 
nss_dbm_db_get_label
168
 
(
169
 
  nss_dbm_db_t *db,
170
 
  NSSArena *arena,
171
 
  CK_RV *pError
172
 
);
173
 
 
174
 
NSS_EXTERN CK_RV
175
 
nss_dbm_db_delete_object
176
 
(
177
 
  nss_dbm_dbt_t *dbt
178
 
);
179
 
 
180
 
NSS_EXTERN nss_dbm_dbt_t *
181
 
nss_dbm_db_create_object
182
 
(
183
 
  NSSArena *arena,
184
 
  nss_dbm_db_t *db,
185
 
  CK_ATTRIBUTE_PTR pTemplate,
186
 
  CK_ULONG ulAttributeCount,
187
 
  CK_RV *pError,
188
 
  CK_ULONG *pdbrv
189
 
);
190
 
 
191
 
NSS_EXTERN CK_RV
192
 
nss_dbm_db_find_objects
193
 
(
194
 
  nss_dbm_find_t *find,
195
 
  nss_dbm_db_t *db,
196
 
  CK_ATTRIBUTE_PTR pTemplate,
197
 
  CK_ULONG ulAttributeCount,
198
 
  CK_ULONG *pdbrv
199
 
);
200
 
 
201
 
NSS_EXTERN CK_BBOOL
202
 
nss_dbm_db_object_still_exists
203
 
(
204
 
  nss_dbm_dbt_t *dbt
205
 
);
206
 
 
207
 
NSS_EXTERN CK_ULONG
208
 
nss_dbm_db_get_object_attribute_count
209
 
(
210
 
  nss_dbm_dbt_t *dbt,
211
 
  CK_RV *pError,
212
 
  CK_ULONG *pdbrv
213
 
);
214
 
 
215
 
NSS_EXTERN CK_RV
216
 
nss_dbm_db_get_object_attribute_types
217
 
(
218
 
  nss_dbm_dbt_t *dbt,
219
 
  CK_ATTRIBUTE_TYPE_PTR typeArray,
220
 
  CK_ULONG ulCount,
221
 
  CK_ULONG *pdbrv
222
 
);
223
 
 
224
 
NSS_EXTERN CK_ULONG
225
 
nss_dbm_db_get_object_attribute_size
226
 
(
227
 
  nss_dbm_dbt_t *dbt,
228
 
  CK_ATTRIBUTE_TYPE type,
229
 
  CK_RV *pError,
230
 
  CK_ULONG *pdbrv
231
 
);
232
 
 
233
 
NSS_EXTERN NSSItem *
234
 
nss_dbm_db_get_object_attribute
235
 
(
236
 
  nss_dbm_dbt_t *dbt,
237
 
  NSSArena *arena,
238
 
  CK_ATTRIBUTE_TYPE type,
239
 
  CK_RV *pError,
240
 
  CK_ULONG *pdbrv
241
 
);
242
 
 
243
 
NSS_EXTERN CK_RV
244
 
nss_dbm_db_set_object_attribute
245
 
(
246
 
  nss_dbm_dbt_t *dbt,
247
 
  CK_ATTRIBUTE_TYPE type,
248
 
  NSSItem *value,
249
 
  CK_ULONG *pdbrv
250
 
);
251
 
 
252
 
#endif /* CKDBM_H */