summaryrefslogtreecommitdiff
path: root/security/nss/lib/ckfw/instance.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/nss/lib/ckfw/instance.c')
-rw-r--r--security/nss/lib/ckfw/instance.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/security/nss/lib/ckfw/instance.c b/security/nss/lib/ckfw/instance.c
index bb682de2d..ffcd4910e 100644
--- a/security/nss/lib/ckfw/instance.c
+++ b/security/nss/lib/ckfw/instance.c
@@ -100,6 +100,8 @@ struct NSSCKFWInstanceStr {
NSSArena *arena;
NSSCKMDInstance *mdInstance;
CK_C_INITIALIZE_ARGS_PTR pInitArgs;
+ CK_C_INITIALIZE_ARGS initArgs;
+ CryptokiLockingState LockingState;
CK_BBOOL mayCreatePthreads;
NSSUTF8 *configurationData;
CK_ULONG nSlots;
@@ -191,6 +193,7 @@ NSS_IMPLEMENT NSSCKFWInstance *
nssCKFWInstance_Create
(
CK_C_INITIALIZE_ARGS_PTR pInitArgs,
+ CryptokiLockingState LockingState,
NSSCKMDInstance *mdInstance,
CK_RV *pError
)
@@ -224,9 +227,11 @@ nssCKFWInstance_Create
fwInstance->arena = arena;
fwInstance->mdInstance = mdInstance;
- fwInstance->pInitArgs = pInitArgs;
+ fwInstance->LockingState = LockingState;
if( (CK_C_INITIALIZE_ARGS_PTR)NULL != pInitArgs ) {
+ fwInstance->initArgs = *pInitArgs;
+ fwInstance->pInitArgs = &fwInstance->initArgs;
if( pInitArgs->flags & CKF_LIBRARY_CANT_CREATE_OS_THREADS ) {
fwInstance->mayCreatePthreads = CK_FALSE;
} else {
@@ -237,7 +242,8 @@ nssCKFWInstance_Create
fwInstance->mayCreatePthreads = CK_TRUE;
}
- fwInstance->mutex = nssCKFWMutex_Create(pInitArgs, arena, pError);
+ fwInstance->mutex = nssCKFWMutex_Create(pInitArgs, LockingState, arena,
+ pError);
if( (NSSCKFWMutex *)NULL == fwInstance->mutex ) {
if( CKR_OK == *pError ) {
*pError = CKR_GENERAL_ERROR;
@@ -361,7 +367,9 @@ nssCKFWInstance_Create
}
}
- (void)NSSArena_Destroy(arena);
+ if (arena) {
+ (void)NSSArena_Destroy(arena);
+ }
return (NSSCKFWInstance *)NULL;
}
@@ -502,7 +510,8 @@ nssCKFWInstance_CreateMutex
}
#endif /* NSSDEBUG */
- mutex = nssCKFWMutex_Create(fwInstance->pInitArgs, arena, pError);
+ mutex = nssCKFWMutex_Create(fwInstance->pInitArgs, fwInstance->LockingState,
+ arena, pError);
if( (NSSCKFWMutex *)NULL == mutex ) {
if( CKR_OK == *pError ) {
*pError = CKR_GENERAL_ERROR;