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