2 // TP plugin transition layer.
3 // This file was automatically generated. Do not edit on penalty of futility!
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"
12 TPAbstractPluginSession::~TPAbstractPluginSession()
15 static CSSM_RETURN CSSMTPI
cssm_CertReclaimKey(CSSM_TP_HANDLE TPHandle
,
16 const CSSM_CERTGROUP
*CertGroup
,
18 CSSM_LONG_HANDLE KeyCacheHandle
,
19 CSSM_CSP_HANDLE CSPHandle
,
20 const CSSM_RESOURCE_CONTROL_CONTEXT
*CredAndAclEntry
)
23 findSession
<TPPluginSession
>(TPHandle
).CertReclaimKey(Required(CertGroup
),
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
)
37 findSession
<TPPluginSession
>(TPHandle
).CertGroupToTupleGroup(CLHandle
,
39 Required(TupleGroup
));
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
)
50 findSession
<TPPluginSession
>(TPHandle
).CertCreateTemplate(CLHandle
,
53 CssmData::required(CertTemplate
));
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
)
63 findSession
<TPPluginSession
>(TPHandle
).FormRequest(PreferredAuthority
,
65 CssmData::required(BlankForm
));
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
)
79 findSession
<TPPluginSession
>(TPHandle
).CrlSign(CLHandle
,
81 Required(CrlToBeSigned
),
82 Required(SignerCertGroup
),
85 CssmData::required(SignedCrl
));
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
)
95 findSession
<TPPluginSession
>(TPHandle
).TupleGroupToCertGroup(CLHandle
,
97 Required(CertTemplates
));
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
)
108 findSession
<TPPluginSession
>(TPHandle
).CertGetAllTemplateFields(CLHandle
,
109 CssmData::required(CertTemplate
),
110 Required(NumberOfFields
),
111 Required(CertFields
));
115 static CSSM_RETURN CSSMTPI
cssm_CertReclaimAbort(CSSM_TP_HANDLE TPHandle
,
116 CSSM_LONG_HANDLE KeyCacheHandle
)
119 findSession
<TPPluginSession
>(TPHandle
).CertReclaimAbort(KeyCacheHandle
);
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
)
130 findSession
<TPPluginSession
>(TPHandle
).CrlCreateTemplate(CLHandle
,
133 CssmData::required(NewCrlTemplate
));
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
)
146 findSession
<TPPluginSession
>(TPHandle
).CertGroupConstruct(CLHandle
,
150 Required(CertGroupFrag
),
151 Required(CertGroup
));
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
,
164 findSession
<TPPluginSession
>(TPHandle
).PassThrough(CLHandle
,
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
)
181 findSession
<TPPluginSession
>(TPHandle
).RetrieveCredResult(CssmData::required(ReferenceIdentifier
),
182 CallerAuthCredentials
,
183 Required(EstimatedTime
),
184 Required(ConfirmationRequired
),
185 Required(RetrieveOutput
));
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
)
199 findSession
<TPPluginSession
>(TPHandle
).CertSign(CLHandle
,
201 CssmData::required(CertTemplateToBeSigned
),
202 Required(SignerCertGroup
),
205 CssmData::required(SignedCert
));
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
)
217 findSession
<TPPluginSession
>(TPHandle
).FormSubmit(FormType
,
218 CssmData::required(Form
),
220 RepresentedAuthority
,
221 AccessCredentials::optional(Credentials
));
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
)
233 findSession
<TPPluginSession
>(TPHandle
).CertGroupVerify(CLHandle
,
235 Required(CertGroupToBeVerified
),
237 VerifyContextResult
);
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
)
250 findSession
<TPPluginSession
>(TPHandle
).SubmitCredRequest(PreferredAuthority
,
252 Required(RequestInput
),
254 Required(EstimatedTime
),
255 CssmData::required(ReferenceIdentifier
));
259 static CSSM_RETURN CSSMTPI
cssm_ReceiveConfirmation(CSSM_TP_HANDLE TPHandle
,
260 const CSSM_DATA
*ReferenceIdentifier
,
261 CSSM_TP_CONFIRM_RESPONSE_PTR
*Responses
,
265 findSession
<TPPluginSession
>(TPHandle
).ReceiveConfirmation(CssmData::required(ReferenceIdentifier
),
267 Required(ElapsedTime
));
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
)
278 findSession
<TPPluginSession
>(TPHandle
).ConfirmCredResult(CssmData::required(ReferenceIdentifier
),
279 CallerAuthCredentials
,
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
)
294 findSession
<TPPluginSession
>(TPHandle
).CrlVerify(CLHandle
,
296 Required(CrlToBeVerified
),
297 Required(SignerCertGroup
),
299 RevokerVerifyResult
);
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
)
312 findSession
<TPPluginSession
>(TPHandle
).ApplyCrlToDb(CLHandle
,
314 Required(CrlToBeApplied
),
315 Required(SignerCertGroup
),
316 ApplyCrlVerifyContext
,
317 Required(ApplyCrlVerifyResult
));
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
)
328 findSession
<TPPluginSession
>(TPHandle
).CertGroupPrune(CLHandle
,
330 Required(OrderedCertGroup
),
331 Required(PrunedCertGroup
));
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
)
347 findSession
<TPPluginSession
>(TPHandle
).CertRevoke(CLHandle
,
349 CssmData::optional(OldCrlTemplate
),
350 Required(CertGroupToBeRevoked
),
351 Required(RevokerCertGroup
),
352 Required(RevokerVerifyContext
),
353 Required(RevokerVerifyResult
),
355 CssmData::required(NewCrlTemplate
));
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
)
370 findSession
<TPPluginSession
>(TPHandle
).CertRemoveFromCrlTemplate(CLHandle
,
372 CssmData::optional(OldCrlTemplate
),
373 Required(CertGroupToBeRemoved
),
374 Required(RevokerCertGroup
),
375 Required(RevokerVerifyContext
),
376 Required(RevokerVerifyResult
),
377 CssmData::required(NewCrlTemplate
));
382 static const CSSM_SPI_TP_FUNCS TPFunctionStruct
= {
383 cssm_SubmitCredRequest
,
384 cssm_RetrieveCredResult
,
385 cssm_ConfirmCredResult
,
386 cssm_ReceiveConfirmation
,
388 cssm_CertReclaimAbort
,
391 cssm_CertGroupVerify
,
392 cssm_CertCreateTemplate
,
393 cssm_CertGetAllTemplateFields
,
396 cssm_CrlCreateTemplate
,
398 cssm_CertRemoveFromCrlTemplate
,
401 cssm_CertGroupConstruct
,
403 cssm_CertGroupToTupleGroup
,
404 cssm_TupleGroupToCertGroup
,
408 static CSSM_MODULE_FUNCS TPFunctionTable
= {
409 CSSM_SERVICE_TP
, // service type
410 23, // number of functions
411 (const CSSM_PROC_ADDR
*)&TPFunctionStruct
414 CSSM_MODULE_FUNCS_PTR
TPPluginSession::construct()
416 return &TPFunctionTable
;