]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cdsa_plugin/lib/TPabstractsession.cpp
Security-58286.200.222.tar.gz
[apple/security.git] / OSX / libsecurity_cdsa_plugin / lib / TPabstractsession.cpp
1 //
2 // TP plugin transition layer.
3 // This file was automatically generated. Do not edit on penalty of futility!
4 //
5 #include <security_cdsa_plugin/TPsession.h>
6 #include <security_cdsa_plugin/cssmplugin.h>
7 #include <security_cdsa_utilities/cssmbridge.h>
8 #include <Security/cssmtpi.h>
9
10
11 TPAbstractPluginSession::~TPAbstractPluginSession()
12 { /* virtual */ }
13
14 static CSSM_RETURN CSSMTPI cssm_CertReclaimKey(CSSM_TP_HANDLE TPHandle,
15 const CSSM_CERTGROUP *CertGroup,
16 uint32 CertIndex,
17 CSSM_LONG_HANDLE KeyCacheHandle,
18 CSSM_CSP_HANDLE CSPHandle,
19 const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry)
20 {
21 BEGIN_API
22 findSession<TPPluginSession>(TPHandle).CertReclaimKey(Required(CertGroup),
23 CertIndex,
24 KeyCacheHandle,
25 CSPHandle,
26 CredAndAclEntry);
27 END_API(TP)
28 }
29
30 static CSSM_RETURN CSSMTPI cssm_CertGroupToTupleGroup(CSSM_TP_HANDLE TPHandle,
31 CSSM_CL_HANDLE CLHandle,
32 const CSSM_CERTGROUP *CertGroup,
33 CSSM_TUPLEGROUP_PTR *TupleGroup)
34 {
35 BEGIN_API
36 findSession<TPPluginSession>(TPHandle).CertGroupToTupleGroup(CLHandle,
37 Required(CertGroup),
38 Required(TupleGroup));
39 END_API(TP)
40 }
41
42 static CSSM_RETURN CSSMTPI cssm_CertCreateTemplate(CSSM_TP_HANDLE TPHandle,
43 CSSM_CL_HANDLE CLHandle,
44 uint32 NumberOfFields,
45 const CSSM_FIELD *CertFields,
46 CSSM_DATA_PTR CertTemplate)
47 {
48 BEGIN_API
49 findSession<TPPluginSession>(TPHandle).CertCreateTemplate(CLHandle,
50 NumberOfFields,
51 CertFields,
52 CssmData::required(CertTemplate));
53 END_API(TP)
54 }
55
56 static CSSM_RETURN CSSMTPI cssm_FormRequest(CSSM_TP_HANDLE TPHandle,
57 const CSSM_TP_AUTHORITY_ID *PreferredAuthority,
58 CSSM_TP_FORM_TYPE FormType,
59 CSSM_DATA_PTR BlankForm)
60 {
61 BEGIN_API
62 findSession<TPPluginSession>(TPHandle).FormRequest(PreferredAuthority,
63 FormType,
64 CssmData::required(BlankForm));
65 END_API(TP)
66 }
67
68 static CSSM_RETURN CSSMTPI cssm_CrlSign(CSSM_TP_HANDLE TPHandle,
69 CSSM_CL_HANDLE CLHandle,
70 CSSM_CC_HANDLE CCHandle,
71 const CSSM_ENCODED_CRL *CrlToBeSigned,
72 const CSSM_CERTGROUP *SignerCertGroup,
73 const CSSM_TP_VERIFY_CONTEXT *SignerVerifyContext,
74 CSSM_TP_VERIFY_CONTEXT_RESULT_PTR SignerVerifyResult,
75 CSSM_DATA_PTR SignedCrl)
76 {
77 BEGIN_API
78 findSession<TPPluginSession>(TPHandle).CrlSign(CLHandle,
79 CCHandle,
80 Required(CrlToBeSigned),
81 Required(SignerCertGroup),
82 SignerVerifyContext,
83 SignerVerifyResult,
84 CssmData::required(SignedCrl));
85 END_API(TP)
86 }
87
88 static CSSM_RETURN CSSMTPI cssm_TupleGroupToCertGroup(CSSM_TP_HANDLE TPHandle,
89 CSSM_CL_HANDLE CLHandle,
90 const CSSM_TUPLEGROUP *TupleGroup,
91 CSSM_CERTGROUP_PTR *CertTemplates)
92 {
93 BEGIN_API
94 findSession<TPPluginSession>(TPHandle).TupleGroupToCertGroup(CLHandle,
95 Required(TupleGroup),
96 Required(CertTemplates));
97 END_API(TP)
98 }
99
100 static CSSM_RETURN CSSMTPI cssm_CertGetAllTemplateFields(CSSM_TP_HANDLE TPHandle,
101 CSSM_CL_HANDLE CLHandle,
102 const CSSM_DATA *CertTemplate,
103 uint32 *NumberOfFields,
104 CSSM_FIELD_PTR *CertFields)
105 {
106 BEGIN_API
107 findSession<TPPluginSession>(TPHandle).CertGetAllTemplateFields(CLHandle,
108 CssmData::required(CertTemplate),
109 Required(NumberOfFields),
110 Required(CertFields));
111 END_API(TP)
112 }
113
114 static CSSM_RETURN CSSMTPI cssm_CertReclaimAbort(CSSM_TP_HANDLE TPHandle,
115 CSSM_LONG_HANDLE KeyCacheHandle)
116 {
117 BEGIN_API
118 findSession<TPPluginSession>(TPHandle).CertReclaimAbort(KeyCacheHandle);
119 END_API(TP)
120 }
121
122 static CSSM_RETURN CSSMTPI cssm_CrlCreateTemplate(CSSM_TP_HANDLE TPHandle,
123 CSSM_CL_HANDLE CLHandle,
124 uint32 NumberOfFields,
125 const CSSM_FIELD *CrlFields,
126 CSSM_DATA_PTR NewCrlTemplate)
127 {
128 BEGIN_API
129 findSession<TPPluginSession>(TPHandle).CrlCreateTemplate(CLHandle,
130 NumberOfFields,
131 CrlFields,
132 CssmData::required(NewCrlTemplate));
133 END_API(TP)
134 }
135
136 static CSSM_RETURN CSSMTPI cssm_CertGroupConstruct(CSSM_TP_HANDLE TPHandle,
137 CSSM_CL_HANDLE CLHandle,
138 CSSM_CSP_HANDLE CSPHandle,
139 const CSSM_DL_DB_LIST *DBList,
140 const void *ConstructParams,
141 const CSSM_CERTGROUP *CertGroupFrag,
142 CSSM_CERTGROUP_PTR *CertGroup)
143 {
144 BEGIN_API
145 findSession<TPPluginSession>(TPHandle).CertGroupConstruct(CLHandle,
146 CSPHandle,
147 Required(DBList),
148 ConstructParams,
149 Required(CertGroupFrag),
150 Required(CertGroup));
151 END_API(TP)
152 }
153
154 static CSSM_RETURN CSSMTPI cssm_PassThrough(CSSM_TP_HANDLE TPHandle,
155 CSSM_CL_HANDLE CLHandle,
156 CSSM_CC_HANDLE CCHandle,
157 const CSSM_DL_DB_LIST *DBList,
158 uint32 PassThroughId,
159 const void *InputParams,
160 void **OutputParams)
161 {
162 BEGIN_API
163 findSession<TPPluginSession>(TPHandle).PassThrough(CLHandle,
164 CCHandle,
165 DBList,
166 PassThroughId,
167 InputParams,
168 OutputParams);
169 END_API(TP)
170 }
171
172 static CSSM_RETURN CSSMTPI cssm_RetrieveCredResult(CSSM_TP_HANDLE TPHandle,
173 const CSSM_DATA *ReferenceIdentifier,
174 const CSSM_TP_CALLERAUTH_CONTEXT *CallerAuthCredentials,
175 sint32 *EstimatedTime,
176 CSSM_BOOL *ConfirmationRequired,
177 CSSM_TP_RESULT_SET_PTR *RetrieveOutput)
178 {
179 BEGIN_API
180 findSession<TPPluginSession>(TPHandle).RetrieveCredResult(CssmData::required(ReferenceIdentifier),
181 CallerAuthCredentials,
182 Required(EstimatedTime),
183 Required(ConfirmationRequired),
184 Required(RetrieveOutput));
185 END_API(TP)
186 }
187
188 static CSSM_RETURN CSSMTPI cssm_CertSign(CSSM_TP_HANDLE TPHandle,
189 CSSM_CL_HANDLE CLHandle,
190 CSSM_CC_HANDLE CCHandle,
191 const CSSM_DATA *CertTemplateToBeSigned,
192 const CSSM_CERTGROUP *SignerCertGroup,
193 const CSSM_TP_VERIFY_CONTEXT *SignerVerifyContext,
194 CSSM_TP_VERIFY_CONTEXT_RESULT_PTR SignerVerifyResult,
195 CSSM_DATA_PTR SignedCert)
196 {
197 BEGIN_API
198 findSession<TPPluginSession>(TPHandle).CertSign(CLHandle,
199 CCHandle,
200 CssmData::required(CertTemplateToBeSigned),
201 Required(SignerCertGroup),
202 SignerVerifyContext,
203 SignerVerifyResult,
204 CssmData::required(SignedCert));
205 END_API(TP)
206 }
207
208 static CSSM_RETURN CSSMTPI cssm_FormSubmit(CSSM_TP_HANDLE TPHandle,
209 CSSM_TP_FORM_TYPE FormType,
210 const CSSM_DATA *Form,
211 const CSSM_TP_AUTHORITY_ID *ClearanceAuthority,
212 const CSSM_TP_AUTHORITY_ID *RepresentedAuthority,
213 CSSM_ACCESS_CREDENTIALS_PTR Credentials)
214 {
215 BEGIN_API
216 findSession<TPPluginSession>(TPHandle).FormSubmit(FormType,
217 CssmData::required(Form),
218 ClearanceAuthority,
219 RepresentedAuthority,
220 AccessCredentials::optional(Credentials));
221 END_API(TP)
222 }
223
224 static CSSM_RETURN CSSMTPI cssm_CertGroupVerify(CSSM_TP_HANDLE TPHandle,
225 CSSM_CL_HANDLE CLHandle,
226 CSSM_CSP_HANDLE CSPHandle,
227 const CSSM_CERTGROUP *CertGroupToBeVerified,
228 const CSSM_TP_VERIFY_CONTEXT *VerifyContext,
229 CSSM_TP_VERIFY_CONTEXT_RESULT_PTR VerifyContextResult)
230 {
231 BEGIN_API
232 findSession<TPPluginSession>(TPHandle).CertGroupVerify(CLHandle,
233 CSPHandle,
234 Required(CertGroupToBeVerified),
235 VerifyContext,
236 VerifyContextResult);
237 END_API(TP)
238 }
239
240 static CSSM_RETURN CSSMTPI cssm_SubmitCredRequest(CSSM_TP_HANDLE TPHandle,
241 const CSSM_TP_AUTHORITY_ID *PreferredAuthority,
242 CSSM_TP_AUTHORITY_REQUEST_TYPE RequestType,
243 const CSSM_TP_REQUEST_SET *RequestInput,
244 const CSSM_TP_CALLERAUTH_CONTEXT *CallerAuthContext,
245 sint32 *EstimatedTime,
246 CSSM_DATA_PTR ReferenceIdentifier)
247 {
248 BEGIN_API
249 findSession<TPPluginSession>(TPHandle).SubmitCredRequest(PreferredAuthority,
250 RequestType,
251 Required(RequestInput),
252 CallerAuthContext,
253 Required(EstimatedTime),
254 CssmData::required(ReferenceIdentifier));
255 END_API(TP)
256 }
257
258 static CSSM_RETURN CSSMTPI cssm_ReceiveConfirmation(CSSM_TP_HANDLE TPHandle,
259 const CSSM_DATA *ReferenceIdentifier,
260 CSSM_TP_CONFIRM_RESPONSE_PTR *Responses,
261 sint32 *ElapsedTime)
262 {
263 BEGIN_API
264 findSession<TPPluginSession>(TPHandle).ReceiveConfirmation(CssmData::required(ReferenceIdentifier),
265 Required(Responses),
266 Required(ElapsedTime));
267 END_API(TP)
268 }
269
270 static CSSM_RETURN CSSMTPI cssm_ConfirmCredResult(CSSM_TP_HANDLE TPHandle,
271 const CSSM_DATA *ReferenceIdentifier,
272 const CSSM_TP_CALLERAUTH_CONTEXT *CallerAuthCredentials,
273 const CSSM_TP_CONFIRM_RESPONSE *Responses,
274 const CSSM_TP_AUTHORITY_ID *PreferredAuthority)
275 {
276 BEGIN_API
277 findSession<TPPluginSession>(TPHandle).ConfirmCredResult(CssmData::required(ReferenceIdentifier),
278 CallerAuthCredentials,
279 Required(Responses),
280 PreferredAuthority);
281 END_API(TP)
282 }
283
284 static CSSM_RETURN CSSMTPI cssm_CrlVerify(CSSM_TP_HANDLE TPHandle,
285 CSSM_CL_HANDLE CLHandle,
286 CSSM_CSP_HANDLE CSPHandle,
287 const CSSM_ENCODED_CRL *CrlToBeVerified,
288 const CSSM_CERTGROUP *SignerCertGroup,
289 const CSSM_TP_VERIFY_CONTEXT *VerifyContext,
290 CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult)
291 {
292 BEGIN_API
293 findSession<TPPluginSession>(TPHandle).CrlVerify(CLHandle,
294 CSPHandle,
295 Required(CrlToBeVerified),
296 Required(SignerCertGroup),
297 VerifyContext,
298 RevokerVerifyResult);
299 END_API(TP)
300 }
301
302 static CSSM_RETURN CSSMTPI cssm_ApplyCrlToDb(CSSM_TP_HANDLE TPHandle,
303 CSSM_CL_HANDLE CLHandle,
304 CSSM_CSP_HANDLE CSPHandle,
305 const CSSM_ENCODED_CRL *CrlToBeApplied,
306 const CSSM_CERTGROUP *SignerCertGroup,
307 const CSSM_TP_VERIFY_CONTEXT *ApplyCrlVerifyContext,
308 CSSM_TP_VERIFY_CONTEXT_RESULT_PTR ApplyCrlVerifyResult)
309 {
310 BEGIN_API
311 findSession<TPPluginSession>(TPHandle).ApplyCrlToDb(CLHandle,
312 CSPHandle,
313 Required(CrlToBeApplied),
314 Required(SignerCertGroup),
315 ApplyCrlVerifyContext,
316 Required(ApplyCrlVerifyResult));
317 END_API(TP)
318 }
319
320 static CSSM_RETURN CSSMTPI cssm_CertGroupPrune(CSSM_TP_HANDLE TPHandle,
321 CSSM_CL_HANDLE CLHandle,
322 const CSSM_DL_DB_LIST *DBList,
323 const CSSM_CERTGROUP *OrderedCertGroup,
324 CSSM_CERTGROUP_PTR *PrunedCertGroup)
325 {
326 BEGIN_API
327 findSession<TPPluginSession>(TPHandle).CertGroupPrune(CLHandle,
328 Required(DBList),
329 Required(OrderedCertGroup),
330 Required(PrunedCertGroup));
331 END_API(TP)
332 }
333
334 static CSSM_RETURN CSSMTPI cssm_CertRevoke(CSSM_TP_HANDLE TPHandle,
335 CSSM_CL_HANDLE CLHandle,
336 CSSM_CSP_HANDLE CSPHandle,
337 const CSSM_DATA *OldCrlTemplate,
338 const CSSM_CERTGROUP *CertGroupToBeRevoked,
339 const CSSM_CERTGROUP *RevokerCertGroup,
340 const CSSM_TP_VERIFY_CONTEXT *RevokerVerifyContext,
341 CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult,
342 CSSM_TP_CERTCHANGE_REASON Reason,
343 CSSM_DATA_PTR NewCrlTemplate)
344 {
345 BEGIN_API
346 findSession<TPPluginSession>(TPHandle).CertRevoke(CLHandle,
347 CSPHandle,
348 CssmData::optional(OldCrlTemplate),
349 Required(CertGroupToBeRevoked),
350 Required(RevokerCertGroup),
351 Required(RevokerVerifyContext),
352 Required(RevokerVerifyResult),
353 Reason,
354 CssmData::required(NewCrlTemplate));
355 END_API(TP)
356 }
357
358 static CSSM_RETURN CSSMTPI cssm_CertRemoveFromCrlTemplate(CSSM_TP_HANDLE TPHandle,
359 CSSM_CL_HANDLE CLHandle,
360 CSSM_CSP_HANDLE CSPHandle,
361 const CSSM_DATA *OldCrlTemplate,
362 const CSSM_CERTGROUP *CertGroupToBeRemoved,
363 const CSSM_CERTGROUP *RevokerCertGroup,
364 const CSSM_TP_VERIFY_CONTEXT *RevokerVerifyContext,
365 CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult,
366 CSSM_DATA_PTR NewCrlTemplate)
367 {
368 BEGIN_API
369 findSession<TPPluginSession>(TPHandle).CertRemoveFromCrlTemplate(CLHandle,
370 CSPHandle,
371 CssmData::optional(OldCrlTemplate),
372 Required(CertGroupToBeRemoved),
373 Required(RevokerCertGroup),
374 Required(RevokerVerifyContext),
375 Required(RevokerVerifyResult),
376 CssmData::required(NewCrlTemplate));
377 END_API(TP)
378 }
379
380
381 static const CSSM_SPI_TP_FUNCS TPFunctionStruct = {
382 cssm_SubmitCredRequest,
383 cssm_RetrieveCredResult,
384 cssm_ConfirmCredResult,
385 cssm_ReceiveConfirmation,
386 cssm_CertReclaimKey,
387 cssm_CertReclaimAbort,
388 cssm_FormRequest,
389 cssm_FormSubmit,
390 cssm_CertGroupVerify,
391 cssm_CertCreateTemplate,
392 cssm_CertGetAllTemplateFields,
393 cssm_CertSign,
394 cssm_CrlVerify,
395 cssm_CrlCreateTemplate,
396 cssm_CertRevoke,
397 cssm_CertRemoveFromCrlTemplate,
398 cssm_CrlSign,
399 cssm_ApplyCrlToDb,
400 cssm_CertGroupConstruct,
401 cssm_CertGroupPrune,
402 cssm_CertGroupToTupleGroup,
403 cssm_TupleGroupToCertGroup,
404 cssm_PassThrough,
405 };
406
407 static CSSM_MODULE_FUNCS TPFunctionTable = {
408 CSSM_SERVICE_TP, // service type
409 23, // number of functions
410 (const CSSM_PROC_ADDR *)&TPFunctionStruct
411 };
412
413 CSSM_MODULE_FUNCS_PTR TPPluginSession::construct()
414 {
415 return &TPFunctionTable;
416 }