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>
11 TPAbstractPluginSession::~TPAbstractPluginSession()
14 static CSSM_RETURN CSSMTPI
cssm_CertReclaimKey(CSSM_TP_HANDLE TPHandle
,
15 const CSSM_CERTGROUP
*CertGroup
,
17 CSSM_LONG_HANDLE KeyCacheHandle
,
18 CSSM_CSP_HANDLE CSPHandle
,
19 const CSSM_RESOURCE_CONTROL_CONTEXT
*CredAndAclEntry
)
22 findSession
<TPPluginSession
>(TPHandle
).CertReclaimKey(Required(CertGroup
),
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
)
36 findSession
<TPPluginSession
>(TPHandle
).CertGroupToTupleGroup(CLHandle
,
38 Required(TupleGroup
));
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
)
49 findSession
<TPPluginSession
>(TPHandle
).CertCreateTemplate(CLHandle
,
52 CssmData::required(CertTemplate
));
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
)
62 findSession
<TPPluginSession
>(TPHandle
).FormRequest(PreferredAuthority
,
64 CssmData::required(BlankForm
));
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
)
78 findSession
<TPPluginSession
>(TPHandle
).CrlSign(CLHandle
,
80 Required(CrlToBeSigned
),
81 Required(SignerCertGroup
),
84 CssmData::required(SignedCrl
));
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
)
94 findSession
<TPPluginSession
>(TPHandle
).TupleGroupToCertGroup(CLHandle
,
96 Required(CertTemplates
));
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
)
107 findSession
<TPPluginSession
>(TPHandle
).CertGetAllTemplateFields(CLHandle
,
108 CssmData::required(CertTemplate
),
109 Required(NumberOfFields
),
110 Required(CertFields
));
114 static CSSM_RETURN CSSMTPI
cssm_CertReclaimAbort(CSSM_TP_HANDLE TPHandle
,
115 CSSM_LONG_HANDLE KeyCacheHandle
)
118 findSession
<TPPluginSession
>(TPHandle
).CertReclaimAbort(KeyCacheHandle
);
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
)
129 findSession
<TPPluginSession
>(TPHandle
).CrlCreateTemplate(CLHandle
,
132 CssmData::required(NewCrlTemplate
));
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
)
145 findSession
<TPPluginSession
>(TPHandle
).CertGroupConstruct(CLHandle
,
149 Required(CertGroupFrag
),
150 Required(CertGroup
));
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
,
163 findSession
<TPPluginSession
>(TPHandle
).PassThrough(CLHandle
,
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
)
180 findSession
<TPPluginSession
>(TPHandle
).RetrieveCredResult(CssmData::required(ReferenceIdentifier
),
181 CallerAuthCredentials
,
182 Required(EstimatedTime
),
183 Required(ConfirmationRequired
),
184 Required(RetrieveOutput
));
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
)
198 findSession
<TPPluginSession
>(TPHandle
).CertSign(CLHandle
,
200 CssmData::required(CertTemplateToBeSigned
),
201 Required(SignerCertGroup
),
204 CssmData::required(SignedCert
));
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
)
216 findSession
<TPPluginSession
>(TPHandle
).FormSubmit(FormType
,
217 CssmData::required(Form
),
219 RepresentedAuthority
,
220 AccessCredentials::optional(Credentials
));
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
)
232 findSession
<TPPluginSession
>(TPHandle
).CertGroupVerify(CLHandle
,
234 Required(CertGroupToBeVerified
),
236 VerifyContextResult
);
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
)
249 findSession
<TPPluginSession
>(TPHandle
).SubmitCredRequest(PreferredAuthority
,
251 Required(RequestInput
),
253 Required(EstimatedTime
),
254 CssmData::required(ReferenceIdentifier
));
258 static CSSM_RETURN CSSMTPI
cssm_ReceiveConfirmation(CSSM_TP_HANDLE TPHandle
,
259 const CSSM_DATA
*ReferenceIdentifier
,
260 CSSM_TP_CONFIRM_RESPONSE_PTR
*Responses
,
264 findSession
<TPPluginSession
>(TPHandle
).ReceiveConfirmation(CssmData::required(ReferenceIdentifier
),
266 Required(ElapsedTime
));
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
)
277 findSession
<TPPluginSession
>(TPHandle
).ConfirmCredResult(CssmData::required(ReferenceIdentifier
),
278 CallerAuthCredentials
,
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
)
293 findSession
<TPPluginSession
>(TPHandle
).CrlVerify(CLHandle
,
295 Required(CrlToBeVerified
),
296 Required(SignerCertGroup
),
298 RevokerVerifyResult
);
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
)
311 findSession
<TPPluginSession
>(TPHandle
).ApplyCrlToDb(CLHandle
,
313 Required(CrlToBeApplied
),
314 Required(SignerCertGroup
),
315 ApplyCrlVerifyContext
,
316 Required(ApplyCrlVerifyResult
));
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
)
327 findSession
<TPPluginSession
>(TPHandle
).CertGroupPrune(CLHandle
,
329 Required(OrderedCertGroup
),
330 Required(PrunedCertGroup
));
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
)
346 findSession
<TPPluginSession
>(TPHandle
).CertRevoke(CLHandle
,
348 CssmData::optional(OldCrlTemplate
),
349 Required(CertGroupToBeRevoked
),
350 Required(RevokerCertGroup
),
351 Required(RevokerVerifyContext
),
352 Required(RevokerVerifyResult
),
354 CssmData::required(NewCrlTemplate
));
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
)
369 findSession
<TPPluginSession
>(TPHandle
).CertRemoveFromCrlTemplate(CLHandle
,
371 CssmData::optional(OldCrlTemplate
),
372 Required(CertGroupToBeRemoved
),
373 Required(RevokerCertGroup
),
374 Required(RevokerVerifyContext
),
375 Required(RevokerVerifyResult
),
376 CssmData::required(NewCrlTemplate
));
381 static const CSSM_SPI_TP_FUNCS TPFunctionStruct
= {
382 cssm_SubmitCredRequest
,
383 cssm_RetrieveCredResult
,
384 cssm_ConfirmCredResult
,
385 cssm_ReceiveConfirmation
,
387 cssm_CertReclaimAbort
,
390 cssm_CertGroupVerify
,
391 cssm_CertCreateTemplate
,
392 cssm_CertGetAllTemplateFields
,
395 cssm_CrlCreateTemplate
,
397 cssm_CertRemoveFromCrlTemplate
,
400 cssm_CertGroupConstruct
,
402 cssm_CertGroupToTupleGroup
,
403 cssm_TupleGroupToCertGroup
,
407 static CSSM_MODULE_FUNCS TPFunctionTable
= {
408 CSSM_SERVICE_TP
, // service type
409 23, // number of functions
410 (const CSSM_PROC_ADDR
*)&TPFunctionStruct
413 CSSM_MODULE_FUNCS_PTR
TPPluginSession::construct()
415 return &TPFunctionTable
;