1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
|
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
|
-
+
|
Tcl_Obj *tcl_mode, *tcl_input;
Tcl_Obj *tcl_handle = NULL, *tcl_slotid = NULL, *tcl_objid = NULL;
Tcl_Obj *tcl_result;
long slotid_long;
int tcl_keylist_llength, idx;
int input_len;
CK_ULONG resultbuf_len;
int sign;
int sign, terminate;
int tcl_rv;
CK_SLOT_ID slotid;
CK_OBJECT_HANDLE hObject;
CK_ULONG foundObjs;
CK_OBJECT_CLASS objectclass_pk;
CK_ATTRIBUTE template[] = {
|
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
|
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
|
+
+
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
|
}
}
}
}
chk_rv = handle->pkcs11->C_Sign(handle->session, input, input_len, resultbuf, &resultbuf_len);
}
terminate = 0;
if (chk_rv != CKR_OK) {
if (chk_rv == CKR_OK) {
terminate = 1;
} else {
if (chk_rv == CKR_BUFFER_TOO_SMALL) {
/* Terminate decryption operation */
handle->pkcs11->C_DecryptFinal(handle->session, NULL, 0);
terminate = 1;
}
}
if (terminate) {
if (!sign) {
handle->pkcs11->C_EncryptFinal(handle->session, NULL, 0);
} else {
handle->pkcs11->C_SignFinal(handle->session, NULL, 0);
}
}
if (chk_rv != CKR_OK) {
Tcl_SetObjResult(interp, tclpkcs11_pkcs11_error(chk_rv));
return(TCL_ERROR);
}
} else {
chk_rv = handle->pkcs11->C_DecryptInit(handle->session, &mechanism, hObject);
if (chk_rv != CKR_OK) {
|