#ifndef EXT_PK11_THREAD_FUNCS_H #define EXT_PK11_THREAD_FUNCS_H #include "pk11.h" #ifdef HAVE_RB_THREAD_CALL_WITHOUT_GVL struct tbr_C_Initialize_params { CK_C_Initialize func; struct { CK_VOID_PTR pInitArgs; } params; CK_RV retval; }; void * tbf_C_Initialize( void *data ); struct tbr_C_Finalize_params { CK_C_Finalize func; struct { CK_VOID_PTR pReserved; } params; CK_RV retval; }; void * tbf_C_Finalize( void *data ); struct tbr_C_GetInfo_params { CK_C_GetInfo func; struct { CK_INFO_PTR pInfo; } params; CK_RV retval; }; void * tbf_C_GetInfo( void *data ); struct tbr_C_GetFunctionList_params { CK_C_GetFunctionList func; struct { CK_FUNCTION_LIST_PTR_PTR ppFunctionList; } params; CK_RV retval; }; void * tbf_C_GetFunctionList( void *data ); struct tbr_C_GetSlotList_params { CK_C_GetSlotList func; struct { CK_BBOOL tokenPresent;CK_SLOT_ID_PTR pSlotList;CK_ULONG_PTR pulCount; } params; CK_RV retval; }; void * tbf_C_GetSlotList( void *data ); struct tbr_C_GetSlotInfo_params { CK_C_GetSlotInfo func; struct { CK_SLOT_ID slotID;CK_SLOT_INFO_PTR pInfo; } params; CK_RV retval; }; void * tbf_C_GetSlotInfo( void *data ); struct tbr_C_GetTokenInfo_params { CK_C_GetTokenInfo func; struct { CK_SLOT_ID slotID;CK_TOKEN_INFO_PTR pInfo; } params; CK_RV retval; }; void * tbf_C_GetTokenInfo( void *data ); struct tbr_C_GetMechanismList_params { CK_C_GetMechanismList func; struct { CK_SLOT_ID slotID;CK_MECHANISM_TYPE_PTR pMechanismList;CK_ULONG_PTR pulCount; } params; CK_RV retval; }; void * tbf_C_GetMechanismList( void *data ); struct tbr_C_GetMechanismInfo_params { CK_C_GetMechanismInfo func; struct { CK_SLOT_ID slotID;CK_MECHANISM_TYPE type;CK_MECHANISM_INFO_PTR pInfo; } params; CK_RV retval; }; void * tbf_C_GetMechanismInfo( void *data ); struct tbr_C_InitToken_params { CK_C_InitToken func; struct { CK_SLOT_ID slotID;CK_UTF8CHAR_PTR pPin;CK_ULONG ulPinLen;CK_UTF8CHAR_PTR pLabel; } params; CK_RV retval; }; void * tbf_C_InitToken( void *data ); struct tbr_C_InitPIN_params { CK_C_InitPIN func; struct { CK_SESSION_HANDLE hSession;CK_UTF8CHAR_PTR pPin;CK_ULONG ulPinLen; } params; CK_RV retval; }; void * tbf_C_InitPIN( void *data ); struct tbr_C_SetPIN_params { CK_C_SetPIN func; struct { CK_SESSION_HANDLE hSession;CK_UTF8CHAR_PTR pOldPin;CK_ULONG ulOldLen;CK_UTF8CHAR_PTR pNewPin;CK_ULONG ulNewLen; } params; CK_RV retval; }; void * tbf_C_SetPIN( void *data ); struct tbr_C_OpenSession_params { CK_C_OpenSession func; struct { CK_SLOT_ID slotID;CK_FLAGS flags;CK_VOID_PTR pApplication;CK_NOTIFY Notify;CK_SESSION_HANDLE_PTR phSession; } params; CK_RV retval; }; void * tbf_C_OpenSession( void *data ); struct tbr_C_CloseSession_params { CK_C_CloseSession func; struct { CK_SESSION_HANDLE hSession; } params; CK_RV retval; }; void * tbf_C_CloseSession( void *data ); struct tbr_C_CloseAllSessions_params { CK_C_CloseAllSessions func; struct { CK_SLOT_ID slotID; } params; CK_RV retval; }; void * tbf_C_CloseAllSessions( void *data ); struct tbr_C_GetSessionInfo_params { CK_C_GetSessionInfo func; struct { CK_SESSION_HANDLE hSession;CK_SESSION_INFO_PTR pInfo; } params; CK_RV retval; }; void * tbf_C_GetSessionInfo( void *data ); struct tbr_C_GetOperationState_params { CK_C_GetOperationState func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pOperationState;CK_ULONG_PTR pulOperationStateLen; } params; CK_RV retval; }; void * tbf_C_GetOperationState( void *data ); struct tbr_C_SetOperationState_params { CK_C_SetOperationState func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pOperationState;CK_ULONG ulOperationStateLen;CK_OBJECT_HANDLE hEncryptionKey;CK_OBJECT_HANDLE hAuthenticationKey; } params; CK_RV retval; }; void * tbf_C_SetOperationState( void *data ); struct tbr_C_Login_params { CK_C_Login func; struct { CK_SESSION_HANDLE hSession;CK_USER_TYPE userType;CK_UTF8CHAR_PTR pPin;CK_ULONG ulPinLen; } params; CK_RV retval; }; void * tbf_C_Login( void *data ); struct tbr_C_Logout_params { CK_C_Logout func; struct { CK_SESSION_HANDLE hSession; } params; CK_RV retval; }; void * tbf_C_Logout( void *data ); struct tbr_C_CreateObject_params { CK_C_CreateObject func; struct { CK_SESSION_HANDLE hSession;CK_ATTRIBUTE_PTR pTemplate;CK_ULONG ulCount;CK_OBJECT_HANDLE_PTR phObject; } params; CK_RV retval; }; void * tbf_C_CreateObject( void *data ); struct tbr_C_CopyObject_params { CK_C_CopyObject func; struct { CK_SESSION_HANDLE hSession;CK_OBJECT_HANDLE hObject;CK_ATTRIBUTE_PTR pTemplate;CK_ULONG ulCount;CK_OBJECT_HANDLE_PTR phNewObject; } params; CK_RV retval; }; void * tbf_C_CopyObject( void *data ); struct tbr_C_DestroyObject_params { CK_C_DestroyObject func; struct { CK_SESSION_HANDLE hSession;CK_OBJECT_HANDLE hObject; } params; CK_RV retval; }; void * tbf_C_DestroyObject( void *data ); struct tbr_C_GetObjectSize_params { CK_C_GetObjectSize func; struct { CK_SESSION_HANDLE hSession;CK_OBJECT_HANDLE hObject;CK_ULONG_PTR pulSize; } params; CK_RV retval; }; void * tbf_C_GetObjectSize( void *data ); struct tbr_C_GetAttributeValue_params { CK_C_GetAttributeValue func; struct { CK_SESSION_HANDLE hSession;CK_OBJECT_HANDLE hObject;CK_ATTRIBUTE_PTR pTemplate;CK_ULONG ulCount; } params; CK_RV retval; }; void * tbf_C_GetAttributeValue( void *data ); struct tbr_C_SetAttributeValue_params { CK_C_SetAttributeValue func; struct { CK_SESSION_HANDLE hSession;CK_OBJECT_HANDLE hObject;CK_ATTRIBUTE_PTR pTemplate;CK_ULONG ulCount; } params; CK_RV retval; }; void * tbf_C_SetAttributeValue( void *data ); struct tbr_C_FindObjectsInit_params { CK_C_FindObjectsInit func; struct { CK_SESSION_HANDLE hSession;CK_ATTRIBUTE_PTR pTemplate;CK_ULONG ulCount; } params; CK_RV retval; }; void * tbf_C_FindObjectsInit( void *data ); struct tbr_C_FindObjects_params { CK_C_FindObjects func; struct { CK_SESSION_HANDLE hSession;CK_OBJECT_HANDLE_PTR phObject;CK_ULONG ulMaxObjectCount;CK_ULONG_PTR pulObjectCount; } params; CK_RV retval; }; void * tbf_C_FindObjects( void *data ); struct tbr_C_FindObjectsFinal_params { CK_C_FindObjectsFinal func; struct { CK_SESSION_HANDLE hSession; } params; CK_RV retval; }; void * tbf_C_FindObjectsFinal( void *data ); struct tbr_C_EncryptInit_params { CK_C_EncryptInit func; struct { CK_SESSION_HANDLE hSession;CK_MECHANISM_PTR pMechanism;CK_OBJECT_HANDLE hKey; } params; CK_RV retval; }; void * tbf_C_EncryptInit( void *data ); struct tbr_C_Encrypt_params { CK_C_Encrypt func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pData;CK_ULONG ulDataLen;CK_BYTE_PTR pEncryptedData;CK_ULONG_PTR pulEncryptedDataLen; } params; CK_RV retval; }; void * tbf_C_Encrypt( void *data ); struct tbr_C_EncryptUpdate_params { CK_C_EncryptUpdate func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pPart;CK_ULONG ulPartLen;CK_BYTE_PTR pEncryptedPart;CK_ULONG_PTR pulEncryptedPartLen; } params; CK_RV retval; }; void * tbf_C_EncryptUpdate( void *data ); struct tbr_C_EncryptFinal_params { CK_C_EncryptFinal func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pLastEncryptedPart;CK_ULONG_PTR pulLastEncryptedPartLen; } params; CK_RV retval; }; void * tbf_C_EncryptFinal( void *data ); struct tbr_C_DecryptInit_params { CK_C_DecryptInit func; struct { CK_SESSION_HANDLE hSession;CK_MECHANISM_PTR pMechanism;CK_OBJECT_HANDLE hKey; } params; CK_RV retval; }; void * tbf_C_DecryptInit( void *data ); struct tbr_C_Decrypt_params { CK_C_Decrypt func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pEncryptedData;CK_ULONG ulEncryptedDataLen;CK_BYTE_PTR pData;CK_ULONG_PTR pulDataLen; } params; CK_RV retval; }; void * tbf_C_Decrypt( void *data ); struct tbr_C_DecryptUpdate_params { CK_C_DecryptUpdate func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pEncryptedPart;CK_ULONG ulEncryptedPartLen;CK_BYTE_PTR pPart;CK_ULONG_PTR pulPartLen; } params; CK_RV retval; }; void * tbf_C_DecryptUpdate( void *data ); struct tbr_C_DecryptFinal_params { CK_C_DecryptFinal func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pLastPart;CK_ULONG_PTR pulLastPartLen; } params; CK_RV retval; }; void * tbf_C_DecryptFinal( void *data ); struct tbr_C_DigestInit_params { CK_C_DigestInit func; struct { CK_SESSION_HANDLE hSession;CK_MECHANISM_PTR pMechanism; } params; CK_RV retval; }; void * tbf_C_DigestInit( void *data ); struct tbr_C_Digest_params { CK_C_Digest func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pData;CK_ULONG ulDataLen;CK_BYTE_PTR pDigest;CK_ULONG_PTR pulDigestLen; } params; CK_RV retval; }; void * tbf_C_Digest( void *data ); struct tbr_C_DigestUpdate_params { CK_C_DigestUpdate func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pPart;CK_ULONG ulPartLen; } params; CK_RV retval; }; void * tbf_C_DigestUpdate( void *data ); struct tbr_C_DigestKey_params { CK_C_DigestKey func; struct { CK_SESSION_HANDLE hSession;CK_OBJECT_HANDLE hKey; } params; CK_RV retval; }; void * tbf_C_DigestKey( void *data ); struct tbr_C_DigestFinal_params { CK_C_DigestFinal func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pDigest;CK_ULONG_PTR pulDigestLen; } params; CK_RV retval; }; void * tbf_C_DigestFinal( void *data ); struct tbr_C_SignInit_params { CK_C_SignInit func; struct { CK_SESSION_HANDLE hSession;CK_MECHANISM_PTR pMechanism;CK_OBJECT_HANDLE hKey; } params; CK_RV retval; }; void * tbf_C_SignInit( void *data ); struct tbr_C_Sign_params { CK_C_Sign func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pData;CK_ULONG ulDataLen;CK_BYTE_PTR pSignature;CK_ULONG_PTR pulSignatureLen; } params; CK_RV retval; }; void * tbf_C_Sign( void *data ); struct tbr_C_SignUpdate_params { CK_C_SignUpdate func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pPart;CK_ULONG ulPartLen; } params; CK_RV retval; }; void * tbf_C_SignUpdate( void *data ); struct tbr_C_SignFinal_params { CK_C_SignFinal func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pSignature;CK_ULONG_PTR pulSignatureLen; } params; CK_RV retval; }; void * tbf_C_SignFinal( void *data ); struct tbr_C_SignRecoverInit_params { CK_C_SignRecoverInit func; struct { CK_SESSION_HANDLE hSession;CK_MECHANISM_PTR pMechanism;CK_OBJECT_HANDLE hKey; } params; CK_RV retval; }; void * tbf_C_SignRecoverInit( void *data ); struct tbr_C_SignRecover_params { CK_C_SignRecover func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pData;CK_ULONG ulDataLen;CK_BYTE_PTR pSignature;CK_ULONG_PTR pulSignatureLen; } params; CK_RV retval; }; void * tbf_C_SignRecover( void *data ); struct tbr_C_VerifyInit_params { CK_C_VerifyInit func; struct { CK_SESSION_HANDLE hSession;CK_MECHANISM_PTR pMechanism;CK_OBJECT_HANDLE hKey; } params; CK_RV retval; }; void * tbf_C_VerifyInit( void *data ); struct tbr_C_Verify_params { CK_C_Verify func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pData;CK_ULONG ulDataLen;CK_BYTE_PTR pSignature;CK_ULONG ulSignatureLen; } params; CK_RV retval; }; void * tbf_C_Verify( void *data ); struct tbr_C_VerifyUpdate_params { CK_C_VerifyUpdate func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pPart;CK_ULONG ulPartLen; } params; CK_RV retval; }; void * tbf_C_VerifyUpdate( void *data ); struct tbr_C_VerifyFinal_params { CK_C_VerifyFinal func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pSignature;CK_ULONG ulSignatureLen; } params; CK_RV retval; }; void * tbf_C_VerifyFinal( void *data ); struct tbr_C_VerifyRecoverInit_params { CK_C_VerifyRecoverInit func; struct { CK_SESSION_HANDLE hSession;CK_MECHANISM_PTR pMechanism;CK_OBJECT_HANDLE hKey; } params; CK_RV retval; }; void * tbf_C_VerifyRecoverInit( void *data ); struct tbr_C_VerifyRecover_params { CK_C_VerifyRecover func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pSignature;CK_ULONG ulSignatureLen;CK_BYTE_PTR pData;CK_ULONG_PTR pulDataLen; } params; CK_RV retval; }; void * tbf_C_VerifyRecover( void *data ); struct tbr_C_DigestEncryptUpdate_params { CK_C_DigestEncryptUpdate func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pPart;CK_ULONG ulPartLen;CK_BYTE_PTR pEncryptedPart;CK_ULONG_PTR pulEncryptedPartLen; } params; CK_RV retval; }; void * tbf_C_DigestEncryptUpdate( void *data ); struct tbr_C_DecryptDigestUpdate_params { CK_C_DecryptDigestUpdate func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pEncryptedPart;CK_ULONG ulEncryptedPartLen;CK_BYTE_PTR pPart;CK_ULONG_PTR pulPartLen; } params; CK_RV retval; }; void * tbf_C_DecryptDigestUpdate( void *data ); struct tbr_C_SignEncryptUpdate_params { CK_C_SignEncryptUpdate func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pPart;CK_ULONG ulPartLen;CK_BYTE_PTR pEncryptedPart;CK_ULONG_PTR pulEncryptedPartLen; } params; CK_RV retval; }; void * tbf_C_SignEncryptUpdate( void *data ); struct tbr_C_DecryptVerifyUpdate_params { CK_C_DecryptVerifyUpdate func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pEncryptedPart;CK_ULONG ulEncryptedPartLen;CK_BYTE_PTR pPart;CK_ULONG_PTR pulPartLen; } params; CK_RV retval; }; void * tbf_C_DecryptVerifyUpdate( void *data ); struct tbr_C_GenerateKey_params { CK_C_GenerateKey func; struct { CK_SESSION_HANDLE hSession;CK_MECHANISM_PTR pMechanism;CK_ATTRIBUTE_PTR pTemplate;CK_ULONG ulCount;CK_OBJECT_HANDLE_PTR phKey; } params; CK_RV retval; }; void * tbf_C_GenerateKey( void *data ); struct tbr_C_GenerateKeyPair_params { CK_C_GenerateKeyPair func; struct { CK_SESSION_HANDLE hSession;CK_MECHANISM_PTR pMechanism;CK_ATTRIBUTE_PTR pPublicKeyTemplate;CK_ULONG ulPublicKeyAttributeCount;CK_ATTRIBUTE_PTR pPrivateKeyTemplate;CK_ULONG ulPrivateKeyAttributeCount;CK_OBJECT_HANDLE_PTR phPublicKey;CK_OBJECT_HANDLE_PTR phPrivateKey; } params; CK_RV retval; }; void * tbf_C_GenerateKeyPair( void *data ); struct tbr_C_WrapKey_params { CK_C_WrapKey func; struct { CK_SESSION_HANDLE hSession;CK_MECHANISM_PTR pMechanism;CK_OBJECT_HANDLE hWrappingKey;CK_OBJECT_HANDLE hKey;CK_BYTE_PTR pWrappedKey;CK_ULONG_PTR pulWrappedKeyLen; } params; CK_RV retval; }; void * tbf_C_WrapKey( void *data ); struct tbr_C_UnwrapKey_params { CK_C_UnwrapKey func; struct { CK_SESSION_HANDLE hSession;CK_MECHANISM_PTR pMechanism;CK_OBJECT_HANDLE hUnwrappingKey;CK_BYTE_PTR pWrappedKey;CK_ULONG ulWrappedKeyLen;CK_ATTRIBUTE_PTR pTemplate;CK_ULONG ulAttributeCount;CK_OBJECT_HANDLE_PTR phKey; } params; CK_RV retval; }; void * tbf_C_UnwrapKey( void *data ); struct tbr_C_DeriveKey_params { CK_C_DeriveKey func; struct { CK_SESSION_HANDLE hSession;CK_MECHANISM_PTR pMechanism;CK_OBJECT_HANDLE hBaseKey;CK_ATTRIBUTE_PTR pTemplate;CK_ULONG ulAttributeCount;CK_OBJECT_HANDLE_PTR phKey; } params; CK_RV retval; }; void * tbf_C_DeriveKey( void *data ); struct tbr_C_SeedRandom_params { CK_C_SeedRandom func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR pSeed;CK_ULONG ulSeedLen; } params; CK_RV retval; }; void * tbf_C_SeedRandom( void *data ); struct tbr_C_GenerateRandom_params { CK_C_GenerateRandom func; struct { CK_SESSION_HANDLE hSession;CK_BYTE_PTR RandomData;CK_ULONG ulRandomLen; } params; CK_RV retval; }; void * tbf_C_GenerateRandom( void *data ); struct tbr_C_GetFunctionStatus_params { CK_C_GetFunctionStatus func; struct { CK_SESSION_HANDLE hSession; } params; CK_RV retval; }; void * tbf_C_GetFunctionStatus( void *data ); struct tbr_C_CancelFunction_params { CK_C_CancelFunction func; struct { CK_SESSION_HANDLE hSession; } params; CK_RV retval; }; void * tbf_C_CancelFunction( void *data ); struct tbr_C_WaitForSlotEvent_params { CK_C_WaitForSlotEvent func; struct { CK_FLAGS flags;CK_SLOT_ID_PTR pSlot;CK_VOID_PTR pRserved; } params; CK_RV retval; }; void * tbf_C_WaitForSlotEvent( void *data ); #endif #endif