Closes a session.
{
CK_RV xResult = CKR_OK;
{
xResult = CKR_CRYPTOKI_NOT_INITIALIZED;
}
else if( pxSession == NULL )
{
xResult = CKR_SESSION_HANDLE_INVALID;
}
else if( pxSession->
xOpened == ( CK_BBOOL ) CK_TRUE )
{
mbedtls_pk_free( &pxSession->
xSignKey );
{
}
{
}
}
else
{
}
return xResult;
}
- Parameters
-
[in] | hSession | The session handle to be terminated. |
- Returns
- CKR_OK if successful. Else, see PKCS #11 specification for more information.
#define CK_DECLARE_FUNCTION(returnType, name)
Macro for defining a PKCS #11 functions.
Definition: iot_pkcs11.h:66
mbedtls_pk_context xSignKey
Signing key. Set during C_SignInit.
Definition: iot_pkcs11_mbedtls.c:228
SemaphoreHandle_t xVerifyMutex
Protects the verification key from being modified while in use.
Definition: iot_pkcs11_mbedtls.c:224
CK_BBOOL xIsInitialized
Indicates whether PKCS #11 module has been initialized with a call to C_Initialize.
Definition: iot_pkcs11_mbedtls.c:202
mbedtls_sha256_context xSHA256Context
Context for in progress digest operation.
Definition: iot_pkcs11_mbedtls.c:229
CK_RV C_CloseSession(CK_SESSION_HANDLE hSession)
Closes a session.
Definition: iot_pkcs11_mbedtls.c:1849
static P11Session_t * prvSessionPointerFromHandle(CK_SESSION_HANDLE xSession)
Maps an opaque caller session handle into its internal state structure.
Definition: iot_pkcs11_mbedtls.c:287
mbedtls_pk_context xVerifyKey
Verification key. Set during C_VerifyInit.
Definition: iot_pkcs11_mbedtls.c:225
Session structure.
Definition: iot_pkcs11_mbedtls.c:217
SemaphoreHandle_t xSignMutex
Protects the signing key from being modified while in use.
Definition: iot_pkcs11_mbedtls.c:227
CK_BBOOL xOpened
Set to CK_TRUE upon opening PKCS #11 session.
Definition: iot_pkcs11_mbedtls.c:219
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