TclPKCS11

Diff
Login

Diff

Differences From Artifact [b28d164d97]:

To Artifact [d1d4644b83]:


324
325
326
327
328
329
330


331
332
333
334


335
336
337
338
339
340


341
342
343
344


345
346
347
348
349
350


351
352
353
354


355
356
357
358
359
360
361
362

	*mutex = retval;

	return(CKR_OK);
}

MODULE_SCOPE CK_RV tclpkcs11_lock_mutex(void *mutex) {


	if (!mutex) {
		return(CKR_GENERAL_ERROR);
	}



	Tcl_MutexLock(*mutex);

	return(CKR_OK);
}

MODULE_SCOPE CK_RV tclpkcs11_unlock_mutex(void *mutex) {


	if (!mutex) {
		return(CKR_GENERAL_ERROR);
	}



	Tcl_MutexUnlock(*mutex);

	return(CKR_OK);
}

MODULE_SCOPE CK_RV tclpkcs11_destroy_mutex(void *mutex) {


	if (!mutex) {
		return(CKR_GENERAL_ERROR);
	}



	Tcl_MutexFinalize(*mutex);
	ckfree(mutex);

	return(CKR_OK);
}

/* Convience function to start a session if one is not already active */
MODULE_SCOPE int tclpkcs11_start_session(struct tclpkcs11_handle *handle, CK_SLOT_ID slot) {







>
>




>
>
|





>
>




>
>
|





>
>




>
>
|







324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374

	*mutex = retval;

	return(CKR_OK);
}

MODULE_SCOPE CK_RV tclpkcs11_lock_mutex(void *mutex) {
	Tcl_Mutex *tcl_mutex;

	if (!mutex) {
		return(CKR_GENERAL_ERROR);
	}

	tcl_mutex = mutex;

	Tcl_MutexLock(tcl_mutex);

	return(CKR_OK);
}

MODULE_SCOPE CK_RV tclpkcs11_unlock_mutex(void *mutex) {
	Tcl_Mutex *tcl_mutex;

	if (!mutex) {
		return(CKR_GENERAL_ERROR);
	}

	tcl_mutex = mutex;

	Tcl_MutexUnlock(tcl_mutex);

	return(CKR_OK);
}

MODULE_SCOPE CK_RV tclpkcs11_destroy_mutex(void *mutex) {
	Tcl_Mutex *tcl_mutex;

	if (!mutex) {
		return(CKR_GENERAL_ERROR);
	}

	tcl_mutex = mutex;

	Tcl_MutexFinalize(tcl_mutex);
	ckfree(mutex);

	return(CKR_OK);
}

/* Convience function to start a session if one is not already active */
MODULE_SCOPE int tclpkcs11_start_session(struct tclpkcs11_handle *handle, CK_SLOT_ID slot) {