Initializes an object search operation.
CK_OBJECT_HANDLE_PTR phObject,
CK_ULONG ulMaxObjectCount,
CK_ULONG_PTR pulObjectCount )
{
CK_OBJECT_HANDLE xPalHandle = CK_INVALID_HANDLE;
if( ( NULL == phObject ) ||
( NULL == pulObjectCount ) )
{
LogError( (
"Failed to find objects. The object handle or the object "
"count pointer was NULL." ) );
xResult = CKR_ARGUMENTS_BAD;
}
if( xResult == CKR_OK )
{
{
LogError( (
"Failed to find objects. The PKCS #11 stack must be "
"initialized before any operations." ) );
xResult = CKR_OPERATION_NOT_INITIALIZED;
}
if( 1u != ulMaxObjectCount )
{
xResult = CKR_ARGUMENTS_BAD;
LogError( (
"Failed to find objects. Searching for anything other "
"than 1 object at a time is not supported." ) );
}
}
if( xResult == CKR_OK )
{
if( *phObject == CK_INVALID_HANDLE )
{
LogDebug( (
"Could not find the object handle in the list. "
"Trying to search PKCS #11 PAL for object." ) );
}
if( xPalHandle != CK_INVALID_HANDLE )
{
LogDebug( (
"Found object in PAL. Adding object handle to list." ) );
*pulObjectCount = 1;
}
else
{
*pulObjectCount = 0;
}
}
if( xResult != CKR_OK )
{
if( pxSession != NULL )
{
}
}
return xResult;
}
#define CK_DECLARE_FUNCTION(returnType, name)
Macro for defining a PKCS #11 functions.
Definition: core_pkcs11.h:77
#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
CK_RV C_FindObjects(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE_PTR phObject, CK_ULONG ulMaxObjectCount, CK_ULONG_PTR pulObjectCount)
Initializes an object search operation.
Definition: core_pkcs11_mbedtls.c:3499
static P11Session_t * prvSessionPointerFromHandle(CK_SESSION_HANDLE xSession)
Maps an opaque caller session handle into its internal state structure.
Definition: core_pkcs11_mbedtls.c:382
static CK_RV prvCheckValidSessionAndModule(const P11Session_t *pxSession)
Helper to check if the current session is initialized and valid.
Definition: core_pkcs11_mbedtls.c:336
static CK_RV prvAddObjectToList(CK_OBJECT_HANDLE xPalHandle, CK_OBJECT_HANDLE_PTR pxAppHandle, const CK_BYTE *pcLabel, CK_ULONG xLabelLength)
Add an object that exists in NVM to the application object array.
Definition: core_pkcs11_mbedtls.c:1183
static void prvFindObjectInListByLabel(const CK_BYTE *pcLabel, CK_ULONG xLabelLength, CK_OBJECT_HANDLE_PTR pxPalHandle, CK_OBJECT_HANDLE_PTR pxAppHandle)
Parses attribute values for a private EC Key.
Definition: core_pkcs11_mbedtls.c:1081
CK_OBJECT_HANDLE PKCS11_PAL_FindObject(CK_BYTE_PTR pxLabel, CK_ULONG usLength)
Translates a PKCS #11 label into an object handle.
Session structure.
Definition: core_pkcs11_mbedtls.c:299
CK_BYTE * pxFindObjectLabel
Pointer to the label for the search in progress. Should be NULL if no search in progress.
Definition: core_pkcs11_mbedtls.c:303
CK_ULONG xFindObjectLabelLen
Size of current search label.
Definition: core_pkcs11_mbedtls.c:304