Obtains a list of slots in the system.
CK_SLOT_ID_PTR pSlotList,
CK_ULONG_PTR pulCount )
{
CK_RV xResult = CKR_OK;
( void ) ( tokenPresent );
{
xResult = CKR_CRYPTOKI_NOT_INITIALIZED;
LogError( (
"Failed to get slot list. PKCS #11 must be initialized "
"before any operations." ) );
}
if( NULL == pulCount )
{
xResult = CKR_ARGUMENTS_BAD;
LogError( (
"Failed to get slot list. Count pointer was NULL." ) );
}
if( xResult == CKR_OK )
{
if( NULL == pSlotList )
{
*pulCount = 1;
}
else
{
if( 0u == *pulCount )
{
xResult = CKR_BUFFER_TOO_SMALL;
LogWarn( (
"The buffer is too small to contain the slot list." ) );
}
else
{
*pulCount = 1;
LogDebug( (
"Successfully Returned a PKCS #11 slot with ID "
"%lu with a count of %lu.", (
unsigned long int )
pkcs11SLOT_ID, (
unsigned long int ) *pulCount ) );
}
}
}
return xResult;
}
#define CK_DECLARE_FUNCTION(returnType, name)
Macro for defining a PKCS #11 functions.
Definition: core_pkcs11.h:77
#define LogWarn(message)
Macro that is called in the corePKCS11 library for logging "Warning" level messages.
Definition: core_pkcs11_config_defaults.h:337
#define LogError(message)
Macro that is called in the corePKCS11 library for logging "Error" level messages.
Definition: core_pkcs11_config_defaults.h:317
#define LogDebug(message)
Macro that is called in the corePKCS11 library for logging "Debug" level messages.
Definition: core_pkcs11_config_defaults.h:377
static P11Struct_t xP11Context
The global PKCS #11 module object. Entropy/randomness and object lists are shared across PKCS #11 ses...
Definition: core_pkcs11_mbedtls.c:326
CK_RV C_GetSlotList(CK_BBOOL tokenPresent, CK_SLOT_ID_PTR pSlotList, CK_ULONG_PTR pulCount)
Obtains a list of slots in the system.
Definition: core_pkcs11_mbedtls.c:1625
#define pkcs11SLOT_ID
The slot ID to be returned by this PKCS #11 implementation.
Definition: core_pkcs11_mbedtls.c:208
CK_BBOOL xIsInitialized
Indicates whether PKCS #11 module has been initialized with a call to C_Initialize.
Definition: core_pkcs11_mbedtls.c:285
This port does not implement the concept of separate slots/tokens.