2 // CSP plugin transition layer.
3 // This file was automatically generated. Do not edit on penalty of futility!
5 #include <security_cdsa_plugin/CSPsession.h>
6 #include <security_cdsa_plugin/cssmplugin.h>
7 #include <security_cdsa_utilities/cssmbridge.h>
8 #include <Security/cssmcspi.h>
9 // The disclaimer up top used to be true but rdar://24426719 removed libsecurity_cdsa_plugin_generate
10 #include "LegacyAPICounts.h"
12 CSPAbstractPluginSession::~CSPAbstractPluginSession()
15 static CSSM_RETURN CSSMCSPI
cssm_ObtainPrivateKeyFromPublicKey(CSSM_CSP_HANDLE CSPHandle
,
16 const CSSM_KEY
*PublicKey
,
17 CSSM_KEY_PTR PrivateKey
)
20 findSession
<CSPPluginSession
>(CSPHandle
).ObtainPrivateKeyFromPublicKey(CssmKey::required(PublicKey
),
21 CssmKey::required(PrivateKey
));
25 static CSSM_RETURN CSSMCSPI
cssm_GetOperationalStatistics(CSSM_CSP_HANDLE CSPHandle
,
26 CSSM_CSP_OPERATIONAL_STATISTICS
*Statistics
)
29 findSession
<CSPPluginSession
>(CSPHandle
).GetOperationalStatistics(CSPOperationalStatistics::required(Statistics
));
33 static CSSM_RETURN CSSMCSPI
cssm_ChangeLoginOwner(CSSM_CSP_HANDLE CSPHandle
,
34 const CSSM_ACCESS_CREDENTIALS
*AccessCred
,
35 const CSSM_ACL_OWNER_PROTOTYPE
*NewOwner
)
38 findSession
<CSPPluginSession
>(CSPHandle
).ChangeLoginOwner(AccessCredentials::required(AccessCred
),
43 static CSSM_RETURN CSSMCSPI
cssm_EventNotify(CSSM_CSP_HANDLE CSPHandle
,
44 CSSM_CONTEXT_EVENT Event
,
45 CSSM_CC_HANDLE CCHandle
,
46 const CSSM_CONTEXT
*Context
)
49 findSession
<CSPPluginSession
>(CSPHandle
).EventNotify(Event
,
51 Context::required(Context
));
55 static CSSM_RETURN CSSMCSPI
cssm_DecryptDataInit(CSSM_CSP_HANDLE CSPHandle
,
56 CSSM_CC_HANDLE CCHandle
,
57 const CSSM_CONTEXT
*Context
,
58 CSSM_PRIVILEGE Privilege
)
61 findSession
<CSPPluginSession
>(CSPHandle
).DecryptDataInit(CCHandle
,
62 Context::required(Context
),
67 static CSSM_RETURN CSSMCSPI
cssm_SignDataInit(CSSM_CSP_HANDLE CSPHandle
,
68 CSSM_CC_HANDLE CCHandle
,
69 const CSSM_CONTEXT
*Context
)
72 findSession
<CSPPluginSession
>(CSPHandle
).SignDataInit(CCHandle
,
73 Context::required(Context
));
77 static CSSM_RETURN CSSMCSPI
cssm_DigestData(CSSM_CSP_HANDLE CSPHandle
,
78 CSSM_CC_HANDLE CCHandle
,
79 const CSSM_CONTEXT
*Context
,
80 const CSSM_DATA
*DataBufs
,
85 findSession
<CSPPluginSession
>(CSPHandle
).DigestData(CCHandle
,
86 Context::required(Context
),
87 &CssmData::required(DataBufs
),
89 CssmData::required(Digest
));
93 static CSSM_RETURN CSSMCSPI
cssm_GetKeyOwner(CSSM_CSP_HANDLE CSPHandle
,
95 CSSM_ACL_OWNER_PROTOTYPE_PTR Owner
)
98 findSession
<CSPPluginSession
>(CSPHandle
).GetKeyOwner(CssmKey::required(Key
),
103 static CSSM_RETURN CSSMCSPI
cssm_GetLoginAcl(CSSM_CSP_HANDLE CSPHandle
,
104 const CSSM_STRING
*SelectionTag
,
105 uint32
*NumberOfAclInfos
,
106 CSSM_ACL_ENTRY_INFO_PTR
*AclInfos
)
109 findSession
<CSPPluginSession
>(CSPHandle
).GetLoginAcl(SelectionTag
,
110 Required(NumberOfAclInfos
),
115 static CSSM_RETURN CSSMCSPI
cssm_VerifyMac(CSSM_CSP_HANDLE CSPHandle
,
116 CSSM_CC_HANDLE CCHandle
,
117 const CSSM_CONTEXT
*Context
,
118 const CSSM_DATA
*DataBufs
,
120 const CSSM_DATA
*Mac
)
123 findSession
<CSPPluginSession
>(CSPHandle
).VerifyMac(CCHandle
,
124 Context::required(Context
),
125 &CssmData::required(DataBufs
),
127 CssmData::required(Mac
));
131 static CSSM_RETURN CSSMCSPI
cssm_SignDataFinal(CSSM_CSP_HANDLE CSPHandle
,
132 CSSM_CC_HANDLE CCHandle
,
133 CSSM_DATA_PTR Signature
)
136 findSession
<CSPPluginSession
>(CSPHandle
).SignDataFinal(CCHandle
,
137 CssmData::required(Signature
));
141 static CSSM_RETURN CSSMCSPI
cssm_VerifyDataUpdate(CSSM_CSP_HANDLE CSPHandle
,
142 CSSM_CC_HANDLE CCHandle
,
143 const CSSM_DATA
*DataBufs
,
147 findSession
<CSPPluginSession
>(CSPHandle
).VerifyDataUpdate(CCHandle
,
148 &CssmData::required(DataBufs
),
153 static CSSM_RETURN CSSMCSPI
cssm_GenerateMac(CSSM_CSP_HANDLE CSPHandle
,
154 CSSM_CC_HANDLE CCHandle
,
155 const CSSM_CONTEXT
*Context
,
156 const CSSM_DATA
*DataBufs
,
161 findSession
<CSPPluginSession
>(CSPHandle
).GenerateMac(CCHandle
,
162 Context::required(Context
),
163 &CssmData::required(DataBufs
),
165 CssmData::required(Mac
));
169 static CSSM_RETURN CSSMCSPI
cssm_VerifyMacFinal(CSSM_CSP_HANDLE CSPHandle
,
170 CSSM_CC_HANDLE CCHandle
,
171 const CSSM_DATA
*Mac
)
174 findSession
<CSPPluginSession
>(CSPHandle
).VerifyMacFinal(CCHandle
,
175 CssmData::required(Mac
));
179 static CSSM_RETURN CSSMCSPI
cssm_GenerateRandom(CSSM_CSP_HANDLE CSPHandle
,
180 CSSM_CC_HANDLE CCHandle
,
181 const CSSM_CONTEXT
*Context
,
182 CSSM_DATA_PTR RandomNumber
)
185 findSession
<CSPPluginSession
>(CSPHandle
).GenerateRandom(CCHandle
,
186 Context::required(Context
),
187 CssmData::required(RandomNumber
));
191 static CSSM_RETURN CSSMCSPI
cssm_RetrieveUniqueId(CSSM_CSP_HANDLE CSPHandle
,
192 CSSM_DATA_PTR UniqueID
)
195 findSession
<CSPPluginSession
>(CSPHandle
).RetrieveUniqueId(CssmData::required(UniqueID
));
199 static CSSM_RETURN CSSMCSPI
cssm_UnwrapKey(CSSM_CSP_HANDLE CSPHandle
,
200 CSSM_CC_HANDLE CCHandle
,
201 const CSSM_CONTEXT
*Context
,
202 const CSSM_KEY
*PublicKey
,
203 const CSSM_WRAP_KEY
*WrappedKey
,
206 const CSSM_DATA
*KeyLabel
,
207 const CSSM_RESOURCE_CONTROL_CONTEXT
*CredAndAclEntry
,
208 CSSM_KEY_PTR UnwrappedKey
,
209 CSSM_DATA_PTR DescriptiveData
,
210 CSSM_PRIVILEGE Privilege
)
213 findSession
<CSPPluginSession
>(CSPHandle
).UnwrapKey(CCHandle
,
214 Context::required(Context
),
215 CssmKey::optional(PublicKey
),
216 CssmKey::required(WrappedKey
),
219 CssmData::optional(KeyLabel
),
221 CssmKey::required(UnwrappedKey
),
222 CssmData::required(DescriptiveData
),
227 static CSSM_RETURN CSSMCSPI
cssm_GenerateMacFinal(CSSM_CSP_HANDLE CSPHandle
,
228 CSSM_CC_HANDLE CCHandle
,
232 findSession
<CSPPluginSession
>(CSPHandle
).GenerateMacFinal(CCHandle
,
233 CssmData::required(Mac
));
237 static CSSM_RETURN CSSMCSPI
cssm_WrapKey(CSSM_CSP_HANDLE CSPHandle
,
238 CSSM_CC_HANDLE CCHandle
,
239 const CSSM_CONTEXT
*Context
,
240 const CSSM_ACCESS_CREDENTIALS
*AccessCred
,
242 const CSSM_DATA
*DescriptiveData
,
243 CSSM_WRAP_KEY_PTR WrappedKey
,
244 CSSM_PRIVILEGE Privilege
)
247 findSession
<CSPPluginSession
>(CSPHandle
).WrapKey(CCHandle
,
248 Context::required(Context
),
249 AccessCredentials::required(AccessCred
),
250 CssmKey::required(Key
),
251 CssmData::optional(DescriptiveData
),
252 CssmKey::required(WrappedKey
),
257 static CSSM_RETURN CSSMCSPI
cssm_DecryptDataFinal(CSSM_CSP_HANDLE CSPHandle
,
258 CSSM_CC_HANDLE CCHandle
,
259 CSSM_DATA_PTR RemData
)
262 findSession
<CSPPluginSession
>(CSPHandle
).DecryptDataFinal(CCHandle
,
263 CssmData::required(RemData
));
267 static CSSM_RETURN CSSMCSPI
cssm_SignData(CSSM_CSP_HANDLE CSPHandle
,
268 CSSM_CC_HANDLE CCHandle
,
269 const CSSM_CONTEXT
*Context
,
270 const CSSM_DATA
*DataBufs
,
272 CSSM_ALGORITHMS DigestAlgorithm
,
273 CSSM_DATA_PTR Signature
)
276 findSession
<CSPPluginSession
>(CSPHandle
).SignData(CCHandle
,
277 Context::required(Context
),
278 &CssmData::required(DataBufs
),
281 CssmData::required(Signature
));
285 static CSSM_RETURN CSSMCSPI
cssm_EncryptDataInit(CSSM_CSP_HANDLE CSPHandle
,
286 CSSM_CC_HANDLE CCHandle
,
287 const CSSM_CONTEXT
*Context
,
288 CSSM_PRIVILEGE Privilege
)
291 findSession
<CSPPluginSession
>(CSPHandle
).EncryptDataInit(CCHandle
,
292 Context::required(Context
),
297 static CSSM_RETURN CSSMCSPI
cssm_VerifyData(CSSM_CSP_HANDLE CSPHandle
,
298 CSSM_CC_HANDLE CCHandle
,
299 const CSSM_CONTEXT
*Context
,
300 const CSSM_DATA
*DataBufs
,
302 CSSM_ALGORITHMS DigestAlgorithm
,
303 const CSSM_DATA
*Signature
)
306 findSession
<CSPPluginSession
>(CSPHandle
).VerifyData(CCHandle
,
307 Context::required(Context
),
308 &CssmData::required(DataBufs
),
311 CssmData::required(Signature
));
315 static CSSM_RETURN CSSMCSPI
cssm_GenerateMacUpdate(CSSM_CSP_HANDLE CSPHandle
,
316 CSSM_CC_HANDLE CCHandle
,
317 const CSSM_DATA
*DataBufs
,
321 findSession
<CSPPluginSession
>(CSPHandle
).GenerateMacUpdate(CCHandle
,
322 &CssmData::required(DataBufs
),
327 static CSSM_RETURN CSSMCSPI
cssm_EncryptDataFinal(CSSM_CSP_HANDLE CSPHandle
,
328 CSSM_CC_HANDLE CCHandle
,
329 CSSM_DATA_PTR RemData
)
332 findSession
<CSPPluginSession
>(CSPHandle
).EncryptDataFinal(CCHandle
,
333 CssmData::required(RemData
));
337 static CSSM_RETURN CSSMCSPI
cssm_ChangeKeyOwner(CSSM_CSP_HANDLE CSPHandle
,
338 const CSSM_ACCESS_CREDENTIALS
*AccessCred
,
340 const CSSM_ACL_OWNER_PROTOTYPE
*NewOwner
)
343 findSession
<CSPPluginSession
>(CSPHandle
).ChangeKeyOwner(AccessCredentials::required(AccessCred
),
344 CssmKey::required(Key
),
349 static CSSM_RETURN CSSMCSPI
cssm_VerifyMacInit(CSSM_CSP_HANDLE CSPHandle
,
350 CSSM_CC_HANDLE CCHandle
,
351 const CSSM_CONTEXT
*Context
)
354 findSession
<CSPPluginSession
>(CSPHandle
).VerifyMacInit(CCHandle
,
355 Context::required(Context
));
359 static CSSM_RETURN CSSMCSPI
cssm_DigestDataClone(CSSM_CSP_HANDLE CSPHandle
,
360 CSSM_CC_HANDLE CCHandle
,
361 CSSM_CC_HANDLE ClonedCCHandle
)
364 findSession
<CSPPluginSession
>(CSPHandle
).DigestDataClone(CCHandle
,
369 static CSSM_RETURN CSSMCSPI
cssm_VerifyDataInit(CSSM_CSP_HANDLE CSPHandle
,
370 CSSM_CC_HANDLE CCHandle
,
371 const CSSM_CONTEXT
*Context
)
374 findSession
<CSPPluginSession
>(CSPHandle
).VerifyDataInit(CCHandle
,
375 Context::required(Context
));
379 static CSSM_RETURN CSSMCSPI
cssm_DecryptDataUpdate(CSSM_CSP_HANDLE CSPHandle
,
380 CSSM_CC_HANDLE CCHandle
,
381 const CSSM_DATA
*CipherBufs
,
382 uint32 CipherBufCount
,
383 CSSM_DATA_PTR ClearBufs
,
384 uint32 ClearBufCount
,
385 CSSM_SIZE
*bytesDecrypted
)
388 findSession
<CSPPluginSession
>(CSPHandle
).DecryptDataUpdate(CCHandle
,
389 &CssmData::required(CipherBufs
),
391 &CssmData::required(ClearBufs
),
393 Required(bytesDecrypted
));
397 static CSSM_RETURN CSSMCSPI
cssm_GenerateAlgorithmParams(CSSM_CSP_HANDLE CSPHandle
,
398 CSSM_CC_HANDLE CCHandle
,
399 const CSSM_CONTEXT
*Context
,
402 uint32
*NumberOfUpdatedAttibutes
,
403 CSSM_CONTEXT_ATTRIBUTE_PTR
*UpdatedAttributes
)
406 findSession
<CSPPluginSession
>(CSPHandle
).GenerateAlgorithmParams(CCHandle
,
407 Context::required(Context
),
409 CssmData::required(Param
),
410 Required(NumberOfUpdatedAttibutes
),
411 Required(UpdatedAttributes
));
415 static CSSM_RETURN CSSMCSPI
cssm_GetLoginOwner(CSSM_CSP_HANDLE CSPHandle
,
416 CSSM_ACL_OWNER_PROTOTYPE_PTR Owner
)
419 findSession
<CSPPluginSession
>(CSPHandle
).GetLoginOwner(Required(Owner
));
423 static CSSM_RETURN CSSMCSPI
cssm_GetKeyAcl(CSSM_CSP_HANDLE CSPHandle
,
425 const CSSM_STRING
*SelectionTag
,
426 uint32
*NumberOfAclInfos
,
427 CSSM_ACL_ENTRY_INFO_PTR
*AclInfos
)
430 findSession
<CSPPluginSession
>(CSPHandle
).GetKeyAcl(CssmKey::required(Key
),
432 Required(NumberOfAclInfos
),
437 static CSSM_RETURN CSSMCSPI
cssm_VerifyDevice(CSSM_CSP_HANDLE CSPHandle
,
438 const CSSM_DATA
*DeviceCert
)
441 findSession
<CSPPluginSession
>(CSPHandle
).VerifyDevice(CssmData::required(DeviceCert
));
445 static CSSM_RETURN CSSMCSPI
cssm_EncryptDataUpdate(CSSM_CSP_HANDLE CSPHandle
,
446 CSSM_CC_HANDLE CCHandle
,
447 const CSSM_DATA
*ClearBufs
,
448 uint32 ClearBufCount
,
449 CSSM_DATA_PTR CipherBufs
,
450 uint32 CipherBufCount
,
451 CSSM_SIZE
*bytesEncrypted
)
454 findSession
<CSPPluginSession
>(CSPHandle
).EncryptDataUpdate(CCHandle
,
455 &CssmData::required(ClearBufs
),
457 &CssmData::required(CipherBufs
),
459 Required(bytesEncrypted
));
463 static CSSM_RETURN CSSMCSPI
cssm_DigestDataFinal(CSSM_CSP_HANDLE CSPHandle
,
464 CSSM_CC_HANDLE CCHandle
,
465 CSSM_DATA_PTR Digest
)
468 findSession
<CSPPluginSession
>(CSPHandle
).DigestDataFinal(CCHandle
,
469 CssmData::required(Digest
));
473 static CSSM_RETURN CSSMCSPI
cssm_Login(CSSM_CSP_HANDLE CSPHandle
,
474 const CSSM_ACCESS_CREDENTIALS
*AccessCred
,
475 const CSSM_DATA
*LoginName
,
476 const void *Reserved
)
479 findSession
<CSPPluginSession
>(CSPHandle
).Login(AccessCredentials::required(AccessCred
),
480 CssmData::optional(LoginName
),
485 static CSSM_RETURN CSSMCSPI
cssm_ChangeKeyAcl(CSSM_CSP_HANDLE CSPHandle
,
486 const CSSM_ACCESS_CREDENTIALS
*AccessCred
,
487 const CSSM_ACL_EDIT
*AclEdit
,
491 findSession
<CSPPluginSession
>(CSPHandle
).ChangeKeyAcl(AccessCredentials::required(AccessCred
),
493 CssmKey::required(Key
));
497 static CSSM_RETURN CSSMCSPI
cssm_SignDataUpdate(CSSM_CSP_HANDLE CSPHandle
,
498 CSSM_CC_HANDLE CCHandle
,
499 const CSSM_DATA
*DataBufs
,
503 findSession
<CSPPluginSession
>(CSPHandle
).SignDataUpdate(CCHandle
,
504 &CssmData::required(DataBufs
),
509 static CSSM_RETURN CSSMCSPI
cssm_QueryKeySizeInBits(CSSM_CSP_HANDLE CSPHandle
,
510 CSSM_CC_HANDLE CCHandle
,
511 const CSSM_CONTEXT
*Context
,
513 CSSM_KEY_SIZE_PTR KeySize
)
516 findSession
<CSPPluginSession
>(CSPHandle
).QueryKeySizeInBits(CCHandle
,
517 Context::optional(Context
),
518 CssmKey::optional(Key
),
523 static CSSM_RETURN CSSMCSPI
cssm_Logout(CSSM_CSP_HANDLE CSPHandle
)
526 findSession
<CSPPluginSession
>(CSPHandle
).Logout();
530 static CSSM_RETURN CSSMCSPI
cssm_DecryptData(CSSM_CSP_HANDLE CSPHandle
,
531 CSSM_CC_HANDLE CCHandle
,
532 const CSSM_CONTEXT
*Context
,
533 const CSSM_DATA
*CipherBufs
,
534 uint32 CipherBufCount
,
535 CSSM_DATA_PTR ClearBufs
,
536 uint32 ClearBufCount
,
537 CSSM_SIZE
*bytesDecrypted
,
538 CSSM_DATA_PTR RemData
,
539 CSSM_PRIVILEGE Privilege
)
542 findSession
<CSPPluginSession
>(CSPHandle
).DecryptData(CCHandle
,
543 Context::required(Context
),
544 &CssmData::required(CipherBufs
),
546 &CssmData::required(ClearBufs
),
548 Required(bytesDecrypted
),
549 CssmData::required(RemData
),
554 static CSSM_RETURN CSSMCSPI
cssm_DigestDataInit(CSSM_CSP_HANDLE CSPHandle
,
555 CSSM_CC_HANDLE CCHandle
,
556 const CSSM_CONTEXT
*Context
)
559 findSession
<CSPPluginSession
>(CSPHandle
).DigestDataInit(CCHandle
,
560 Context::required(Context
));
564 static CSSM_RETURN CSSMCSPI
cssm_VerifyDataFinal(CSSM_CSP_HANDLE CSPHandle
,
565 CSSM_CC_HANDLE CCHandle
,
566 const CSSM_DATA
*Signature
)
569 findSession
<CSPPluginSession
>(CSPHandle
).VerifyDataFinal(CCHandle
,
570 CssmData::required(Signature
));
574 static CSSM_RETURN CSSMCSPI
cssm_GenerateKeyPair(CSSM_CSP_HANDLE CSPHandle
,
575 CSSM_CC_HANDLE CCHandle
,
576 const CSSM_CONTEXT
*Context
,
577 uint32 PublicKeyUsage
,
578 uint32 PublicKeyAttr
,
579 const CSSM_DATA
*PublicKeyLabel
,
580 CSSM_KEY_PTR PublicKey
,
581 uint32 PrivateKeyUsage
,
582 uint32 PrivateKeyAttr
,
583 const CSSM_DATA
*PrivateKeyLabel
,
584 const CSSM_RESOURCE_CONTROL_CONTEXT
*CredAndAclEntry
,
585 CSSM_KEY_PTR PrivateKey
,
586 CSSM_PRIVILEGE Privilege
)
589 findSession
<CSPPluginSession
>(CSPHandle
).GenerateKeyPair(CCHandle
,
590 Context::required(Context
),
593 CssmData::optional(PublicKeyLabel
),
594 CssmKey::required(PublicKey
),
597 CssmData::optional(PrivateKeyLabel
),
599 CssmKey::required(PrivateKey
),
604 static CSSM_RETURN CSSMCSPI
cssm_EncryptData(CSSM_CSP_HANDLE CSPHandle
,
605 CSSM_CC_HANDLE CCHandle
,
606 const CSSM_CONTEXT
*Context
,
607 const CSSM_DATA
*ClearBufs
,
608 uint32 ClearBufCount
,
609 CSSM_DATA_PTR CipherBufs
,
610 uint32 CipherBufCount
,
611 CSSM_SIZE
*bytesEncrypted
,
612 CSSM_DATA_PTR RemData
,
613 CSSM_PRIVILEGE Privilege
)
616 findSession
<CSPPluginSession
>(CSPHandle
).EncryptData(CCHandle
,
617 Context::required(Context
),
618 &CssmData::required(ClearBufs
),
620 &CssmData::required(CipherBufs
),
622 Required(bytesEncrypted
),
623 CssmData::required(RemData
),
628 static CSSM_RETURN CSSMCSPI
cssm_GetTimeValue(CSSM_CSP_HANDLE CSPHandle
,
629 CSSM_ALGORITHMS TimeAlgorithm
,
633 findSession
<CSPPluginSession
>(CSPHandle
).GetTimeValue(TimeAlgorithm
,
634 CssmData::required(TimeData
));
638 static CSSM_RETURN CSSMCSPI
cssm_DeriveKey(CSSM_CSP_HANDLE CSPHandle
,
639 CSSM_CC_HANDLE CCHandle
,
640 const CSSM_CONTEXT
*Context
,
644 const CSSM_DATA
*KeyLabel
,
645 const CSSM_RESOURCE_CONTROL_CONTEXT
*CredAndAclEntry
,
646 CSSM_KEY_PTR DerivedKey
)
649 findSession
<CSPPluginSession
>(CSPHandle
).DeriveKey(CCHandle
,
650 Context::required(Context
),
651 CssmData::required(Param
),
654 CssmData::optional(KeyLabel
),
656 CssmKey::required(DerivedKey
));
660 static CSSM_RETURN CSSMCSPI
cssm_GenerateKey(CSSM_CSP_HANDLE CSPHandle
,
661 CSSM_CC_HANDLE CCHandle
,
662 const CSSM_CONTEXT
*Context
,
665 const CSSM_DATA
*KeyLabel
,
666 const CSSM_RESOURCE_CONTROL_CONTEXT
*CredAndAclEntry
,
668 CSSM_PRIVILEGE Privilege
)
671 findSession
<CSPPluginSession
>(CSPHandle
).GenerateKey(CCHandle
,
672 Context::required(Context
),
675 CssmData::optional(KeyLabel
),
677 CssmKey::required(Key
),
682 static CSSM_RETURN CSSMCSPI
cssm_PassThrough(CSSM_CSP_HANDLE CSPHandle
,
683 CSSM_CC_HANDLE CCHandle
,
684 const CSSM_CONTEXT
*Context
,
685 uint32 PassThroughId
,
690 findSession
<CSPPluginSession
>(CSPHandle
).PassThrough(CCHandle
,
691 Context::required(Context
),
698 static CSSM_RETURN CSSMCSPI
cssm_VerifyMacUpdate(CSSM_CSP_HANDLE CSPHandle
,
699 CSSM_CC_HANDLE CCHandle
,
700 const CSSM_DATA
*DataBufs
,
704 findSession
<CSPPluginSession
>(CSPHandle
).VerifyMacUpdate(CCHandle
,
705 &CssmData::required(DataBufs
),
710 static CSSM_RETURN CSSMCSPI
cssm_FreeKey(CSSM_CSP_HANDLE CSPHandle
,
711 const CSSM_ACCESS_CREDENTIALS
*AccessCred
,
716 findSession
<CSPPluginSession
>(CSPHandle
).FreeKey(AccessCredentials::optional(AccessCred
),
717 CssmKey::required(KeyPtr
),
722 static CSSM_RETURN CSSMCSPI
cssm_GenerateMacInit(CSSM_CSP_HANDLE CSPHandle
,
723 CSSM_CC_HANDLE CCHandle
,
724 const CSSM_CONTEXT
*Context
)
727 findSession
<CSPPluginSession
>(CSPHandle
).GenerateMacInit(CCHandle
,
728 Context::required(Context
));
732 static CSSM_RETURN CSSMCSPI
cssm_RetrieveCounter(CSSM_CSP_HANDLE CSPHandle
,
733 CSSM_DATA_PTR Counter
)
736 findSession
<CSPPluginSession
>(CSPHandle
).RetrieveCounter(CssmData::required(Counter
));
740 static CSSM_RETURN CSSMCSPI
cssm_QuerySize(CSSM_CSP_HANDLE CSPHandle
,
741 CSSM_CC_HANDLE CCHandle
,
742 const CSSM_CONTEXT
*Context
,
744 uint32 QuerySizeCount
,
745 CSSM_QUERY_SIZE_DATA_PTR DataBlock
)
748 findSession
<CSPPluginSession
>(CSPHandle
).QuerySize(CCHandle
,
749 Context::required(Context
),
752 QuerySizeData::optional(DataBlock
));
756 static CSSM_RETURN CSSMCSPI
cssm_ChangeLoginAcl(CSSM_CSP_HANDLE CSPHandle
,
757 const CSSM_ACCESS_CREDENTIALS
*AccessCred
,
758 const CSSM_ACL_EDIT
*AclEdit
)
761 findSession
<CSPPluginSession
>(CSPHandle
).ChangeLoginAcl(AccessCredentials::required(AccessCred
),
766 static CSSM_RETURN CSSMCSPI
cssm_DigestDataUpdate(CSSM_CSP_HANDLE CSPHandle
,
767 CSSM_CC_HANDLE CCHandle
,
768 const CSSM_DATA
*DataBufs
,
772 findSession
<CSPPluginSession
>(CSPHandle
).DigestDataUpdate(CCHandle
,
773 &CssmData::required(DataBufs
),
779 static const CSSM_SPI_CSP_FUNCS CSPFunctionStruct
= {
788 cssm_VerifyDataUpdate
,
789 cssm_VerifyDataFinal
,
792 cssm_DigestDataUpdate
,
793 cssm_DigestDataClone
,
794 cssm_DigestDataFinal
,
796 cssm_GenerateMacInit
,
797 cssm_GenerateMacUpdate
,
798 cssm_GenerateMacFinal
,
801 cssm_VerifyMacUpdate
,
804 cssm_EncryptDataInit
,
805 cssm_EncryptDataUpdate
,
806 cssm_EncryptDataFinal
,
808 cssm_DecryptDataInit
,
809 cssm_DecryptDataUpdate
,
810 cssm_DecryptDataFinal
,
811 cssm_QueryKeySizeInBits
,
813 cssm_GenerateKeyPair
,
815 cssm_GenerateAlgorithmParams
,
824 cssm_ObtainPrivateKeyFromPublicKey
,
825 cssm_RetrieveUniqueId
,
826 cssm_RetrieveCounter
,
829 cssm_GetOperationalStatistics
,
836 cssm_ChangeLoginOwner
,
839 static CSSM_MODULE_FUNCS CSPFunctionTable
= {
840 CSSM_SERVICE_CSP
, // service type
841 57, // number of functions
842 (const CSSM_PROC_ADDR
*)&CSPFunctionStruct
845 CSSM_MODULE_FUNCS_PTR
CSPPluginSession::construct()
847 return &CSPFunctionTable
;