2 * Copyright (c) 2000-2004,2011,2013-2014 Apple Inc. All Rights Reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
23 * cssmapplePriv.h -- Private CSSM features specific to Apple's Implementation
26 #ifndef _CSSMAPPLE_PRIV_H_
27 #define _CSSMAPPLE_PRIV_H_ 1
29 #include <TargetConditionals.h>
33 #include <Security/cssmtype.h>
34 #include <Security/cssmapple.h>
41 * Options for X509TP's CSSM_TP_CertGroupVerify for policy
42 * CSSMOID_APPLE_TP_REVOCATION_OCSP. A pointer to, and length of, one
43 * of these is optionally placed in
44 * CSSM_TP_VERIFY_CONTEXT.Cred->Policy.PolicyIds[n].FieldValue.
47 #define CSSM_APPLE_TP_OCSP_OPTS_VERSION 0
49 typedef uint32 CSSM_APPLE_TP_OCSP_OPT_FLAGS
;
51 // require OCSP verification for each cert; default is "try"
52 CSSM_TP_ACTION_OCSP_REQUIRE_PER_CERT
= 0x00000001,
53 // require OCSP verification for certs which claim an OCSP responder
54 CSSM_TP_ACTION_OCSP_REQUIRE_IF_RESP_PRESENT
= 0x00000002,
55 // disable network OCSP transactions
56 CSSM_TP_ACTION_OCSP_DISABLE_NET
= 0x00000004,
57 // disable reads from local OCSP cache
58 CSSM_TP_ACTION_OCSP_CACHE_READ_DISABLE
= 0x00000008,
59 // disable reads from local OCSP cache
60 CSSM_TP_ACTION_OCSP_CACHE_WRITE_DISABLE
= 0x00000010,
61 // if set and positive OCSP verify for given cert, no further revocation
62 // checking need be done on that cert
63 CSSM_TP_ACTION_OCSP_SUFFICIENT
= 0x00000020,
64 // generate nonce in OCSP request
65 CSSM_TP_OCSP_GEN_NONCE
= 0x00000040,
66 // when generating nonce, require matching nonce in response
67 CSSM_TP_OCSP_REQUIRE_RESP_NONCE
= 0x00000080
72 CSSM_APPLE_TP_OCSP_OPT_FLAGS Flags
;
73 CSSM_DATA_PTR LocalResponder
; /* URI */
74 CSSM_DATA_PTR LocalResponderCert
; /* X509 DER encoded cert */
75 } CSSM_APPLE_TP_OCSP_OPTIONS
;
79 /* Given a "master" and dependent keychain, make the dependent "syncable" to the master's secrets */
80 CSSM_APPLECSPDL_CSP_RECODE
= CSSM_APPLE_PRIVATE_CSPDL_CODE_8
,
82 /* Given a keychain item, return a record identifier */
83 CSSM_APPLECSPDL_DB_GET_RECORD_IDENTIFIER
= CSSM_APPLE_PRIVATE_CSPDL_CODE_9
,
85 // Get the blob for a database
86 CSSM_APPLECSPDL_DB_COPY_BLOB
= CSSM_APPLE_PRIVATE_CSPDL_CODE_10
,
88 // enforce a bypass of crypto operations on insert
89 CSSM_APPLECSPDL_DB_INSERT_WITHOUT_ENCRYPTION
= CSSM_APPLE_PRIVATE_CSPDL_CODE_11
,
91 // enforce a bypass of crypto operations on modify
92 CSSM_APPLECSPDL_DB_MODIFY_WITHOUT_ENCRYPTION
= CSSM_APPLE_PRIVATE_CSPDL_CODE_12
,
94 // enforce a bypass of crypto operations on get
95 CSSM_APPLECSPDL_DB_GET_WITHOUT_ENCRYPTION
= CSSM_APPLE_PRIVATE_CSPDL_CODE_13
,
97 // convert a record identifier to a CSSM_DB_RECORD_IDENTIFIER for the CSP/DL
98 CSSM_APPLECSPDL_DB_CONVERT_RECORD_IDENTIFIER
= CSSM_APPLE_PRIVATE_CSPDL_CODE_14
,
100 // create the default records in a "blank" database
101 CSSM_APPLECSPDL_DB_CREATE_WITH_BLOB
= CSSM_APPLE_PRIVATE_CSPDL_CODE_15
,
103 // query a DB to see if a relation exists
104 CSSM_APPLECSPDL_DB_RELATION_EXISTS
= CSSM_APPLE_PRIVATE_CSPDL_CODE_16
,
107 CSSM_APPLECSPDL_DB_STASH
= CSSM_APPLE_PRIVATE_CSPDL_CODE_17
,
108 CSSM_APPLECSPDL_DB_STASH_CHECK
= CSSM_APPLE_PRIVATE_CSPDL_CODE_18
,
110 // Ask the CSPDL for its database blob version number.
111 CSSM_APPLECSPDL_DB_GET_BLOB_VERSION
= CSSM_APPLE_PRIVATE_CSPDL_CODE_19
,
113 // Recode this database blob into a new blob version
114 CSSM_APPLECSPDL_DB_RECODE_TO_BLOB_VERSION
= CSSM_APPLE_PRIVATE_CSPDL_CODE_20
,
116 // Try to take the file lock on the underlying database
117 // You should probably be sure that autocommit is off before taking this
118 CSSM_APPLECSPDL_DB_TAKE_FILE_LOCK
= CSSM_APPLE_PRIVATE_CSPDL_CODE_21
,
119 CSSM_APPLECSPDL_DB_RELEASE_FILE_LOCK
= CSSM_APPLE_PRIVATE_CSPDL_CODE_22
,
121 // Make a backup of this database on the filesystem
122 CSSM_APPLECSPDL_DB_MAKE_BACKUP
= CSSM_APPLE_PRIVATE_CSPDL_CODE_23
,
124 // Make a copy of this database on the filesystem
125 CSSM_APPLECSPDL_DB_MAKE_COPY
= CSSM_APPLE_PRIVATE_CSPDL_CODE_24
,
127 // Make a clone of this database on the filesystem, and tell securityd about it
128 CSSM_APPLECSPDL_DB_CLONE
= CSSM_APPLE_PRIVATE_CSPDL_CODE_25
,
130 // Delete the file underlying this database
131 CSSM_APPLECSPDL_DB_DELETE_FILE
= CSSM_APPLE_PRIVATE_CSPDL_CODE_26
,
133 // Recoding of this database is complete
134 CSSM_APPLECSPDL_DB_RECODE_FINISHED
= CSSM_APPLE_PRIVATE_CSPDL_CODE_27
,
137 /* AppleCSPDL passthrough parameters */
138 typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_applecspdl_db_recode_parameters
142 } CSSM_APPLECSPDL_RECODE_PARAMETERS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
, *CSSM_APPLECSPDL_RECODE_PARAMETERS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
144 typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_applecspdl_db_copy_blob_parameters
147 } CSSM_APPLECSPDL_DB_COPY_BLOB_PARAMETERS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
149 typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_applecspdl_db_insert_without_encryption_parameters
151 CSSM_DB_RECORDTYPE recordType
;
152 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR attributes
;
154 } CSSM_APPLECSPDL_DB_INSERT_WITHOUT_ENCRYPTION_PARAMETERS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
156 typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_applecspdl_db_modify_without_encryption_parameters
158 CSSM_DB_RECORDTYPE recordType
;
159 CSSM_DB_UNIQUE_RECORD_PTR uniqueID
;
160 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR attributes
;
162 CSSM_DB_MODIFY_MODE modifyMode
;
163 } CSSM_APPLECSPDL_DB_MODIFY_WITHOUT_ENCRYPTION_PARAMETERS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
165 typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_applecspdl_db_get_without_encryption_parameters
167 CSSM_DB_UNIQUE_RECORD_PTR uniqueID
;
168 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR attributes
;
169 } CSSM_APPLECSPDL_DB_GET_WITHOUT_ENCRYPTION_PARAMETERS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
171 typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_applecspdl_db_create_with_blob_parameters
174 const CSSM_NET_ADDRESS
*dbLocation
;
175 const CSSM_DBINFO
*dbInfo
;
176 CSSM_DB_ACCESS_TYPE accessRequest
;
177 const CSSM_RESOURCE_CONTROL_CONTEXT
*credAndAclEntry
;
178 const void *openParameters
;
179 const CSSM_DATA
*blob
;
180 } CSSM_APPLE_CSPDL_DB_CREATE_WITH_BLOB_PARAMETERS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
186 #endif /* TARGET_OS_OSX */
188 #endif /* _CSSMAPPLE_PRIV_H_ */