538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
|
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
|
+
-
+
-
-
-
-
-
-
-
-
+
-
-
-
+
+
+
-
-
-
-
|
int code;
Tcl_Size len;
dprintf("Called");
/* If no callback, use default callback */
if (statePtr->password == NULL) {
cmdPtr = Tcl_NewListObj(0, NULL);
if (Tcl_EvalEx(interp, "tls::password", -1, TCL_EVAL_GLOBAL) == TCL_OK) {
Tcl_ListObjAppendElement(interp, cmdPtr, Tcl_NewStringObj("tls::password", -1));
char *ret = (char *) Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &len);
if (len > (Tcl_Size) size-1) {
len = (Tcl_Size) size-1;
}
strncpy(buf, ret, (size_t) len);
buf[len] = '\0';
return (int) len;
} else {
} else {
return -1;
}
}
cmdPtr = Tcl_DuplicateObj(statePtr->password);
}
dprintf("PasswordCallback: create callback command");
/* Create command to eval with fn, rwflag, and size args */
cmdPtr = Tcl_DuplicateObj(statePtr->password);
Tcl_ListObjAppendElement(interp, cmdPtr, Tcl_NewStringObj("password", -1));
Tcl_ListObjAppendElement(interp, cmdPtr, Tcl_NewIntObj(rwflag));
Tcl_ListObjAppendElement(interp, cmdPtr, Tcl_NewIntObj(size));
dprintf("PasswordCallback: eval callback");
Tcl_Preserve((void *) interp);
|