]> git.saurik.com Git - apple/security.git/blob - OSX/sec/securityd/SecItemSchema.c
Security-57336.1.9.tar.gz
[apple/security.git] / OSX / sec / securityd / SecItemSchema.c
1 /*
2 * Copyright (c) 2006-2014 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 /*
25 * SecItemSchema.c - CoreFoundation-based constants and functions for
26 access to Security items (certificates, keys, identities, and
27 passwords.)
28 */
29
30 #include "SecItemSchema.h"
31 #include <securityd/SecDbKeychainItem.h>
32
33 // MARK -
34 // MARK Keychain version 6 schema
35
36 #define __FLAGS(ARG, ...) SECDBFLAGS(__VA_ARGS__)
37 #define SECDBFLAGS(ARG, ...) __FLAGS_##ARG | __FLAGS(__VA_ARGS__)
38
39 #define SecDbFlags(P,L,I,S,A,D,R,C,H,B,Z,E,N,U) (__FLAGS_##P|__FLAGS_##L|__FLAGS_##I|__FLAGS_##S|__FLAGS_##A|__FLAGS_##D|__FLAGS_##R|__FLAGS_##C|__FLAGS_##H|__FLAGS_##B|__FLAGS_##Z|__FLAGS_##E|__FLAGS_##N|__FLAGS_##U)
40
41 #define __FLAGS_ 0
42 #define __FLAGS_P kSecDbPrimaryKeyFlag
43 #define __FLAGS_L kSecDbInFlag
44 #define __FLAGS_I kSecDbIndexFlag
45 #define __FLAGS_S kSecDbSHA1ValueInFlag
46 #define __FLAGS_A kSecDbReturnAttrFlag
47 #define __FLAGS_D kSecDbReturnDataFlag
48 #define __FLAGS_R kSecDbReturnRefFlag
49 #define __FLAGS_C kSecDbInCryptoDataFlag
50 #define __FLAGS_H kSecDbInHashFlag
51 #define __FLAGS_B kSecDbInBackupFlag
52 #define __FLAGS_Z kSecDbDefault0Flag
53 #define __FLAGS_E kSecDbDefaultEmptyFlag
54 #define __FLAGS_N kSecDbNotNullFlag
55 #define __FLAGS_U kSecDbInAuthenticatedDataFlag
56
57 // ,-------------- P : Part of primary key
58 // / ,------------- L : Stored in local database
59 // / / ,------------ I : Attribute wants an index in the database
60 // / / / ,----------- S : SHA1 hashed attribute value in database (implies L)
61 // / / / / ,---------- A : Returned to client as attribute in queries
62 // / / / / / ,--------- D : Returned to client as data in queries
63 // / / / / / / ,-------- R : Returned to client as ref/persistent ref in queries
64 // / / / / / / / ,------- C : Part of encrypted blob
65 // / / / / / / / / ,------ H : Attribute is part of item SHA1 hash (Implied by C)
66 // / / / / / / / / / ,----- B : Attribute is part of iTunes/iCloud backup bag
67 // / / / / / / / / / / ,---- Z : Attribute has a default value of 0
68 // / / / / / / / / / / / ,--- E : Attribute has a default value of "" or empty data
69 // / / / / / / / / / / / / ,-- N : Attribute must have a value
70 // / / / / / / / / / / / / / ,- U : Attribute is stored in authenticated, but not necessarily encrypted data
71 // / / / / / / / / / / / / / /
72 // / / / / / / / / / / / / / /
73 // | | | | | | | | | | | | | |
74 // common to all | | | | | | | | | | | | | |
75 SECDB_ATTR(v6rowid, "rowid", RowId, SecDbFlags( ,L, , , , ,R, , ,B, , , , ), NULL, NULL);
76 SECDB_ATTR(v6cdat, "cdat", CreationDate, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), SecDbKeychainItemCopyCurrentDate, NULL);
77 SECDB_ATTR(v6mdat, "mdat",ModificationDate,SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), SecDbKeychainItemCopyCurrentDate, NULL);
78 SECDB_ATTR(v6labl, "labl", Blob, SecDbFlags( ,L, ,S,A, , ,C,H, , , , , ), NULL, NULL);
79 SECDB_ATTR(v6data, "data", EncryptedData, SecDbFlags( ,L, , , , , , , ,B, , , , ), SecDbKeychainItemCopyEncryptedData, NULL);
80 SECDB_ATTR(v6agrp, "agrp", String, SecDbFlags(P,L, , ,A, , , ,H, , , ,N,U), NULL, NULL);
81 SECDB_ATTR(v6pdmn, "pdmn", Access, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
82 SECDB_ATTR(v6sync, "sync", Sync, SecDbFlags(P,L,I, ,A, , , ,H, ,Z, ,N,U), NULL, NULL);
83 SECDB_ATTR(v6tomb, "tomb", Tomb, SecDbFlags( ,L, , , , , , ,H, ,Z, ,N,U), NULL, NULL);
84 SECDB_ATTR(v6sha1, "sha1", SHA1, SecDbFlags( ,L,I, ,A, ,R, , , , , , , ), SecDbKeychainItemCopySHA1, NULL);
85 SECDB_ATTR(v6accc, "accc", AccessControl, SecDbFlags( , , , ,A, , , , , , , , , ), NULL, NULL);
86 SECDB_ATTR(v6v_Data, "v_Data", Data, SecDbFlags( , , , , ,D, ,C,H, , , , , ), NULL, NULL);
87 SECDB_ATTR(v6v_pk, "v_pk", PrimaryKey, SecDbFlags( , , , , , , , , , , , , , ), SecDbKeychainItemCopyPrimaryKey, NULL);
88 SECDB_ATTR(v7vwht, "vwht", String, SecDbFlags(P,L, , ,A, , , ,H, , , , ,U), NULL, NULL);
89 SECDB_ATTR(v7tkid, "tkid", String, SecDbFlags(P,L, , ,A, , , ,H, , , , ,U), NULL, NULL);
90 SECDB_ATTR(v7utomb, "u_Tomb", UTomb, SecDbFlags( , , , , , , , , , , , , , ), NULL, NULL);
91 // genp and inet and keys | | | | | | | | | | | | | |
92 SECDB_ATTR(v6crtr, "crtr", Number, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
93 SECDB_ATTR(v6alis, "alis", Blob, SecDbFlags( ,L, ,S,A, , ,C,H, , , , , ), NULL, NULL);
94 // genp and inet | | | | | | | | | | | | | |
95 SECDB_ATTR(v6desc, "desc", Blob, SecDbFlags( ,L, ,S,A, , ,C,H, , , , , ), NULL, NULL);
96 SECDB_ATTR(v6icmt, "icmt", Blob, SecDbFlags( ,L, ,S,A, , ,C,H, , , , , ), NULL, NULL);
97 SECDB_ATTR(v6type, "type", Number, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
98 SECDB_ATTR(v6invi, "invi", Number, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
99 SECDB_ATTR(v6nega, "nega", Number, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
100 SECDB_ATTR(v6cusi, "cusi", Number, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
101 SECDB_ATTR(v6prot, "prot", Blob, SecDbFlags( ,L, ,S,A, , ,C,H, , , , , ), NULL, NULL);
102 SECDB_ATTR(v6scrp, "scrp", Number, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
103 SECDB_ATTR(v6acct, "acct", Blob, SecDbFlags(P,L, ,S,A, , ,C,H, , ,E,N, ), NULL, NULL);
104 // genp only | | | | | | | | | | | | | |
105 SECDB_ATTR(v6svce, "svce", Blob, SecDbFlags(P,L, ,S,A, , ,C,H, , ,E,N, ), NULL, NULL);
106 SECDB_ATTR(v6gena, "gena", Blob, SecDbFlags( ,L, ,S,A, , ,C,H, , , , , ), NULL, NULL);
107 // inet only | | | | | | | | | | | | | |
108 SECDB_ATTR(v6sdmn, "sdmn", Blob, SecDbFlags(P,L, ,S,A, , ,C,H, , ,E,N, ), NULL, NULL);
109 SECDB_ATTR(v6srvr, "srvr", Blob, SecDbFlags(P,L, ,S,A, , ,C,H, , ,E,N, ), NULL, NULL);
110 SECDB_ATTR(v6ptcl, "ptcl", Number, SecDbFlags(P,L, , ,A, , ,C,H, ,Z, ,N, ), NULL, NULL);
111 SECDB_ATTR(v6atyp, "atyp", Blob, SecDbFlags(P,L, ,S,A, , ,C,H, , ,E,N, ), NULL, NULL);
112 SECDB_ATTR(v6port, "port", Number, SecDbFlags(P,L, , ,A, , ,C,H, ,Z, ,N, ), NULL, NULL);
113 SECDB_ATTR(v6path, "path", Blob, SecDbFlags(P,L, ,S,A, , ,C,H, , ,E,N, ), NULL, NULL);
114 // cert only | | | | | | | | | | | | | |
115 SECDB_ATTR(v6ctyp, "ctyp", Number, SecDbFlags(P,L, , ,A, , ,C,H, ,Z, ,N, ), NULL, NULL);
116 SECDB_ATTR(v6cenc, "cenc", Number, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
117 SECDB_ATTR(v6subj, "subj", Data, SecDbFlags( ,L,I,S,A, , ,C,H, , , , , ), NULL, NULL);
118 SECDB_ATTR(v6issr, "issr", Data, SecDbFlags(P,L, ,S,A, , ,C,H, , ,E,N, ), NULL, NULL);
119 SECDB_ATTR(v6slnr, "slnr", Data, SecDbFlags(P,L, ,S,A, , ,C,H, , ,E,N, ), NULL, NULL);
120 SECDB_ATTR(v6skid, "skid", Data, SecDbFlags( ,L,I,S,A, , ,C,H, , , , , ), NULL, NULL);
121 SECDB_ATTR(v6pkhh, "pkhh", Data, SecDbFlags( ,L,I, ,A, , ,C,H, , , , , ), NULL, NULL);
122 // cert attributes that share names with common ones but have different flags
123 SECDB_ATTR(v6certalis, "alis", Blob, SecDbFlags( ,L,I,S,A, , ,C,H, , , , , ), NULL, NULL);
124 // keys only | | | | | | | | | | | | | |
125 SECDB_ATTR(v6kcls, "kcls", Number, SecDbFlags(P,L,I,S,A, , ,C,H, ,Z, ,N, ), NULL, NULL);
126 SECDB_ATTR(v6perm, "perm", Number, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
127 SECDB_ATTR(v6priv, "priv", Number, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
128 SECDB_ATTR(v6modi, "modi", Number, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
129 SECDB_ATTR(v6klbl, "klbl", Data, SecDbFlags(P,L,I, ,A, , ,C,H, , ,E,N, ), NULL, NULL);
130 SECDB_ATTR(v6atag, "atag", Blob, SecDbFlags(P,L, ,S,A, , ,C,H, , ,E,N, ), NULL, NULL);
131 SECDB_ATTR(v6bsiz, "bsiz", Number, SecDbFlags(P,L, , ,A, , ,C,H, ,Z, ,N, ), NULL, NULL);
132 SECDB_ATTR(v6esiz, "esiz", Number, SecDbFlags(P,L, , ,A, , ,C,H, ,Z, ,N, ), NULL, NULL);
133 SECDB_ATTR(v6sdat, "sdat", Date, SecDbFlags(P,L, , ,A, , ,C,H, ,Z, ,N, ), NULL, NULL);
134 SECDB_ATTR(v6edat, "edat", Date, SecDbFlags(P,L, , ,A, , ,C,H, ,Z, ,N, ), NULL, NULL);
135 SECDB_ATTR(v6sens, "sens", Number, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
136 SECDB_ATTR(v6asen, "asen", Number, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
137 SECDB_ATTR(v6extr, "extr", Number, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
138 SECDB_ATTR(v6next, "next", Number, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
139 SECDB_ATTR(v6encr, "encr", Number, SecDbFlags( ,L,I, ,A, , ,C,H, , , , , ), NULL, NULL);
140 SECDB_ATTR(v6decr, "decr", Number, SecDbFlags( ,L,I, ,A, , ,C,H, , , , , ), NULL, NULL);
141 SECDB_ATTR(v6drve, "drve", Number, SecDbFlags( ,L,I, ,A, , ,C,H, , , , , ), NULL, NULL);
142 SECDB_ATTR(v6sign, "sign", Number, SecDbFlags( ,L,I, ,A, , ,C,H, , , , , ), NULL, NULL);
143 SECDB_ATTR(v6vrfy, "vrfy", Number, SecDbFlags( ,L,I, ,A, , ,C,H, , , , , ), NULL, NULL);
144 SECDB_ATTR(v6snrc, "snrc", Number, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
145 SECDB_ATTR(v6vyrc, "vyrc", Number, SecDbFlags( ,L, , ,A, , ,C,H, , , , , ), NULL, NULL);
146 SECDB_ATTR(v6wrap, "wrap", Number, SecDbFlags( ,L,I, ,A, , ,C,H, , , , , ), NULL, NULL);
147 SECDB_ATTR(v6unwp, "unwp", Number, SecDbFlags( ,L,I, ,A, , ,C,H, , , , , ), NULL, NULL);
148 // keys attributes that share names with common ones but have different flags
149 SECDB_ATTR(v6keytype, "type", Number, SecDbFlags(P,L, , ,A, , ,C,H, ,Z, ,N, ), NULL, NULL);
150 SECDB_ATTR(v6keycrtr, "crtr", Number, SecDbFlags(P,L, , ,A, , ,C,H, ,Z, ,N, ), NULL, NULL);
151 // | | | | | | | | | | | | | |
152 SECDB_ATTR(v6version, "version", Number, SecDbFlags(P,L, , , , , , , , , , ,N, ), NULL, NULL);
153
154 const SecDbClass genp_class = {
155 .name = CFSTR("genp"),
156 .attrs = {
157 &v6rowid,
158 &v6cdat,
159 &v6mdat,
160 &v6desc,
161 &v6icmt,
162 &v6crtr,
163 &v6type,
164 &v6scrp,
165 &v6labl,
166 &v6alis,
167 &v6invi,
168 &v6nega,
169 &v6cusi,
170 &v6prot,
171 &v6acct,
172 &v6svce,
173 &v6gena,
174 &v6data,
175 &v6agrp,
176 &v6pdmn,
177 &v6sync,
178 &v6tomb,
179 &v6sha1,
180 &v7vwht,
181 &v7tkid,
182 &v6v_Data,
183 &v6v_pk,
184 &v6accc,
185 &v7utomb,
186 0
187 },
188 };
189
190 const SecDbClass inet_class = {
191 .name = CFSTR("inet"),
192 .attrs = {
193 &v6rowid,
194 &v6cdat,
195 &v6mdat,
196 &v6desc,
197 &v6icmt,
198 &v6crtr,
199 &v6type,
200 &v6scrp,
201 &v6labl,
202 &v6alis,
203 &v6invi,
204 &v6nega,
205 &v6cusi,
206 &v6prot,
207 &v6acct,
208 &v6sdmn,
209 &v6srvr,
210 &v6ptcl,
211 &v6atyp,
212 &v6port,
213 &v6path,
214 &v6data,
215 &v6agrp,
216 &v6pdmn,
217 &v6sync,
218 &v6tomb,
219 &v6sha1,
220 &v7vwht,
221 &v7tkid,
222 &v6v_Data,
223 &v6v_pk,
224 &v6accc,
225 &v7utomb,
226 0
227 },
228 };
229
230 const SecDbClass cert_class = {
231 .name = CFSTR("cert"),
232 .attrs = {
233 &v6rowid,
234 &v6cdat,
235 &v6mdat,
236 &v6ctyp,
237 &v6cenc,
238 &v6labl,
239 &v6certalis,
240 &v6subj,
241 &v6issr,
242 &v6slnr,
243 &v6skid,
244 &v6pkhh,
245 &v6data,
246 &v6agrp,
247 &v6pdmn,
248 &v6sync,
249 &v6tomb,
250 &v6sha1,
251 &v7vwht,
252 &v7tkid,
253 &v6v_Data,
254 &v6v_pk,
255 &v6accc,
256 &v7utomb,
257 0
258 },
259 };
260
261 const SecDbClass keys_class = {
262 .name = CFSTR("keys"),
263 .attrs = {
264 &v6rowid,
265 &v6cdat,
266 &v6mdat,
267 &v6kcls,
268 &v6labl,
269 &v6alis,
270 &v6perm,
271 &v6priv,
272 &v6modi,
273 &v6klbl,
274 &v6atag,
275 &v6keycrtr,
276 &v6keytype,
277 &v6bsiz,
278 &v6esiz,
279 &v6sdat,
280 &v6edat,
281 &v6sens,
282 &v6asen,
283 &v6extr,
284 &v6next,
285 &v6encr,
286 &v6decr,
287 &v6drve,
288 &v6sign,
289 &v6vrfy,
290 &v6snrc,
291 &v6vyrc,
292 &v6wrap,
293 &v6unwp,
294 &v6data,
295 &v6agrp,
296 &v6pdmn,
297 &v6sync,
298 &v6tomb,
299 &v6sha1,
300 &v7vwht,
301 &v7tkid,
302 &v6v_Data,
303 &v6v_pk,
304 &v6accc,
305 &v7utomb,
306 0
307 }
308 };
309
310 const SecDbClass tversion_class = {
311 .name = CFSTR("tversion"),
312 .attrs = {
313 &v6version,
314 0
315 }
316 };
317
318 /* An identity which is really a cert + a key, so all cert and keys attrs are
319 allowed. */
320 const SecDbClass identity_class = {
321 .name = CFSTR("idnt"),
322 .attrs = {
323 0
324 },
325 };
326
327 const SecDbSchema v7_schema = {
328 7,
329 .classes = {
330 &genp_class,
331 &inet_class,
332 &cert_class,
333 &keys_class,
334 &tversion_class,
335 0
336 }
337 };
338
339
340 // Version 6 (iOS 7 and OSX 10.9) database schema
341 static const SecDbClass v6genp_class = {
342 .name = CFSTR("genp6"),
343 .attrs = {
344 &v6rowid,
345 &v6cdat,
346 &v6mdat,
347 &v6desc,
348 &v6icmt,
349 &v6crtr,
350 &v6type,
351 &v6scrp,
352 &v6labl,
353 &v6alis,
354 &v6invi,
355 &v6nega,
356 &v6cusi,
357 &v6prot,
358 &v6acct,
359 &v6svce,
360 &v6gena,
361 &v6data,
362 &v6agrp,
363 &v6pdmn,
364 &v6sync,
365 &v6tomb,
366 &v6sha1,
367 &v6v_Data,
368 &v6v_pk,
369 &v6accc,
370 0
371 },
372 };
373
374 static const SecDbClass v6inet_class = {
375 .name = CFSTR("inet6"),
376 .attrs = {
377 &v6rowid,
378 &v6cdat,
379 &v6mdat,
380 &v6desc,
381 &v6icmt,
382 &v6crtr,
383 &v6type,
384 &v6scrp,
385 &v6labl,
386 &v6alis,
387 &v6invi,
388 &v6nega,
389 &v6cusi,
390 &v6prot,
391 &v6acct,
392 &v6sdmn,
393 &v6srvr,
394 &v6ptcl,
395 &v6atyp,
396 &v6port,
397 &v6path,
398 &v6data,
399 &v6agrp,
400 &v6pdmn,
401 &v6sync,
402 &v6tomb,
403 &v6sha1,
404 &v6v_Data,
405 &v6v_pk,
406 &v6accc,
407 0
408 },
409 };
410
411 static const SecDbClass v6cert_class = {
412 .name = CFSTR("cert6"),
413 .attrs = {
414 &v6rowid,
415 &v6cdat,
416 &v6mdat,
417 &v6ctyp,
418 &v6cenc,
419 &v6labl,
420 &v6certalis,
421 &v6subj,
422 &v6issr,
423 &v6slnr,
424 &v6skid,
425 &v6pkhh,
426 &v6data,
427 &v6agrp,
428 &v6pdmn,
429 &v6sync,
430 &v6tomb,
431 &v6sha1,
432 &v6v_Data,
433 &v6v_pk,
434 &v6accc,
435 0
436 },
437 };
438
439 static const SecDbClass v6keys_class = {
440 .name = CFSTR("keys6"),
441 .attrs = {
442 &v6rowid,
443 &v6cdat,
444 &v6mdat,
445 &v6kcls,
446 &v6labl,
447 &v6alis,
448 &v6perm,
449 &v6priv,
450 &v6modi,
451 &v6klbl,
452 &v6atag,
453 &v6keycrtr,
454 &v6keytype,
455 &v6bsiz,
456 &v6esiz,
457 &v6sdat,
458 &v6edat,
459 &v6sens,
460 &v6asen,
461 &v6extr,
462 &v6next,
463 &v6encr,
464 &v6decr,
465 &v6drve,
466 &v6sign,
467 &v6vrfy,
468 &v6snrc,
469 &v6vyrc,
470 &v6wrap,
471 &v6unwp,
472 &v6data,
473 &v6agrp,
474 &v6pdmn,
475 &v6sync,
476 &v6tomb,
477 &v6sha1,
478 &v6v_Data,
479 &v6v_pk,
480 &v6accc,
481 0
482 }
483 };
484
485 static const SecDbSchema v6_schema = {
486 6,
487 .classes = {
488 &v6genp_class,
489 &v6inet_class,
490 &v6cert_class,
491 &v6keys_class,
492 &tversion_class,
493 0
494 }
495 };
496
497
498 // Version 5 (iOS 5 & iOS 6) database schema.
499 static const SecDbClass v5genp_class = {
500 .name = CFSTR("genp5"),
501 .attrs = {
502 &v6rowid,
503 &v6cdat,
504 &v6mdat,
505 &v6desc,
506 &v6icmt,
507 &v6crtr,
508 &v6type,
509 &v6scrp,
510 &v6labl,
511 &v6alis,
512 &v6invi,
513 &v6nega,
514 &v6cusi,
515 &v6prot,
516 &v6acct,
517 &v6svce,
518 &v6gena,
519 &v6data,
520 &v6agrp,
521 &v6pdmn,
522 &v6v_Data,
523 0
524 },
525 };
526
527 static const SecDbClass v5inet_class = {
528 .name = CFSTR("inet5"),
529 .attrs = {
530 &v6rowid,
531 &v6cdat,
532 &v6mdat,
533 &v6desc,
534 &v6icmt,
535 &v6crtr,
536 &v6type,
537 &v6scrp,
538 &v6labl,
539 &v6alis,
540 &v6invi,
541 &v6nega,
542 &v6cusi,
543 &v6prot,
544 &v6acct,
545 &v6sdmn,
546 &v6srvr,
547 &v6ptcl,
548 &v6atyp,
549 &v6port,
550 &v6path,
551 &v6data,
552 &v6agrp,
553 &v6pdmn,
554 &v6v_Data,
555 0
556 },
557 };
558
559 static const SecDbClass v5cert_class = {
560 .name = CFSTR("cert5"),
561 .attrs = {
562 &v6rowid,
563 &v6cdat,
564 &v6mdat,
565 &v6ctyp,
566 &v6cenc,
567 &v6labl,
568 &v6certalis,
569 &v6subj,
570 &v6issr,
571 &v6slnr,
572 &v6skid,
573 &v6pkhh,
574 &v6data,
575 &v6agrp,
576 &v6pdmn,
577 &v6v_Data,
578 0
579 },
580 };
581
582 static const SecDbClass v5keys_class = {
583 .name = CFSTR("keys5"),
584 .attrs = {
585 &v6rowid,
586 &v6cdat,
587 &v6mdat,
588 &v6kcls,
589 &v6labl,
590 &v6alis,
591 &v6perm,
592 &v6priv,
593 &v6modi,
594 &v6klbl,
595 &v6atag,
596 &v6keycrtr,
597 &v6keytype,
598 &v6bsiz,
599 &v6esiz,
600 &v6sdat,
601 &v6edat,
602 &v6sens,
603 &v6asen,
604 &v6extr,
605 &v6next,
606 &v6encr,
607 &v6decr,
608 &v6drve,
609 &v6sign,
610 &v6vrfy,
611 &v6snrc,
612 &v6vyrc,
613 &v6wrap,
614 &v6unwp,
615 &v6data,
616 &v6agrp,
617 &v6pdmn,
618 &v6v_Data,
619 0
620 }
621 };
622
623 static const SecDbSchema v5_schema = {
624 5,
625 .classes = {
626 &v5genp_class,
627 &v5inet_class,
628 &v5cert_class,
629 &v5keys_class,
630 &tversion_class,
631 0
632 }
633 };
634
635 const SecDbSchema *kc_schemas[] = {
636 &v7_schema,
637 &v6_schema,
638 &v5_schema,
639 0
640 };