]> git.saurik.com Git - apple/security.git/blob - Security/libsecurity_cssm/lib/cssmapplePriv.h
Security-57031.40.6.tar.gz
[apple/security.git] / Security / libsecurity_cssm / lib / cssmapplePriv.h
1 /*
2 * Copyright (c) 2000-2004,2011,2013-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 * cssmapplePriv.h -- Private CSSM features specific to Apple's Implementation
24 */
25
26 #ifndef _CSSMAPPLE_PRIV_H_
27 #define _CSSMAPPLE_PRIV_H_ 1
28
29 #include <Security/cssmtype.h>
30 #include <Security/cssmapple.h>
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 /*
37 * Options for X509TP's CSSM_TP_CertGroupVerify for policy
38 * CSSMOID_APPLE_TP_REVOCATION_OCSP. A pointer to, and length of, one
39 * of these is optionally placed in
40 * CSSM_TP_VERIFY_CONTEXT.Cred->Policy.PolicyIds[n].FieldValue.
41 */
42
43 #define CSSM_APPLE_TP_OCSP_OPTS_VERSION 0
44
45 typedef uint32 CSSM_APPLE_TP_OCSP_OPT_FLAGS;
46 enum {
47 // require OCSP verification for each cert; default is "try"
48 CSSM_TP_ACTION_OCSP_REQUIRE_PER_CERT = 0x00000001,
49 // require OCSP verification for certs which claim an OCSP responder
50 CSSM_TP_ACTION_OCSP_REQUIRE_IF_RESP_PRESENT = 0x00000002,
51 // disable network OCSP transactions
52 CSSM_TP_ACTION_OCSP_DISABLE_NET = 0x00000004,
53 // disable reads from local OCSP cache
54 CSSM_TP_ACTION_OCSP_CACHE_READ_DISABLE = 0x00000008,
55 // disable reads from local OCSP cache
56 CSSM_TP_ACTION_OCSP_CACHE_WRITE_DISABLE = 0x00000010,
57 // if set and positive OCSP verify for given cert, no further revocation
58 // checking need be done on that cert
59 CSSM_TP_ACTION_OCSP_SUFFICIENT = 0x00000020,
60 // generate nonce in OCSP request
61 CSSM_TP_OCSP_GEN_NONCE = 0x00000040,
62 // when generating nonce, require matching nonce in response
63 CSSM_TP_OCSP_REQUIRE_RESP_NONCE = 0x00000080
64 };
65
66 typedef struct {
67 uint32 Version;
68 CSSM_APPLE_TP_OCSP_OPT_FLAGS Flags;
69 CSSM_DATA_PTR LocalResponder; /* URI */
70 CSSM_DATA_PTR LocalResponderCert; /* X509 DER encoded cert */
71 } CSSM_APPLE_TP_OCSP_OPTIONS;
72
73 enum
74 {
75 /* Given a "master" and dependent keychain, make the dependent "syncable" to the master's secrets */
76 CSSM_APPLECSPDL_CSP_RECODE = CSSM_APPLE_PRIVATE_CSPDL_CODE_8,
77
78 /* Given a keychain item, return a record identifier */
79 CSSM_APPLECSPDL_DB_GET_RECORD_IDENTIFIER = CSSM_APPLE_PRIVATE_CSPDL_CODE_9,
80
81 // Get the blob for a database
82 CSSM_APPLECSPDL_DB_COPY_BLOB = CSSM_APPLE_PRIVATE_CSPDL_CODE_10,
83
84 // enforce a bypass of crypto operations on insert
85 CSSM_APPLECSPDL_DB_INSERT_WITHOUT_ENCRYPTION = CSSM_APPLE_PRIVATE_CSPDL_CODE_11,
86
87 // enforce a bypass of crypto operations on modify
88 CSSM_APPLECSPDL_DB_MODIFY_WITHOUT_ENCRYPTION = CSSM_APPLE_PRIVATE_CSPDL_CODE_12,
89
90 // enforce a bypass of crypto operations on get
91 CSSM_APPLECSPDL_DB_GET_WITHOUT_ENCRYPTION = CSSM_APPLE_PRIVATE_CSPDL_CODE_13,
92
93 // convert a record identifier to a CSSM_DB_RECORD_IDENTIFIER for the CSP/DL
94 CSSM_APPLECSPDL_DB_CONVERT_RECORD_IDENTIFIER = CSSM_APPLE_PRIVATE_CSPDL_CODE_14,
95
96 // create the default records in a "blank" database
97 CSSM_APPLECSPDL_DB_CREATE_WITH_BLOB = CSSM_APPLE_PRIVATE_CSPDL_CODE_15,
98
99 // query a DB to see if a relation exists
100 CSSM_APPLECSPDL_DB_RELATION_EXISTS = CSSM_APPLE_PRIVATE_CSPDL_CODE_16,
101
102 // stash a DB key
103 CSSM_APPLECSPDL_DB_STASH = CSSM_APPLE_PRIVATE_CSPDL_CODE_17,
104 CSSM_APPLECSPDL_DB_STASH_CHECK = CSSM_APPLE_PRIVATE_CSPDL_CODE_18
105
106 };
107
108 /* AppleCSPDL passthrough parameters */
109 typedef struct cssm_applecspdl_db_recode_parameters
110 {
111 CSSM_DATA dbBlob;
112 CSSM_DATA extraData;
113 } CSSM_APPLECSPDL_RECODE_PARAMETERS, *CSSM_APPLECSPDL_RECODE_PARAMETERS_PTR;
114
115 typedef struct cssm_applecspdl_db_copy_blob_parameters
116 {
117 CSSM_DATA blob;
118 } CSSM_APPLECSPDL_DB_COPY_BLOB_PARAMETERS;
119
120 typedef struct cssm_applecspdl_db_insert_without_encryption_parameters
121 {
122 CSSM_DB_RECORDTYPE recordType;
123 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR attributes;
124 CSSM_DATA data;
125 } CSSM_APPLECSPDL_DB_INSERT_WITHOUT_ENCRYPTION_PARAMETERS;
126
127 typedef struct cssm_applecspdl_db_modify_without_encryption_parameters
128 {
129 CSSM_DB_RECORDTYPE recordType;
130 CSSM_DB_UNIQUE_RECORD_PTR uniqueID;
131 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR attributes;
132 CSSM_DATA *data;
133 CSSM_DB_MODIFY_MODE modifyMode;
134 } CSSM_APPLECSPDL_DB_MODIFY_WITHOUT_ENCRYPTION_PARAMETERS;
135
136 typedef struct cssm_applecspdl_db_get_without_encryption_parameters
137 {
138 CSSM_DB_UNIQUE_RECORD_PTR uniqueID;
139 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR attributes;
140 } CSSM_APPLECSPDL_DB_GET_WITHOUT_ENCRYPTION_PARAMETERS;
141
142 typedef struct cssm_applecspdl_db_create_with_blob_parameters
143 {
144 const char *dbName;
145 const CSSM_NET_ADDRESS *dbLocation;
146 const CSSM_DBINFO *dbInfo;
147 CSSM_DB_ACCESS_TYPE accessRequest;
148 const CSSM_RESOURCE_CONTROL_CONTEXT *credAndAclEntry;
149 const void *openParameters;
150 const CSSM_DATA *blob;
151 } CSSM_APPLE_CSPDL_DB_CREATE_WITH_BLOB_PARAMETERS;
152
153 #ifdef __cplusplus
154 }
155 #endif
156
157 #endif /* _CSSMAPPLE_PRIV_H_ */