]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurityd/lib/xdr_cssm.h
Security-59306.101.1.tar.gz
[apple/security.git] / OSX / libsecurityd / lib / xdr_cssm.h
1 /*
2 * Copyright (c) 2006,2011,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 #ifndef _XDR_CSSM_H
25 #define _XDR_CSSM_H
26
27 #include <Security/cssmtype.h>
28 #include "sec_xdr.h"
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 #define xdr_intptr_t xdr_long
35
36 /*
37 * There are a number of types that expand to 64 bit on 64 bit platforms, but clipped to 32 bit across ipc.
38 */
39 bool_t sec_xdr_clip_long(XDR *xdrs, long *objp);
40
41 /*
42 * Some CSSM types have pointers that the remote end of an RPC doesn't care
43 * about, but which must be accounted for during size calculations. We
44 * therefore declare a (void *) XDR handler.
45 */
46 bool_t xdr_voidptr(XDR *xdrs, void **objp);
47
48 #define xdr_uint8 xdr_u_char
49 #define xdr_uint16 xdr_u_int16_t
50 #define xdr_sint32 xdr_int32_t
51 #define xdr_uint32 xdr_u_int32_t
52 #define xdr_CSSM_SIZE sec_xdr_clip_long
53 #define xdr_CSSM_INTPTR sec_xdr_clip_long
54
55 #define xdr_CSSM_HANDLE xdr_CSSM_INTPTR
56 #define xdr_CSSM_MODULE_HANDLE xdr_CSSM_HANDLE
57 #define xdr_CSSM_CSP_HANDLE xdr_CSSM_MODULE_HANDLE
58 #define xdr_CSSM_TP_HANDLE xdr_CSSM_MODULE_HANDLE
59 #define xdr_CSSM_AC_HANDLE xdr_CSSM_MODULE_HANDLE
60 #define xdr_CSSM_CL_HANDLE xdr_CSSM_MODULE_HANDLE
61 #define xdr_CSSM_DL_HANDLE xdr_CSSM_MODULE_HANDLE
62 #define xdr_CSSM_DB_HANDLE xdr_CSSM_MODULE_HANDLE
63 #define xdr_CSSM_ACL_HANDLE xdr_CSSM_HANDLE
64
65 #define xdr_CSSM_BOOL xdr_sint32
66 #define xdr_CSSM_RETURN xdr_sint32
67
68 #define xdr_CSSM_STRING(xdrs, objp) xdr_opaque(xdrs, objp, sizeof(CSSM_STRING))
69
70 #define xdr_CSSM_SERVICE_MASK xdr_uint32
71 #define xdr_CSSM_SERVICE_TYPE xdr_CSSM_SERVICE_MASK
72
73 #define xdr_CSSM_NET_ADDRESS_TYPE xdr_uint32
74
75 #define xdr_CSSM_WORDID_TYPE xdr_sint32
76
77 #define xdr_CSSM_LIST_ELEMENT_TYPE xdr_uint32
78 #define xdr_CSSM_LIST_TYPE xdr_uint32
79
80 #define xdr_CSSM_CERT_TYPE xdr_uint32
81 #define xdr_CSSM_CERT_ENCODING xdr_uint32
82 #define xdr_CSSM_CERT_PARSE_FORMAT xdr_uint32
83
84 #define xdr_CSSM_OID xdr_CSSM_DATA
85
86 #define xdr_CSSM_CERTGROUP_TYPE xdr_uint32
87
88 #define xdr_CSSM_ACL_AUTHORIZATION_TAG xdr_sint32
89
90 #define xdr_CSSM_HEADERVERSION xdr_uint32
91
92 #define xdr_CSSM_KEYBLOB_TYPE xdr_uint32
93 #define xdr_CSSM_KEYBLOB_FORMAT xdr_uint32
94
95 #define xdr_CSSM_KEYCLASS xdr_uint32
96
97 #define xdr_CSSM_KEYATTR_FLAGS xdr_uint32
98
99 #define xdr_CSSM_KEYUSE xdr_uint32
100
101 #define xdr_CSSM_ALGORITHMS xdr_uint32
102
103 #define xdr_CSSM_ENCRYPT_MODE xdr_uint32
104
105 #define xdr_CSSM_CONTEXT_TYPE xdr_uint32
106
107 #define xdr_CSSM_ATTRIBUTE_TYPE xdr_uint32
108
109 #define xdr_CSSM_PADDING xdr_uint32
110
111 #define xdr_CSSM_DB_RECORDTYPE xdr_uint32
112
113 #define xdr_CSSM_DB_ATTRIBUTE_NAME_FORMAT xdr_uint32
114
115 #define xdr_CSSM_DB_ATTRIBUTE_FORMAT xdr_uint32
116
117 #define xdr_CSSM_DB_CONJUNCTIVE xdr_uint32
118
119 #define xdr_CSSM_DB_OPERATOR xdr_uint32
120
121 #define xdr_CSSM_QUERY_FLAGS xdr_uint32
122
123 #define xdr_CSSM_PKCS5_PBKDF2_PRF xdr_uint32
124
125 typedef struct {
126 CSSM_ALGORITHMS algorithm;
127 CSSM_DATA baseData;
128 } CSSM_DERIVE_DATA;
129
130 typedef struct {
131 uint32 count;
132 CSSM_ACL_OWNER_PROTOTYPE *acls;
133 } CSSM_ACL_OWNER_PROTOTYPE_ARRAY;
134
135 typedef struct {
136 uint32 count;
137 CSSM_ACL_ENTRY_INFO *acls;
138 } CSSM_ACL_ENTRY_INFO_ARRAY, *CSSM_ACL_ENTRY_INFO_ARRAY_PTR;
139
140 bool_t xdr_CSSM_DATA(XDR *xdrs, CSSM_DATA *objp);
141 bool_t xdr_CSSM_GUID(XDR *xdrs, CSSM_GUID *objp);
142 bool_t xdr_CSSM_VERSION(XDR *xdrs, CSSM_VERSION *objp);
143 bool_t xdr_CSSM_SUBSERVICE_UID(XDR *xdrs, CSSM_SUBSERVICE_UID *objp);
144 bool_t xdr_CSSM_NET_ADDRESS(XDR *xdrs, CSSM_NET_ADDRESS *objp);
145 bool_t xdr_CSSM_CRYPTO_DATA(XDR *xdrs, CSSM_CRYPTO_DATA *objp);
146 bool_t xdr_CSSM_LIST_ELEMENT(XDR *xdrs, CSSM_LIST_ELEMENT *objp);
147 bool_t xdr_CSSM_LIST(XDR *xdrs, CSSM_LIST *objp);
148 bool_t xdr_CSSM_SAMPLE(XDR *xdrs, CSSM_SAMPLE *objp);
149 bool_t xdr_CSSM_SAMPLEGROUP(XDR *xdrs, CSSM_SAMPLEGROUP *objp);
150 bool_t xdr_CSSM_ENCODED_CERT(XDR *xdrs, CSSM_ENCODED_CERT *objp);
151 bool_t xdr_CSSM_CERTGROUP(XDR *xdrs, CSSM_CERTGROUP *objp);
152 bool_t xdr_CSSM_BASE_CERTS(XDR *xdrs, CSSM_BASE_CERTS *objp);
153 bool_t xdr_CSSM_ACCESS_CREDENTIALS(XDR *xdrs, CSSM_ACCESS_CREDENTIALS *objp);
154 bool_t xdr_CSSM_ACCESS_CREDENTIALS_PTR(XDR *xdrs, CSSM_ACCESS_CREDENTIALS_PTR *objp);
155 bool_t xdr_CSSM_AUTHORIZATIONGROUP(XDR *xdrs, CSSM_AUTHORIZATIONGROUP *objp);
156 bool_t xdr_CSSM_ACL_VALIDITY_PERIOD(XDR *xdrs, CSSM_ACL_VALIDITY_PERIOD *objp);
157 bool_t xdr_CSSM_ACL_ENTRY_PROTOTYPE(XDR *xdrs, CSSM_ACL_ENTRY_PROTOTYPE *objp);
158 bool_t xdr_CSSM_ACL_ENTRY_PROTOTYPE_PTR(XDR *xdrs, CSSM_ACL_ENTRY_PROTOTYPE_PTR *objp);
159 bool_t xdr_CSSM_ACL_OWNER_PROTOTYPE(XDR *xdrs, CSSM_ACL_OWNER_PROTOTYPE *objp);
160 bool_t xdr_CSSM_ACL_OWNER_PROTOTYPE_PTR(XDR *xdrs, CSSM_ACL_OWNER_PROTOTYPE_PTR *objp);
161 bool_t xdr_CSSM_ACL_ENTRY_INPUT(XDR *xdrs, CSSM_ACL_ENTRY_INPUT *objp);
162 bool_t xdr_CSSM_ACL_ENTRY_INPUT_PTR(XDR *xdrs, CSSM_ACL_ENTRY_INPUT_PTR *objp);
163 bool_t xdr_CSSM_ACL_ENTRY_INFO(XDR *xdrs, CSSM_ACL_ENTRY_INFO *objp);
164 bool_t xdr_CSSM_ACL_ENTRY_INFO_ARRAY(XDR *xdrs, CSSM_ACL_ENTRY_INFO_ARRAY *objp);
165 bool_t xdr_CSSM_ACL_ENTRY_INFO_ARRAY_PTR(XDR *xdrs, CSSM_ACL_ENTRY_INFO_ARRAY_PTR *objp);
166 bool_t xdr_CSSM_DATE(XDR *xdrs, CSSM_DATE *objp);
167 bool_t xdr_CSSM_RANGE(XDR *xdrs, CSSM_RANGE *objp);
168 bool_t xdr_CSSM_KEYHEADER(XDR *xdrs, CSSM_KEYHEADER *objp);
169 bool_t xdr_CSSM_KEYHEADER_PTR(XDR *xdrs, CSSM_KEYHEADER_PTR *objp);
170 bool_t xdr_CSSM_KEY(XDR *xdrs, CSSM_KEY *objp);
171 bool_t xdr_CSSM_KEY_PTR(XDR *xdrs, CSSM_KEY_PTR *objp);
172 bool_t xdr_CSSM_POSSIBLY_KEY_IN_DATA_WITH_BOOL(XDR *xdrs, CSSM_DATA *objp, bool_t in_iskey);
173 bool_t xdr_CSSM_POSSIBLY_KEY_IN_DATA(XDR *xdrs, CSSM_DATA *objp);
174 bool_t xdr_CSSM_POSSIBLY_KEY_IN_DATA_PTR(XDR *xdrs, CSSM_DATA_PTR *objp);
175 bool_t xdr_CSSM_KEY_IN_DATA(XDR *xdrs, CSSM_DATA *objp);
176 bool_t xdr_CSSM_NO_KEY_IN_DATA(XDR *xdrs, CSSM_DATA *objp);
177 bool_t xdr_CSSM_DB_ATTRIBUTE_INFO(XDR *xdrs, CSSM_DB_ATTRIBUTE_INFO *objp);
178 bool_t xdr_CSSM_DB_ATTRIBUTE_DATA(XDR *xdrs, CSSM_DB_ATTRIBUTE_DATA *objp);
179 bool_t xdr_CSSM_DB_RECORD_ATTRIBUTE_DATA(XDR *xdrs, CSSM_DB_RECORD_ATTRIBUTE_DATA *objp);
180 bool_t xdr_CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR(XDR *xdrs, CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR *objp);
181 bool_t xdr_CSSM_SELECTION_PREDICATE(XDR *xdrs, CSSM_SELECTION_PREDICATE *objp);
182 bool_t xdr_CSSM_QUERY_LIMITS(XDR *xdrs, CSSM_QUERY_LIMITS *objp);
183 bool_t xdr_CSSM_QUERY(XDR *xdrs, CSSM_QUERY *objp);
184 bool_t xdr_CSSM_QUERY_PTR(XDR *xdrs, CSSM_QUERY_PTR *objp);
185 bool_t xdr_CSSM_CONTEXT_ATTRIBUTE(XDR *xdrs, CSSM_CONTEXT_ATTRIBUTE *objp);
186 bool_t xdr_CSSM_CONTEXT(XDR *xdrs, CSSM_CONTEXT *objp);
187 bool_t xdr_CSSM_CONTEXT_PTR(XDR *xdrs, CSSM_CONTEXT_PTR *objp);
188 bool_t xdr_CSSM_DL_DB_HANDLE(XDR *xdrs, CSSM_DL_DB_HANDLE *objp);
189 bool_t xdr_CSSM_SUBSERVICE_UID(XDR *xdrs, CSSM_SUBSERVICE_UID *objp);
190 bool_t xdr_CSSM_NET_ADDRESS(XDR *xdrs, CSSM_NET_ADDRESS *objp);
191 bool_t xdr_CSSM_PKCS5_PBKDF2_PARAMS(XDR *xdrs, CSSM_PKCS5_PBKDF2_PARAMS *objp);
192 bool_t xdr_CSSM_DERIVE_DATA(XDR *xdrs, CSSM_DERIVE_DATA *objp);
193 bool_t xdr_CSSM_DERIVE_DATA_PTR(XDR *xdrs, CSSM_DERIVE_DATA **objp);
194 bool_t xdr_CSSM_ACL_OWNER_PROTOTYPE_ARRAY(XDR *xdrs, CSSM_ACL_OWNER_PROTOTYPE_ARRAY *objp);
195
196 /*
197 toplevel used converters:
198
199 xdr_CSSM_ACCESS_CREDENTIALS
200 xdr_CSSM_DB_RECORD_ATTRIBUTE_DATA
201 xdr_CSSM_ACCESS_CREDENTIALS
202 xdr_CSSM_ACL_ENTRY_PROTOTYPE
203 xdr_DLDbFlatIdentifier
204 xdr_CSSM_CONTEXT
205 xdr_CSSM_DERIVE_DATA
206 xdr_CSSM_KEY_PTR
207 xdr_CSSM_KEYHEADER_PTR
208
209 not currently used:
210
211 bool_t xdr_CSSM_FIELD(XDR *xdrs, CSSM_FIELD *objp);
212 bool_t xdr_CSSM_FIELDGROUP(XDR *xdrs, CSSM_FIELDGROUP *objp);
213 bool_t xdr_CSSM_TUPLE(XDR *xdrs, CSSM_TUPLE *objp);
214 bool_t xdr_CSSM_PARSED_CERT(XDR *xdrs, CSSM_PARSED_CERT *objp);
215 bool_t xdr_CSSM_CERT_PAIR(XDR *xdrs, CSSM_CERT_PAIR *objp);
216 */
217
218 #ifdef __cplusplus
219 }
220 #endif
221
222 #endif /* !_XDR_CSSM_H */