Check-in [aa700f94f2]

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

Overview
Comment:Merged in changes from trunk
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tls-1-7
Files: files | file ages | folders
SHA3-256:aa700f94f221f51ad9fc51d4309937de8beecef4057a9832b9a4be8ed86ca7ab
User & Date: rkeene 2018-02-07 15:38:38
Context
2018-02-07
15:38
TclTLS 1.7.16 check-in: 23e328d64b user: rkeene tags: tls-1-7, tls-1-7-16
15:38
Merged in changes from trunk check-in: aa700f94f2 user: rkeene tags: tls-1-7
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:27
TclTLS 1.7.15 check-in: 0f9a47f3b3 user: rkeene tags: tls-1-7, tls-1-7-15
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  +    Tcl_DString upperChannelTranslation, upperChannelBlocking, upperChannelEncoding, upperChannelEOFChar;
   727    726       int idx, len;
   728    727       int flags		= TLS_TCL_INIT;
   729    728       int server		= 0;	/* is connection incoming or outgoing? */
   730    729       char *key		= NULL;
   731    730       char *cert		= NULL;
   732    731       char *ciphers	= NULL;
   733    732       char *CAfile	= NULL;
................................................................................
   886    885        * We need to make sure that the channel works in binary (for the
   887    886        * encryption not to get goofed up).
   888    887        * We only want to adjust the buffering in pre-v2 channels, where
   889    888        * each channel in the stack maintained its own buffers.
   890    889        */
   891    890       Tcl_DStringInit(&upperChannelTranslation);
   892    891       Tcl_DStringInit(&upperChannelBlocking);
          892  +    Tcl_DStringInit(&upperChannelEOFChar);
          893  +    Tcl_DStringInit(&upperChannelEncoding);
          894  +    Tcl_GetChannelOption(interp, chan, "-eofchar", &upperChannelEOFChar);
          895  +    Tcl_GetChannelOption(interp, chan, "-encoding", &upperChannelEncoding);
   893    896       Tcl_GetChannelOption(interp, chan, "-translation", &upperChannelTranslation);
   894    897       Tcl_GetChannelOption(interp, chan, "-blocking", &upperChannelBlocking);
   895    898       Tcl_SetChannelOption(interp, chan, "-translation", "binary");
   896    899       Tcl_SetChannelOption(interp, chan, "-blocking", "true");
   897    900       dprintf("Consuming Tcl channel %s", Tcl_GetChannelName(chan));
   898    901       statePtr->self = Tcl_StackChannel(interp, Tls_ChannelType(), (ClientData) statePtr, (TCL_READABLE | TCL_WRITABLE), chan);
   899    902       dprintf("Created channel named %s", Tcl_GetChannelName(statePtr->self));
................................................................................
   902    905   	 * No use of Tcl_EventuallyFree because no possible Tcl_Preserve.
   903    906   	 */
   904    907   	Tls_Free((char *) statePtr);
   905    908   	return TCL_ERROR;
   906    909       }
   907    910   
   908    911       Tcl_SetChannelOption(interp, statePtr->self, "-translation", Tcl_DStringValue(&upperChannelTranslation));
          912  +    Tcl_SetChannelOption(interp, statePtr->self, "-encoding", Tcl_DStringValue(&upperChannelEncoding));
          913  +    Tcl_SetChannelOption(interp, statePtr->self, "-eofchar", Tcl_DStringValue(&upperChannelEOFChar));
   909    914       Tcl_SetChannelOption(interp, statePtr->self, "-blocking", Tcl_DStringValue(&upperChannelBlocking));
   910    915   
   911    916       /*
   912    917        * SSL Initialization
   913    918        */
   914    919   
   915    920       statePtr->ssl = SSL_new(statePtr->ctx);