Check-in [a811816bd3]
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Merged in changes to address [f798e2ea12]. The code to manipulate the channel options may not be needed at all, we will review it to see if there are any issues with removing it altogether
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a811816bd3f4938614f8c9c2052c711d1e7b614681f295ac05622a7980069867
User & Date: rkeene 2017-12-21 20:25:31
Context
2018-02-07
15:37
Updated to reset "eofchar" and "encoding" when importing channels as well as translation and blocking (part of [f798e2ea12]) check-in: 1d757f7e2d user: rkeene tags: trunk
2017-12-21
20:26
Merged in changes from trunk check-in: 57a047ac4b user: rkeene tags: tls-1-7
20:25
Merged in changes to address [f798e2ea12]. The code to manipulate the channel options may not be needed at all, we will review it to see if there are any issues with removing it altogether check-in: a811816bd3 user: rkeene tags: trunk
05:34
Added experiment patch for [f798e2ea12] to preserve channel state when importing a channel Closed-Leaf check-in: 60f37290f3 user: rkeene tags: bug-f798e2ea12
2017-10-17
03:57
Updated to use a more commonly accepted regexp when replacing the OpenSSL function name (addresses [6c9bf49455]) check-in: 12bf5e37e0 user: rkeene tags: trunk
Changes

Changes to tls.c.

   718    718       Tcl_Obj *CONST objv[];
   719    719   {
   720    720       Tcl_Channel chan;		/* The channel to set a mode on. */
   721    721       State *statePtr;		/* client state for ssl socket */
   722    722       SSL_CTX *ctx	= NULL;
   723    723       Tcl_Obj *script	= NULL;
   724    724       Tcl_Obj *password	= NULL;
          725  +    Tcl_DString upperChannelTranslation;
          726  +    Tcl_DString upperChannelBlocking;
   725    727       int idx, len;
   726    728       int flags		= TLS_TCL_INIT;
   727    729       int server		= 0;	/* is connection incoming or outgoing? */
   728    730       char *key		= NULL;
   729    731       char *cert		= NULL;
   730    732       char *ciphers	= NULL;
   731    733       char *CAfile	= NULL;
................................................................................
   882    884   
   883    885       /*
   884    886        * We need to make sure that the channel works in binary (for the
   885    887        * encryption not to get goofed up).
   886    888        * We only want to adjust the buffering in pre-v2 channels, where
   887    889        * each channel in the stack maintained its own buffers.
   888    890        */
          891  +    Tcl_DStringInit(&upperChannelTranslation);
          892  +    Tcl_DStringInit(&upperChannelBlocking);
          893  +    Tcl_GetChannelOption(interp, chan, "-translation", &upperChannelTranslation);
          894  +    Tcl_GetChannelOption(interp, chan, "-blocking", &upperChannelBlocking);
   889    895       Tcl_SetChannelOption(interp, chan, "-translation", "binary");
   890    896       Tcl_SetChannelOption(interp, chan, "-blocking", "true");
   891    897       dprintf("Consuming Tcl channel %s", Tcl_GetChannelName(chan));
   892    898       statePtr->self = Tcl_StackChannel(interp, Tls_ChannelType(), (ClientData) statePtr, (TCL_READABLE | TCL_WRITABLE), chan);
   893    899       dprintf("Created channel named %s", Tcl_GetChannelName(statePtr->self));
   894    900       if (statePtr->self == (Tcl_Channel) NULL) {
   895    901   	/*
   896    902   	 * No use of Tcl_EventuallyFree because no possible Tcl_Preserve.
   897    903   	 */
   898    904   	Tls_Free((char *) statePtr);
   899    905   	return TCL_ERROR;
   900    906       }
          907  +
          908  +    Tcl_SetChannelOption(interp, statePtr->self, "-translation", Tcl_DStringValue(&upperChannelTranslation));
          909  +    Tcl_SetChannelOption(interp, statePtr->self, "-blocking", Tcl_DStringValue(&upperChannelBlocking));
   901    910   
   902    911       /*
   903    912        * SSL Initialization
   904    913        */
   905    914   
   906    915       statePtr->ssl = SSL_new(statePtr->ctx);
   907    916       if (!statePtr->ssl) {