TclPKCS11

Check-in [5e2883f391]
Login
Overview
Comment:Updated to call Tcl_LoadFile() with an interp argument since Tcl_LoadFile() segfaults when interp is NULL (bug in Tcl_LoadFile())
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5e2883f3910dbb6306eeeb42f12b4b05f500873ac5992ed078f31e6af3194450
User & Date: rkeene on 2015-10-05 11:54:23
Other Links: manifest | tags
Context
2015-10-05
11:54
TclPKCS11 0.9.11 check-in: 8b3fc92dfe user: rkeene tags: release-0.9.11, trunk
11:54
Updated to call Tcl_LoadFile() with an interp argument since Tcl_LoadFile() segfaults when interp is NULL (bug in Tcl_LoadFile()) check-in: 5e2883f391 user: rkeene tags: trunk
10:56
TclPKCS11 0.9.10 check-in: 4ccd24b97f user: rkeene tags: release-0.9.10, trunk
Changes

Modified tclpkcs11.c from [f04afe6243] to [506823d58c].

416
417
418
419
420
421
422
423

424
425
426
427
428
429
430
431
432
433
434
435

436
437
438
439
440
441
442
416
417
418
419
420
421
422

423
424
425
426
427
428
429
430
431
432
433
434

435
436
437
438
439
440
441
442







-
+











-
+








	return(CKR_OK);
}

/*
 * Platform Specific Functions 
 */
MODULE_SCOPE void *tclpkcs11_int_load_module(const char *pathname) {
MODULE_SCOPE void *tclpkcs11_int_load_module(const char *pathname, Tcl_Interp *interp) {
#if defined(TCL_INCLUDES_LOADFILE)
	int tcl_rv;
	Tcl_Obj *pathnameObj;
	Tcl_LoadHandle *new_handle;

	new_handle = (Tcl_LoadHandle *) ckalloc(sizeof(*new_handle));

	pathnameObj = Tcl_NewStringObj(pathname, -1);

	Tcl_IncrRefCount(pathnameObj);

	tcl_rv = Tcl_LoadFile(NULL, pathnameObj, NULL, 0, NULL, new_handle);
	tcl_rv = Tcl_LoadFile(interp, pathnameObj, NULL, 0, NULL, new_handle);

	Tcl_DecrRefCount(pathnameObj);

	if (tcl_rv != TCL_OK) {
		return(NULL);
	}

528
529
530
531
532
533
534
535

536
537
538
539
540
541
542
528
529
530
531
532
533
534

535
536
537
538
539
540
541
542







-
+







	pathname = Tcl_GetString(objv[1]);
	if (!pathname) {
		Tcl_SetObjResult(interp, Tcl_NewStringObj("invalid pathname", -1));

		return(TCL_ERROR);
	}

	handle = tclpkcs11_int_load_module(pathname);
	handle = tclpkcs11_int_load_module(pathname, interp);
	if (!handle) {
		Tcl_SetObjResult(interp, Tcl_NewStringObj("unable to load", -1));

		return(TCL_ERROR);
	}

	getFuncList = tclpkcs11_int_lookup_sym(handle, "C_GetFunctionList");