2 // CL plugin transition layer.
3 // This file was automatically generated. Do not edit on penalty of futility!
5 #include <security_cdsa_plugin/CLsession.h>
6 #include <security_cdsa_plugin/cssmplugin.h>
7 #include <security_cdsa_utilities/cssmbridge.h>
8 #include <Security/cssmcli.h>
11 CLAbstractPluginSession::~CLAbstractPluginSession()
14 static CSSM_RETURN CSSMCLI
cssm_CertGetFirstFieldValue(CSSM_CL_HANDLE CLHandle
,
15 const CSSM_DATA
*Cert
,
16 const CSSM_OID
*CertField
,
17 CSSM_HANDLE_PTR ResultsHandle
,
18 uint32
*NumberOfMatchedFields
,
22 if ((Required(ResultsHandle
) = findSession
<CLPluginSession
>(CLHandle
).CertGetFirstFieldValue(CssmData::required(Cert
),
23 CssmData::required(CertField
),
24 Required(NumberOfMatchedFields
),
25 Required(Value
))) == CSSM_INVALID_HANDLE
)
26 return CSSMERR_CL_NO_FIELD_VALUES
;
30 static CSSM_RETURN CSSMCLI
cssm_PassThrough(CSSM_CL_HANDLE CLHandle
,
31 CSSM_CC_HANDLE CCHandle
,
33 const void *InputParams
,
37 findSession
<CLPluginSession
>(CLHandle
).PassThrough(CCHandle
,
44 static CSSM_RETURN CSSMCLI
cssm_CertGetNextCachedFieldValue(CSSM_CL_HANDLE CLHandle
,
45 CSSM_HANDLE ResultsHandle
,
49 if (!findSession
<CLPluginSession
>(CLHandle
).CertGetNextCachedFieldValue(ResultsHandle
,
51 return CSSMERR_CL_NO_FIELD_VALUES
;
55 static CSSM_RETURN CSSMCLI
cssm_CrlCreateTemplate(CSSM_CL_HANDLE CLHandle
,
56 uint32 NumberOfFields
,
57 const CSSM_FIELD
*CrlTemplate
,
61 findSession
<CLPluginSession
>(CLHandle
).CrlCreateTemplate(NumberOfFields
,
63 CssmData::required(NewCrl
));
67 static CSSM_RETURN CSSMCLI
cssm_CertSign(CSSM_CL_HANDLE CLHandle
,
68 CSSM_CC_HANDLE CCHandle
,
69 const CSSM_DATA
*CertTemplate
,
70 const CSSM_FIELD
*SignScope
,
72 CSSM_DATA_PTR SignedCert
)
75 findSession
<CLPluginSession
>(CLHandle
).CertSign(CCHandle
,
76 CssmData::required(CertTemplate
),
79 CssmData::required(SignedCert
));
83 static CSSM_RETURN CSSMCLI
cssm_CrlGetFirstFieldValue(CSSM_CL_HANDLE CLHandle
,
85 const CSSM_OID
*CrlField
,
86 CSSM_HANDLE_PTR ResultsHandle
,
87 uint32
*NumberOfMatchedFields
,
91 if ((Required(ResultsHandle
) = findSession
<CLPluginSession
>(CLHandle
).CrlGetFirstFieldValue(CssmData::required(Crl
),
92 CssmData::required(CrlField
),
93 Required(NumberOfMatchedFields
),
94 Required(Value
))) == CSSM_INVALID_HANDLE
)
95 return CSSMERR_CL_NO_FIELD_VALUES
;
99 static CSSM_RETURN CSSMCLI
cssm_CrlGetNextFieldValue(CSSM_CL_HANDLE CLHandle
,
100 CSSM_HANDLE ResultsHandle
,
101 CSSM_DATA_PTR
*Value
)
104 if (!findSession
<CLPluginSession
>(CLHandle
).CrlGetNextFieldValue(ResultsHandle
,
106 return CSSMERR_CL_NO_FIELD_VALUES
;
110 static CSSM_RETURN CSSMCLI
cssm_FreeFields(CSSM_CL_HANDLE CLHandle
,
111 uint32 NumberOfFields
,
112 CSSM_FIELD_PTR
*FieldArray
)
115 findSession
<CLPluginSession
>(CLHandle
).FreeFields(NumberOfFields
,
116 Required(FieldArray
));
120 static CSSM_RETURN CSSMCLI
cssm_CrlGetAllFields(CSSM_CL_HANDLE CLHandle
,
121 const CSSM_DATA
*Crl
,
122 uint32
*NumberOfCrlFields
,
123 CSSM_FIELD_PTR
*CrlFields
)
126 findSession
<CLPluginSession
>(CLHandle
).CrlGetAllFields(CssmData::required(Crl
),
127 Required(NumberOfCrlFields
),
128 Required(CrlFields
));
132 static CSSM_RETURN CSSMCLI
cssm_CrlAbortCache(CSSM_CL_HANDLE CLHandle
,
133 CSSM_HANDLE CrlHandle
)
136 findSession
<CLPluginSession
>(CLHandle
).CrlAbortCache(CrlHandle
);
140 static CSSM_RETURN CSSMCLI
cssm_CertGetAllTemplateFields(CSSM_CL_HANDLE CLHandle
,
141 const CSSM_DATA
*CertTemplate
,
142 uint32
*NumberOfFields
,
143 CSSM_FIELD_PTR
*CertFields
)
146 findSession
<CLPluginSession
>(CLHandle
).CertGetAllTemplateFields(CssmData::required(CertTemplate
),
147 Required(NumberOfFields
),
148 Required(CertFields
));
152 static CSSM_RETURN CSSMCLI
cssm_CrlSetFields(CSSM_CL_HANDLE CLHandle
,
153 uint32 NumberOfFields
,
154 const CSSM_FIELD
*CrlTemplate
,
155 const CSSM_DATA
*OldCrl
,
156 CSSM_DATA_PTR ModifiedCrl
)
159 findSession
<CLPluginSession
>(CLHandle
).CrlSetFields(NumberOfFields
,
161 CssmData::required(OldCrl
),
162 CssmData::required(ModifiedCrl
));
166 static CSSM_RETURN CSSMCLI
cssm_CertGetAllFields(CSSM_CL_HANDLE CLHandle
,
167 const CSSM_DATA
*Cert
,
168 uint32
*NumberOfFields
,
169 CSSM_FIELD_PTR
*CertFields
)
172 findSession
<CLPluginSession
>(CLHandle
).CertGetAllFields(CssmData::required(Cert
),
173 Required(NumberOfFields
),
174 Required(CertFields
));
178 static CSSM_RETURN CSSMCLI
cssm_CrlAddCert(CSSM_CL_HANDLE CLHandle
,
179 CSSM_CC_HANDLE CCHandle
,
180 const CSSM_DATA
*Cert
,
181 uint32 NumberOfFields
,
182 const CSSM_FIELD
*CrlEntryFields
,
183 const CSSM_DATA
*OldCrl
,
184 CSSM_DATA_PTR NewCrl
)
187 findSession
<CLPluginSession
>(CLHandle
).CrlAddCert(CCHandle
,
188 CssmData::required(Cert
),
191 CssmData::required(OldCrl
),
192 CssmData::required(NewCrl
));
196 static CSSM_RETURN CSSMCLI
cssm_IsCertInCachedCrl(CSSM_CL_HANDLE CLHandle
,
197 const CSSM_DATA
*Cert
,
198 CSSM_HANDLE CrlHandle
,
199 CSSM_BOOL
*CertFound
,
200 CSSM_DATA_PTR CrlRecordIndex
)
203 findSession
<CLPluginSession
>(CLHandle
).IsCertInCachedCrl(CssmData::required(Cert
),
206 CssmData::required(CrlRecordIndex
));
210 static CSSM_RETURN CSSMCLI
cssm_CrlSign(CSSM_CL_HANDLE CLHandle
,
211 CSSM_CC_HANDLE CCHandle
,
212 const CSSM_DATA
*UnsignedCrl
,
213 const CSSM_FIELD
*SignScope
,
215 CSSM_DATA_PTR SignedCrl
)
218 findSession
<CLPluginSession
>(CLHandle
).CrlSign(CCHandle
,
219 CssmData::required(UnsignedCrl
),
222 CssmData::required(SignedCrl
));
226 static CSSM_RETURN CSSMCLI
cssm_CertAbortQuery(CSSM_CL_HANDLE CLHandle
,
227 CSSM_HANDLE ResultsHandle
)
230 findSession
<CLPluginSession
>(CLHandle
).CertAbortQuery(ResultsHandle
);
234 static CSSM_RETURN CSSMCLI
cssm_CertGetNextFieldValue(CSSM_CL_HANDLE CLHandle
,
235 CSSM_HANDLE ResultsHandle
,
236 CSSM_DATA_PTR
*Value
)
239 if (!findSession
<CLPluginSession
>(CLHandle
).CertGetNextFieldValue(ResultsHandle
,
241 return CSSMERR_CL_NO_FIELD_VALUES
;
245 static CSSM_RETURN CSSMCLI
cssm_CertCreateTemplate(CSSM_CL_HANDLE CLHandle
,
246 uint32 NumberOfFields
,
247 const CSSM_FIELD
*CertFields
,
248 CSSM_DATA_PTR CertTemplate
)
251 findSession
<CLPluginSession
>(CLHandle
).CertCreateTemplate(NumberOfFields
,
253 CssmData::required(CertTemplate
));
257 static CSSM_RETURN CSSMCLI
cssm_CertCache(CSSM_CL_HANDLE CLHandle
,
258 const CSSM_DATA
*Cert
,
259 CSSM_HANDLE_PTR CertHandle
)
262 findSession
<CLPluginSession
>(CLHandle
).CertCache(CssmData::required(Cert
),
263 Required(CertHandle
));
267 static CSSM_RETURN CSSMCLI
cssm_CrlVerifyWithKey(CSSM_CL_HANDLE CLHandle
,
268 CSSM_CC_HANDLE CCHandle
,
269 const CSSM_DATA
*CrlToBeVerified
)
272 findSession
<CLPluginSession
>(CLHandle
).CrlVerifyWithKey(CCHandle
,
273 CssmData::required(CrlToBeVerified
));
277 static CSSM_RETURN CSSMCLI
cssm_CrlGetAllCachedRecordFields(CSSM_CL_HANDLE CLHandle
,
278 CSSM_HANDLE CrlHandle
,
279 const CSSM_DATA
*CrlRecordIndex
,
280 uint32
*NumberOfFields
,
281 CSSM_FIELD_PTR
*CrlFields
)
284 findSession
<CLPluginSession
>(CLHandle
).CrlGetAllCachedRecordFields(CrlHandle
,
285 CssmData::required(CrlRecordIndex
),
286 Required(NumberOfFields
),
287 Required(CrlFields
));
291 static CSSM_RETURN CSSMCLI
cssm_CrlRemoveCert(CSSM_CL_HANDLE CLHandle
,
292 const CSSM_DATA
*Cert
,
293 const CSSM_DATA
*OldCrl
,
294 CSSM_DATA_PTR NewCrl
)
297 findSession
<CLPluginSession
>(CLHandle
).CrlRemoveCert(CssmData::required(Cert
),
298 CssmData::required(OldCrl
),
299 CssmData::required(NewCrl
));
303 static CSSM_RETURN CSSMCLI
cssm_CertVerifyWithKey(CSSM_CL_HANDLE CLHandle
,
304 CSSM_CC_HANDLE CCHandle
,
305 const CSSM_DATA
*CertToBeVerified
)
308 findSession
<CLPluginSession
>(CLHandle
).CertVerifyWithKey(CCHandle
,
309 CssmData::required(CertToBeVerified
));
313 static CSSM_RETURN CSSMCLI
cssm_CrlGetFirstCachedFieldValue(CSSM_CL_HANDLE CLHandle
,
314 CSSM_HANDLE CrlHandle
,
315 const CSSM_DATA
*CrlRecordIndex
,
316 const CSSM_OID
*CrlField
,
317 CSSM_HANDLE_PTR ResultsHandle
,
318 uint32
*NumberOfMatchedFields
,
319 CSSM_DATA_PTR
*Value
)
322 if ((Required(ResultsHandle
) = findSession
<CLPluginSession
>(CLHandle
).CrlGetFirstCachedFieldValue(CrlHandle
,
323 CssmData::optional(CrlRecordIndex
),
324 CssmData::required(CrlField
),
325 Required(NumberOfMatchedFields
),
326 Required(Value
))) == CSSM_INVALID_HANDLE
)
327 return CSSMERR_CL_NO_FIELD_VALUES
;
331 static CSSM_RETURN CSSMCLI
cssm_CertGetFirstCachedFieldValue(CSSM_CL_HANDLE CLHandle
,
332 CSSM_HANDLE CertHandle
,
333 const CSSM_OID
*CertField
,
334 CSSM_HANDLE_PTR ResultsHandle
,
335 uint32
*NumberOfMatchedFields
,
336 CSSM_DATA_PTR
*Value
)
339 if ((Required(ResultsHandle
) = findSession
<CLPluginSession
>(CLHandle
).CertGetFirstCachedFieldValue(CertHandle
,
340 CssmData::required(CertField
),
341 Required(NumberOfMatchedFields
),
342 Required(Value
))) == CSSM_INVALID_HANDLE
)
343 return CSSMERR_CL_NO_FIELD_VALUES
;
347 static CSSM_RETURN CSSMCLI
cssm_CertVerify(CSSM_CL_HANDLE CLHandle
,
348 CSSM_CC_HANDLE CCHandle
,
349 const CSSM_DATA
*CertToBeVerified
,
350 const CSSM_DATA
*SignerCert
,
351 const CSSM_FIELD
*VerifyScope
,
355 findSession
<CLPluginSession
>(CLHandle
).CertVerify(CCHandle
,
356 CssmData::required(CertToBeVerified
),
357 CssmData::optional(SignerCert
),
363 static CSSM_RETURN CSSMCLI
cssm_CertGetKeyInfo(CSSM_CL_HANDLE CLHandle
,
364 const CSSM_DATA
*Cert
,
368 findSession
<CLPluginSession
>(CLHandle
).CertGetKeyInfo(CssmData::required(Cert
),
373 static CSSM_RETURN CSSMCLI
cssm_CrlVerify(CSSM_CL_HANDLE CLHandle
,
374 CSSM_CC_HANDLE CCHandle
,
375 const CSSM_DATA
*CrlToBeVerified
,
376 const CSSM_DATA
*SignerCert
,
377 const CSSM_FIELD
*VerifyScope
,
381 findSession
<CLPluginSession
>(CLHandle
).CrlVerify(CCHandle
,
382 CssmData::required(CrlToBeVerified
),
383 CssmData::optional(SignerCert
),
389 static CSSM_RETURN CSSMCLI
cssm_CrlDescribeFormat(CSSM_CL_HANDLE CLHandle
,
390 uint32
*NumberOfFields
,
391 CSSM_OID_PTR
*OidList
)
394 findSession
<CLPluginSession
>(CLHandle
).CrlDescribeFormat(Required(NumberOfFields
),
399 static CSSM_RETURN CSSMCLI
cssm_CrlAbortQuery(CSSM_CL_HANDLE CLHandle
,
400 CSSM_HANDLE ResultsHandle
)
403 findSession
<CLPluginSession
>(CLHandle
).CrlAbortQuery(ResultsHandle
);
407 static CSSM_RETURN CSSMCLI
cssm_CertDescribeFormat(CSSM_CL_HANDLE CLHandle
,
408 uint32
*NumberOfFields
,
409 CSSM_OID_PTR
*OidList
)
412 findSession
<CLPluginSession
>(CLHandle
).CertDescribeFormat(Required(NumberOfFields
),
417 static CSSM_RETURN CSSMCLI
cssm_FreeFieldValue(CSSM_CL_HANDLE CLHandle
,
418 const CSSM_OID
*CertOrCrlOid
,
422 findSession
<CLPluginSession
>(CLHandle
).FreeFieldValue(CssmData::required(CertOrCrlOid
),
423 CssmData::required(Value
));
427 static CSSM_RETURN CSSMCLI
cssm_CertGroupToSignedBundle(CSSM_CL_HANDLE CLHandle
,
428 CSSM_CC_HANDLE CCHandle
,
429 const CSSM_CERTGROUP
*CertGroupToBundle
,
430 const CSSM_CERT_BUNDLE_HEADER
*BundleInfo
,
431 CSSM_DATA_PTR SignedBundle
)
434 findSession
<CLPluginSession
>(CLHandle
).CertGroupToSignedBundle(CCHandle
,
435 Required(CertGroupToBundle
),
437 CssmData::required(SignedBundle
));
441 static CSSM_RETURN CSSMCLI
cssm_CertAbortCache(CSSM_CL_HANDLE CLHandle
,
442 CSSM_HANDLE CertHandle
)
445 findSession
<CLPluginSession
>(CLHandle
).CertAbortCache(CertHandle
);
449 static CSSM_RETURN CSSMCLI
cssm_CrlCache(CSSM_CL_HANDLE CLHandle
,
450 const CSSM_DATA
*Crl
,
451 CSSM_HANDLE_PTR CrlHandle
)
454 findSession
<CLPluginSession
>(CLHandle
).CrlCache(CssmData::required(Crl
),
455 Required(CrlHandle
));
459 static CSSM_RETURN CSSMCLI
cssm_IsCertInCrl(CSSM_CL_HANDLE CLHandle
,
460 const CSSM_DATA
*Cert
,
461 const CSSM_DATA
*Crl
,
462 CSSM_BOOL
*CertFound
)
465 findSession
<CLPluginSession
>(CLHandle
).IsCertInCrl(CssmData::required(Cert
),
466 CssmData::required(Crl
),
467 Required(CertFound
));
471 static CSSM_RETURN CSSMCLI
cssm_CrlGetNextCachedFieldValue(CSSM_CL_HANDLE CLHandle
,
472 CSSM_HANDLE ResultsHandle
,
473 CSSM_DATA_PTR
*Value
)
476 if (!findSession
<CLPluginSession
>(CLHandle
).CrlGetNextCachedFieldValue(ResultsHandle
,
478 return CSSMERR_CL_NO_FIELD_VALUES
;
482 static CSSM_RETURN CSSMCLI
cssm_CertGroupFromVerifiedBundle(CSSM_CL_HANDLE CLHandle
,
483 CSSM_CC_HANDLE CCHandle
,
484 const CSSM_CERT_BUNDLE
*CertBundle
,
485 const CSSM_DATA
*SignerCert
,
486 CSSM_CERTGROUP_PTR
*CertGroup
)
489 findSession
<CLPluginSession
>(CLHandle
).CertGroupFromVerifiedBundle(CCHandle
,
490 Required(CertBundle
),
491 CssmData::optional(SignerCert
),
492 Required(CertGroup
));
497 static const CSSM_SPI_CL_FUNCS CLFunctionStruct
= {
498 cssm_CertCreateTemplate
,
499 cssm_CertGetAllTemplateFields
,
502 cssm_CertVerifyWithKey
,
503 cssm_CertGetFirstFieldValue
,
504 cssm_CertGetNextFieldValue
,
507 cssm_CertGetAllFields
,
511 cssm_CertGetFirstCachedFieldValue
,
512 cssm_CertGetNextCachedFieldValue
,
514 cssm_CertGroupToSignedBundle
,
515 cssm_CertGroupFromVerifiedBundle
,
516 cssm_CertDescribeFormat
,
517 cssm_CrlCreateTemplate
,
523 cssm_CrlVerifyWithKey
,
525 cssm_CrlGetFirstFieldValue
,
526 cssm_CrlGetNextFieldValue
,
528 cssm_CrlGetAllFields
,
530 cssm_IsCertInCachedCrl
,
531 cssm_CrlGetFirstCachedFieldValue
,
532 cssm_CrlGetNextCachedFieldValue
,
533 cssm_CrlGetAllCachedRecordFields
,
535 cssm_CrlDescribeFormat
,
539 static CSSM_MODULE_FUNCS CLFunctionTable
= {
540 CSSM_SERVICE_CL
, // service type
541 39, // number of functions
542 (const CSSM_PROC_ADDR
*)&CLFunctionStruct
545 CSSM_MODULE_FUNCS_PTR
CLPluginSession::construct()
547 return &CLFunctionTable
;