Index: generic/tlsEncrypt.c ================================================================== --- generic/tlsEncrypt.c +++ generic/tlsEncrypt.c @@ -803,10 +803,13 @@ /* Make sure to operate on the topmost channel */ chan = Tcl_GetTopChannel(chan); /* Configure channel */ Tcl_SetChannelOption(interp, chan, "-translation", "binary"); + if (Tcl_GetChannelBufferSize(chan) < EVP_MAX_BLOCK_LENGTH) { + Tcl_SetChannelBufferSize(chan, EVP_MAX_BLOCK_LENGTH); + } /* Create state data structure */ if ((statePtr = EncryptStateNew(interp, type)) == NULL) { Tcl_AppendResult(interp, "Memory allocation error", (char *) NULL); return TCL_ERROR; @@ -825,12 +828,14 @@ if (statePtr->self == (Tcl_Channel) NULL) { EncryptStateFree(statePtr); return TCL_ERROR; } + dprintf("Created channel named %s", Tcl_GetChannelName(statePtr->self)); + /* Set result to channel Id */ - Tcl_SetResult(interp, (char *) Tcl_GetChannelName(chan), TCL_VOLATILE); + Tcl_SetResult(interp, (char *) Tcl_GetChannelName(statePtr->self), TCL_VOLATILE); return TCL_OK; } /* *----------------------------------------------------------------------