]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cdsa_plugin/lib/CLabstractsession.cpp
Security-58286.270.3.0.1.tar.gz
[apple/security.git] / OSX / libsecurity_cdsa_plugin / lib / CLabstractsession.cpp
1 //
2 // CL plugin transition layer.
3 // This file was automatically generated. Do not edit on penalty of futility!
4 //
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>
9
10
11 CLAbstractPluginSession::~CLAbstractPluginSession()
12 { /* virtual */ }
13
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,
19 CSSM_DATA_PTR *Value)
20 {
21 BEGIN_API
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;
27 END_API(CL)
28 }
29
30 static CSSM_RETURN CSSMCLI cssm_PassThrough(CSSM_CL_HANDLE CLHandle,
31 CSSM_CC_HANDLE CCHandle,
32 uint32 PassThroughId,
33 const void *InputParams,
34 void **OutputParams)
35 {
36 BEGIN_API
37 findSession<CLPluginSession>(CLHandle).PassThrough(CCHandle,
38 PassThroughId,
39 InputParams,
40 OutputParams);
41 END_API(CL)
42 }
43
44 static CSSM_RETURN CSSMCLI cssm_CertGetNextCachedFieldValue(CSSM_CL_HANDLE CLHandle,
45 CSSM_HANDLE ResultsHandle,
46 CSSM_DATA_PTR *Value)
47 {
48 BEGIN_API
49 if (!findSession<CLPluginSession>(CLHandle).CertGetNextCachedFieldValue(ResultsHandle,
50 Required(Value)))
51 return CSSMERR_CL_NO_FIELD_VALUES;
52 END_API(CL)
53 }
54
55 static CSSM_RETURN CSSMCLI cssm_CrlCreateTemplate(CSSM_CL_HANDLE CLHandle,
56 uint32 NumberOfFields,
57 const CSSM_FIELD *CrlTemplate,
58 CSSM_DATA_PTR NewCrl)
59 {
60 BEGIN_API
61 findSession<CLPluginSession>(CLHandle).CrlCreateTemplate(NumberOfFields,
62 CrlTemplate,
63 CssmData::required(NewCrl));
64 END_API(CL)
65 }
66
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,
71 uint32 ScopeSize,
72 CSSM_DATA_PTR SignedCert)
73 {
74 BEGIN_API
75 findSession<CLPluginSession>(CLHandle).CertSign(CCHandle,
76 CssmData::required(CertTemplate),
77 SignScope,
78 ScopeSize,
79 CssmData::required(SignedCert));
80 END_API(CL)
81 }
82
83 static CSSM_RETURN CSSMCLI cssm_CrlGetFirstFieldValue(CSSM_CL_HANDLE CLHandle,
84 const CSSM_DATA *Crl,
85 const CSSM_OID *CrlField,
86 CSSM_HANDLE_PTR ResultsHandle,
87 uint32 *NumberOfMatchedFields,
88 CSSM_DATA_PTR *Value)
89 {
90 BEGIN_API
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;
96 END_API(CL)
97 }
98
99 static CSSM_RETURN CSSMCLI cssm_CrlGetNextFieldValue(CSSM_CL_HANDLE CLHandle,
100 CSSM_HANDLE ResultsHandle,
101 CSSM_DATA_PTR *Value)
102 {
103 BEGIN_API
104 if (!findSession<CLPluginSession>(CLHandle).CrlGetNextFieldValue(ResultsHandle,
105 Required(Value)))
106 return CSSMERR_CL_NO_FIELD_VALUES;
107 END_API(CL)
108 }
109
110 static CSSM_RETURN CSSMCLI cssm_FreeFields(CSSM_CL_HANDLE CLHandle,
111 uint32 NumberOfFields,
112 CSSM_FIELD_PTR *FieldArray)
113 {
114 BEGIN_API
115 findSession<CLPluginSession>(CLHandle).FreeFields(NumberOfFields,
116 Required(FieldArray));
117 END_API(CL)
118 }
119
120 static CSSM_RETURN CSSMCLI cssm_CrlGetAllFields(CSSM_CL_HANDLE CLHandle,
121 const CSSM_DATA *Crl,
122 uint32 *NumberOfCrlFields,
123 CSSM_FIELD_PTR *CrlFields)
124 {
125 BEGIN_API
126 findSession<CLPluginSession>(CLHandle).CrlGetAllFields(CssmData::required(Crl),
127 Required(NumberOfCrlFields),
128 Required(CrlFields));
129 END_API(CL)
130 }
131
132 static CSSM_RETURN CSSMCLI cssm_CrlAbortCache(CSSM_CL_HANDLE CLHandle,
133 CSSM_HANDLE CrlHandle)
134 {
135 BEGIN_API
136 findSession<CLPluginSession>(CLHandle).CrlAbortCache(CrlHandle);
137 END_API(CL)
138 }
139
140 static CSSM_RETURN CSSMCLI cssm_CertGetAllTemplateFields(CSSM_CL_HANDLE CLHandle,
141 const CSSM_DATA *CertTemplate,
142 uint32 *NumberOfFields,
143 CSSM_FIELD_PTR *CertFields)
144 {
145 BEGIN_API
146 findSession<CLPluginSession>(CLHandle).CertGetAllTemplateFields(CssmData::required(CertTemplate),
147 Required(NumberOfFields),
148 Required(CertFields));
149 END_API(CL)
150 }
151
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)
157 {
158 BEGIN_API
159 findSession<CLPluginSession>(CLHandle).CrlSetFields(NumberOfFields,
160 CrlTemplate,
161 CssmData::required(OldCrl),
162 CssmData::required(ModifiedCrl));
163 END_API(CL)
164 }
165
166 static CSSM_RETURN CSSMCLI cssm_CertGetAllFields(CSSM_CL_HANDLE CLHandle,
167 const CSSM_DATA *Cert,
168 uint32 *NumberOfFields,
169 CSSM_FIELD_PTR *CertFields)
170 {
171 BEGIN_API
172 findSession<CLPluginSession>(CLHandle).CertGetAllFields(CssmData::required(Cert),
173 Required(NumberOfFields),
174 Required(CertFields));
175 END_API(CL)
176 }
177
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)
185 {
186 BEGIN_API
187 findSession<CLPluginSession>(CLHandle).CrlAddCert(CCHandle,
188 CssmData::required(Cert),
189 NumberOfFields,
190 CrlEntryFields,
191 CssmData::required(OldCrl),
192 CssmData::required(NewCrl));
193 END_API(CL)
194 }
195
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)
201 {
202 BEGIN_API
203 findSession<CLPluginSession>(CLHandle).IsCertInCachedCrl(CssmData::required(Cert),
204 CrlHandle,
205 Required(CertFound),
206 CssmData::required(CrlRecordIndex));
207 END_API(CL)
208 }
209
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,
214 uint32 ScopeSize,
215 CSSM_DATA_PTR SignedCrl)
216 {
217 BEGIN_API
218 findSession<CLPluginSession>(CLHandle).CrlSign(CCHandle,
219 CssmData::required(UnsignedCrl),
220 SignScope,
221 ScopeSize,
222 CssmData::required(SignedCrl));
223 END_API(CL)
224 }
225
226 static CSSM_RETURN CSSMCLI cssm_CertAbortQuery(CSSM_CL_HANDLE CLHandle,
227 CSSM_HANDLE ResultsHandle)
228 {
229 BEGIN_API
230 findSession<CLPluginSession>(CLHandle).CertAbortQuery(ResultsHandle);
231 END_API(CL)
232 }
233
234 static CSSM_RETURN CSSMCLI cssm_CertGetNextFieldValue(CSSM_CL_HANDLE CLHandle,
235 CSSM_HANDLE ResultsHandle,
236 CSSM_DATA_PTR *Value)
237 {
238 BEGIN_API
239 if (!findSession<CLPluginSession>(CLHandle).CertGetNextFieldValue(ResultsHandle,
240 Required(Value)))
241 return CSSMERR_CL_NO_FIELD_VALUES;
242 END_API(CL)
243 }
244
245 static CSSM_RETURN CSSMCLI cssm_CertCreateTemplate(CSSM_CL_HANDLE CLHandle,
246 uint32 NumberOfFields,
247 const CSSM_FIELD *CertFields,
248 CSSM_DATA_PTR CertTemplate)
249 {
250 BEGIN_API
251 findSession<CLPluginSession>(CLHandle).CertCreateTemplate(NumberOfFields,
252 CertFields,
253 CssmData::required(CertTemplate));
254 END_API(CL)
255 }
256
257 static CSSM_RETURN CSSMCLI cssm_CertCache(CSSM_CL_HANDLE CLHandle,
258 const CSSM_DATA *Cert,
259 CSSM_HANDLE_PTR CertHandle)
260 {
261 BEGIN_API
262 findSession<CLPluginSession>(CLHandle).CertCache(CssmData::required(Cert),
263 Required(CertHandle));
264 END_API(CL)
265 }
266
267 static CSSM_RETURN CSSMCLI cssm_CrlVerifyWithKey(CSSM_CL_HANDLE CLHandle,
268 CSSM_CC_HANDLE CCHandle,
269 const CSSM_DATA *CrlToBeVerified)
270 {
271 BEGIN_API
272 findSession<CLPluginSession>(CLHandle).CrlVerifyWithKey(CCHandle,
273 CssmData::required(CrlToBeVerified));
274 END_API(CL)
275 }
276
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)
282 {
283 BEGIN_API
284 findSession<CLPluginSession>(CLHandle).CrlGetAllCachedRecordFields(CrlHandle,
285 CssmData::required(CrlRecordIndex),
286 Required(NumberOfFields),
287 Required(CrlFields));
288 END_API(CL)
289 }
290
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)
295 {
296 BEGIN_API
297 findSession<CLPluginSession>(CLHandle).CrlRemoveCert(CssmData::required(Cert),
298 CssmData::required(OldCrl),
299 CssmData::required(NewCrl));
300 END_API(CL)
301 }
302
303 static CSSM_RETURN CSSMCLI cssm_CertVerifyWithKey(CSSM_CL_HANDLE CLHandle,
304 CSSM_CC_HANDLE CCHandle,
305 const CSSM_DATA *CertToBeVerified)
306 {
307 BEGIN_API
308 findSession<CLPluginSession>(CLHandle).CertVerifyWithKey(CCHandle,
309 CssmData::required(CertToBeVerified));
310 END_API(CL)
311 }
312
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)
320 {
321 BEGIN_API
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;
328 END_API(CL)
329 }
330
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)
337 {
338 BEGIN_API
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;
344 END_API(CL)
345 }
346
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,
352 uint32 ScopeSize)
353 {
354 BEGIN_API
355 findSession<CLPluginSession>(CLHandle).CertVerify(CCHandle,
356 CssmData::required(CertToBeVerified),
357 CssmData::optional(SignerCert),
358 VerifyScope,
359 ScopeSize);
360 END_API(CL)
361 }
362
363 static CSSM_RETURN CSSMCLI cssm_CertGetKeyInfo(CSSM_CL_HANDLE CLHandle,
364 const CSSM_DATA *Cert,
365 CSSM_KEY_PTR *Key)
366 {
367 BEGIN_API
368 findSession<CLPluginSession>(CLHandle).CertGetKeyInfo(CssmData::required(Cert),
369 Required(Key));
370 END_API(CL)
371 }
372
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,
378 uint32 ScopeSize)
379 {
380 BEGIN_API
381 findSession<CLPluginSession>(CLHandle).CrlVerify(CCHandle,
382 CssmData::required(CrlToBeVerified),
383 CssmData::optional(SignerCert),
384 VerifyScope,
385 ScopeSize);
386 END_API(CL)
387 }
388
389 static CSSM_RETURN CSSMCLI cssm_CrlDescribeFormat(CSSM_CL_HANDLE CLHandle,
390 uint32 *NumberOfFields,
391 CSSM_OID_PTR *OidList)
392 {
393 BEGIN_API
394 findSession<CLPluginSession>(CLHandle).CrlDescribeFormat(Required(NumberOfFields),
395 Required(OidList));
396 END_API(CL)
397 }
398
399 static CSSM_RETURN CSSMCLI cssm_CrlAbortQuery(CSSM_CL_HANDLE CLHandle,
400 CSSM_HANDLE ResultsHandle)
401 {
402 BEGIN_API
403 findSession<CLPluginSession>(CLHandle).CrlAbortQuery(ResultsHandle);
404 END_API(CL)
405 }
406
407 static CSSM_RETURN CSSMCLI cssm_CertDescribeFormat(CSSM_CL_HANDLE CLHandle,
408 uint32 *NumberOfFields,
409 CSSM_OID_PTR *OidList)
410 {
411 BEGIN_API
412 findSession<CLPluginSession>(CLHandle).CertDescribeFormat(Required(NumberOfFields),
413 Required(OidList));
414 END_API(CL)
415 }
416
417 static CSSM_RETURN CSSMCLI cssm_FreeFieldValue(CSSM_CL_HANDLE CLHandle,
418 const CSSM_OID *CertOrCrlOid,
419 CSSM_DATA_PTR Value)
420 {
421 BEGIN_API
422 findSession<CLPluginSession>(CLHandle).FreeFieldValue(CssmData::required(CertOrCrlOid),
423 CssmData::required(Value));
424 END_API(CL)
425 }
426
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)
432 {
433 BEGIN_API
434 findSession<CLPluginSession>(CLHandle).CertGroupToSignedBundle(CCHandle,
435 Required(CertGroupToBundle),
436 BundleInfo,
437 CssmData::required(SignedBundle));
438 END_API(CL)
439 }
440
441 static CSSM_RETURN CSSMCLI cssm_CertAbortCache(CSSM_CL_HANDLE CLHandle,
442 CSSM_HANDLE CertHandle)
443 {
444 BEGIN_API
445 findSession<CLPluginSession>(CLHandle).CertAbortCache(CertHandle);
446 END_API(CL)
447 }
448
449 static CSSM_RETURN CSSMCLI cssm_CrlCache(CSSM_CL_HANDLE CLHandle,
450 const CSSM_DATA *Crl,
451 CSSM_HANDLE_PTR CrlHandle)
452 {
453 BEGIN_API
454 findSession<CLPluginSession>(CLHandle).CrlCache(CssmData::required(Crl),
455 Required(CrlHandle));
456 END_API(CL)
457 }
458
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)
463 {
464 BEGIN_API
465 findSession<CLPluginSession>(CLHandle).IsCertInCrl(CssmData::required(Cert),
466 CssmData::required(Crl),
467 Required(CertFound));
468 END_API(CL)
469 }
470
471 static CSSM_RETURN CSSMCLI cssm_CrlGetNextCachedFieldValue(CSSM_CL_HANDLE CLHandle,
472 CSSM_HANDLE ResultsHandle,
473 CSSM_DATA_PTR *Value)
474 {
475 BEGIN_API
476 if (!findSession<CLPluginSession>(CLHandle).CrlGetNextCachedFieldValue(ResultsHandle,
477 Required(Value)))
478 return CSSMERR_CL_NO_FIELD_VALUES;
479 END_API(CL)
480 }
481
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)
487 {
488 BEGIN_API
489 findSession<CLPluginSession>(CLHandle).CertGroupFromVerifiedBundle(CCHandle,
490 Required(CertBundle),
491 CssmData::optional(SignerCert),
492 Required(CertGroup));
493 END_API(CL)
494 }
495
496
497 static const CSSM_SPI_CL_FUNCS CLFunctionStruct = {
498 cssm_CertCreateTemplate,
499 cssm_CertGetAllTemplateFields,
500 cssm_CertSign,
501 cssm_CertVerify,
502 cssm_CertVerifyWithKey,
503 cssm_CertGetFirstFieldValue,
504 cssm_CertGetNextFieldValue,
505 cssm_CertAbortQuery,
506 cssm_CertGetKeyInfo,
507 cssm_CertGetAllFields,
508 cssm_FreeFields,
509 cssm_FreeFieldValue,
510 cssm_CertCache,
511 cssm_CertGetFirstCachedFieldValue,
512 cssm_CertGetNextCachedFieldValue,
513 cssm_CertAbortCache,
514 cssm_CertGroupToSignedBundle,
515 cssm_CertGroupFromVerifiedBundle,
516 cssm_CertDescribeFormat,
517 cssm_CrlCreateTemplate,
518 cssm_CrlSetFields,
519 cssm_CrlAddCert,
520 cssm_CrlRemoveCert,
521 cssm_CrlSign,
522 cssm_CrlVerify,
523 cssm_CrlVerifyWithKey,
524 cssm_IsCertInCrl,
525 cssm_CrlGetFirstFieldValue,
526 cssm_CrlGetNextFieldValue,
527 cssm_CrlAbortQuery,
528 cssm_CrlGetAllFields,
529 cssm_CrlCache,
530 cssm_IsCertInCachedCrl,
531 cssm_CrlGetFirstCachedFieldValue,
532 cssm_CrlGetNextCachedFieldValue,
533 cssm_CrlGetAllCachedRecordFields,
534 cssm_CrlAbortCache,
535 cssm_CrlDescribeFormat,
536 cssm_PassThrough,
537 };
538
539 static CSSM_MODULE_FUNCS CLFunctionTable = {
540 CSSM_SERVICE_CL, // service type
541 39, // number of functions
542 (const CSSM_PROC_ADDR *)&CLFunctionStruct
543 };
544
545 CSSM_MODULE_FUNCS_PTR CLPluginSession::construct()
546 {
547 return &CLFunctionTable;
548 }