FreeRTOS:
PKCS11
PKCS11 Cryptoki Library
Return to main page ↑
C_Finalize
Clean up miscellaneous Cryptoki-associated resources.
CK_DECLARE_FUNCTION
( CK_RV,
C_Finalize
)( CK_VOID_PTR pReserved )
{
CK_RV xResult = CKR_OK;
if
( pReserved != NULL )
{
xResult = CKR_ARGUMENTS_BAD;
}
if
( xResult == CKR_OK )
{
/* See explanation in prvCheckValidSessionAndModule for this exception. */
/* coverity[misra_c_2012_rule_10_5_violation] */
if
(
xP11Context
.
xIsInitialized
== ( CK_BBOOL ) CK_FALSE )
{
xResult = CKR_CRYPTOKI_NOT_INITIALIZED;
}
}
if
( xResult == CKR_OK )
{
mbedtls_entropy_free( &
xP11Context
.
xMbedEntropyContext
);
mbedtls_ctr_drbg_free( &
xP11Context
.
xMbedDrbgCtx
);
if
(
xP11Context
.
xObjectList
.
xMutex
!= NULL )
{
vSemaphoreDelete(
xP11Context
.
xObjectList
.
xMutex
);
}
/* See explanation in prvCheckValidSessionAndModule for this exception. */
/* coverity[misra_c_2012_rule_10_5_violation] */
xP11Context
.
xIsInitialized
= ( CK_BBOOL ) CK_FALSE;
}
return
xResult;
}
CK_DECLARE_FUNCTION
#define CK_DECLARE_FUNCTION(returnType, name)
Macro for defining a PKCS #11 functions.
Definition:
iot_pkcs11.h:66
P11Struct_t::xIsInitialized
CK_BBOOL xIsInitialized
Indicates whether PKCS #11 module has been initialized with a call to C_Initialize.
Definition:
iot_pkcs11_mbedtls.c:202
P11Struct_t::xObjectList
P11ObjectList_t xObjectList
List of PKCS #11 objects that have been found/created since module initialization....
Definition:
iot_pkcs11_mbedtls.c:207
P11ObjectList_t::xMutex
SemaphoreHandle_t xMutex
Mutex that protects write operations to the xObjects array.
Definition:
iot_pkcs11_mbedtls.c:190
P11Struct_t::xMbedDrbgCtx
mbedtls_ctr_drbg_context xMbedDrbgCtx
CTR-DRBG context for PKCS #11 module - used to generate pseudo-random numbers.
Definition:
iot_pkcs11_mbedtls.c:203
C_Finalize
CK_RV C_Finalize(CK_VOID_PTR pReserved)
Clean up miscellaneous Cryptoki-associated resources.
Definition:
iot_pkcs11_mbedtls.c:1358
xP11Context
static P11Struct_t xP11Context
The global PKCS #11 module object. Entropy/randomness and object lists are shared across PKCS #11 ses...
Definition:
iot_pkcs11_mbedtls.c:238
P11Struct_t::xMbedEntropyContext
mbedtls_entropy_context xMbedEntropyContext
Entropy context for PKCS #11 module - used to collect entropy for RNG.
Definition:
iot_pkcs11_mbedtls.c:204
Generated by
1.8.20
Last updated Wed Apr 21 2021