Artifact 02913f3b74dc80bbcb89cdcfbdf83918cfaa1818:
- File ChangeLog — part of check-in [fb9a612600] at 2000-07-11 04:58:45 on branch tls-1-3-io-rewrite — * tlsBIO.c (BioWrite, BioRead): changed Tcl_Read/Write to Tcl_ReadRaw/TclWriteRaw. * tls.c: added use of Tcl_GetTopChannel after Tcl_GetChannel and got return value from Tcl_StackChannel. * tests/tlsIO.test: added some handshaking that shouldn't be necessary, but we crash otherwise (needs more testing). * tlsIO.c: added support for "corrected" stacked channels. All the above channels are in TCL_CHANNEL_VERSION_2 #ifdefs. (user: hobbs, size: 2234) [annotate] [blame] [check-ins using]
 
0000: 32 30 30 30 2d 30 37 2d 31 30 20 20 4a 65 66 66 2000-07-10 Jeff 0010: 20 48 6f 62 62 73 20 20 3c 68 6f 62 62 73 40 73 Hobbs <hobbs@s 0020: 63 72 69 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 criptics.com>... 0030: 2a 20 74 6c 73 42 49 4f 2e 63 20 28 42 69 6f 57 * tlsBIO.c (BioW 0040: 72 69 74 65 2c 20 42 69 6f 52 65 61 64 29 3a 20 rite, BioRead): 0050: 63 68 61 6e 67 65 64 20 54 63 6c 5f 52 65 61 64 changed Tcl_Read 0060: 2f 57 72 69 74 65 20 74 6f 0a 09 54 63 6c 5f 52 /Write to..Tcl_R 0070: 65 61 64 52 61 77 2f 54 63 6c 57 72 69 74 65 52 eadRaw/TclWriteR 0080: 61 77 2e 0a 0a 09 2a 20 74 6c 73 2e 63 3a 20 61 aw....* tls.c: a 0090: 64 64 65 64 20 75 73 65 20 6f 66 20 54 63 6c 5f dded use of Tcl_ 00a0: 47 65 74 54 6f 70 43 68 61 6e 6e 65 6c 20 61 66 GetTopChannel af 00b0: 74 65 72 20 54 63 6c 5f 47 65 74 43 68 61 6e 6e ter Tcl_GetChann 00c0: 65 6c 20 61 6e 64 0a 09 67 6f 74 20 72 65 74 75 el and..got retu 00d0: 72 6e 20 76 61 6c 75 65 20 66 72 6f 6d 20 54 63 rn value from Tc 00e0: 6c 5f 53 74 61 63 6b 43 68 61 6e 6e 65 6c 2e 0a l_StackChannel.. 00f0: 0a 09 2a 20 74 65 73 74 73 2f 74 6c 73 49 4f 2e ..* tests/tlsIO. 0100: 74 65 73 74 3a 20 61 64 64 65 64 20 73 6f 6d 65 test: added some 0110: 20 68 61 6e 64 73 68 61 6b 69 6e 67 20 74 68 61 handshaking tha 0120: 74 20 73 68 6f 75 6c 64 6e 27 74 20 62 65 0a 09 t shouldn't be.. 0130: 6e 65 63 65 73 73 61 72 79 2c 20 62 75 74 20 77 necessary, but w 0140: 65 20 63 72 61 73 68 20 6f 74 68 65 72 77 69 73 e crash otherwis 0150: 65 20 28 6e 65 65 64 73 20 6d 6f 72 65 20 74 65 e (needs more te 0160: 73 74 69 6e 67 29 2e 0a 0a 09 2a 20 74 6c 73 49 sting)....* tlsI 0170: 4f 2e 63 3a 20 61 64 64 65 64 20 73 75 70 70 6f O.c: added suppo 0180: 72 74 20 66 6f 72 20 22 63 6f 72 72 65 63 74 65 rt for "correcte 0190: 64 22 20 73 74 61 63 6b 65 64 20 63 68 61 6e 6e d" stacked chann 01a0: 65 6c 73 2e 20 20 41 6c 6c 0a 09 74 68 65 20 61 els. All..the a 01b0: 62 6f 76 65 20 63 68 61 6e 6e 65 6c 73 20 61 72 bove channels ar 01c0: 65 20 69 6e 20 54 43 4c 5f 43 48 41 4e 4e 45 4c e in TCL_CHANNEL 01d0: 5f 56 45 52 53 49 4f 4e 5f 32 20 23 69 66 64 65 _VERSION_2 #ifde 01e0: 66 73 2e 0a 0a 32 30 30 30 2d 30 36 2d 30 35 20 fs...2000-06-05 01f0: 20 53 63 6f 74 74 20 53 74 61 6e 74 6f 6e 20 20 Scott Stanton 0200: 3c 73 74 61 6e 74 6f 6e 40 61 6a 75 62 61 73 6f <stanton@ajubaso 0210: 6c 75 74 69 6f 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a lutions.com>...* 0220: 20 4d 61 6b 65 66 69 6c 65 2e 69 6e 3a 20 46 69 Makefile.in: Fi 0230: 78 65 64 20 62 72 6f 6b 65 6e 20 74 65 73 74 20 xed broken test 0240: 74 61 72 67 65 74 2e 0a 0a 09 2a 20 74 6c 73 49 target....* tlsI 0250: 6e 74 2e 68 3a 20 0a 09 2a 20 74 6c 73 2e 63 3a nt.h: ..* tls.c: 0260: 20 43 6c 65 61 6e 65 64 20 75 70 20 64 65 63 6c Cleaned up decl 0270: 61 72 61 74 69 6f 6e 73 20 6f 66 20 54 6c 73 5f arations of Tls_ 0280: 43 6c 65 61 6e 20 74 6f 20 61 76 6f 69 64 20 65 Clean to avoid e 0290: 72 72 6f 72 73 20 6f 6e 0a 09 57 69 6e 64 6f 77 rrors on..Window 02a0: 73 20 28 6c 69 6e 74 29 2e 0a 0a 32 30 30 30 2d s (lint)...2000- 02b0: 30 36 2d 30 35 20 20 42 72 65 6e 74 20 57 65 6c 06-05 Brent Wel 02c0: 63 68 20 3c 77 65 6c 63 68 40 61 6a 75 62 61 73 ch <welch@ajubas 02d0: 6f 6c 75 74 69 6f 6e 73 2e 63 6f 6d 3e 0a 0a 09 olutions.com>... 02e0: 2a 20 74 6c 73 2e 63 2c 20 74 6c 73 49 4f 2e 63 * tls.c, tlsIO.c 02f0: 3a 20 20 53 70 6c 69 74 20 54 6c 73 5f 46 72 65 : Split Tls_Fre 0300: 65 20 69 6e 74 6f 20 54 6c 73 5f 43 6c 65 61 6e e into Tls_Clean 0310: 2c 20 77 68 69 63 68 20 64 6f 65 73 0a 09 74 68 , which does..th 0320: 65 20 53 53 4c 20 63 6c 65 61 6e 75 70 2c 20 61 e SSL cleanup, a 0330: 6e 64 20 74 68 65 20 54 63 6c 5f 46 72 65 65 20 nd the Tcl_Free 0340: 63 61 6c 6c 2e 20 20 49 74 20 69 73 20 69 6d 70 call. It is imp 0350: 6f 72 74 61 6e 74 20 74 6f 20 73 68 75 74 64 6f ortant to shutdo 0360: 77 6e 0a 09 74 68 65 20 53 53 4c 20 73 74 61 74 wn..the SSL stat 0370: 65 20 22 73 79 6e 63 68 72 6f 6e 6f 75 73 6c 79 e "synchronously 0380: 22 20 64 75 72 69 6e 67 20 61 20 73 74 61 63 6b " during a stack 0390: 65 64 20 66 6c 75 73 68 2e 0a 0a 32 30 30 30 2d ed flush...2000- 03a0: 30 36 2d 30 31 20 20 53 63 6f 74 74 20 53 74 61 06-01 Scott Sta 03b0: 6e 74 6f 6e 20 20 3c 73 74 61 6e 74 6f 6e 40 61 nton <stanton@a 03c0: 6a 75 62 61 73 6f 6c 75 74 69 6f 6e 73 2e 63 6f jubasolutions.co 03d0: 6d 3e 0a 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 20 m>...* tlsIO.c: 03e0: 52 65 73 74 6f 72 65 64 20 63 61 6c 6c 20 74 6f Restored call to 03f0: 20 54 63 6c 5f 4e 6f 74 69 66 79 43 68 61 6e 6e Tcl_NotifyChann 0400: 65 6c 20 66 72 6f 6d 20 43 68 61 6e 6e 65 6c 48 el from ChannelH 0410: 61 6e 64 6c 65 72 0a 09 74 6f 20 65 6e 73 75 72 andler..to ensur 0420: 65 20 74 68 61 74 20 65 76 65 6e 74 73 20 70 72 e that events pr 0430: 6f 70 61 67 61 74 65 20 66 72 6f 6d 20 74 68 65 opagate from the 0440: 20 6c 6f 77 65 72 20 64 72 69 76 65 72 2e 20 20 lower driver. 0450: 54 68 69 73 20 6d 61 79 0a 09 72 65 73 75 6c 74 This may..result 0460: 20 69 6e 20 61 6e 20 69 6e 66 69 6e 69 74 65 20 in an infinite 0470: 6c 6f 6f 70 20 69 6e 20 73 6f 6d 65 20 63 61 73 loop in some cas 0480: 65 73 2c 20 73 6f 20 74 68 69 73 20 69 73 20 6e es, so this is n 0490: 6f 74 20 61 20 74 6f 74 61 6c 0a 09 66 69 78 2e ot a total..fix. 04a0: 20 20 54 68 69 73 20 6d 61 79 20 62 65 20 73 75 This may be su 04b0: 66 66 69 63 69 65 6e 74 20 66 6f 72 20 6e 6f 77 fficient for now 04c0: 2c 20 68 6f 77 65 76 65 72 2e 20 5b 42 75 67 3a , however. [Bug: 04d0: 20 35 36 32 33 5d 0a 0a 32 30 30 30 2d 30 36 2d 5623]..2000-06- 04e0: 30 31 20 20 53 63 6f 74 74 20 53 74 61 6e 74 6f 01 Scott Stanto 04f0: 6e 20 20 3c 73 74 61 6e 74 6f 6e 40 73 63 72 69 n <stanton@scri 0500: 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 ptics.com>...* t 0510: 6c 73 49 4f 2e 63 3a 20 52 65 73 74 6f 72 65 20 lsIO.c: Restore 0520: 74 68 65 20 70 72 65 76 69 6f 75 73 20 76 65 72 the previous ver 0530: 73 69 6f 6e 2e 20 20 46 69 78 65 64 20 74 68 65 sion. Fixed the 0540: 20 43 6c 6f 73 65 50 72 6f 63 20 73 6f 0a 09 69 CloseProc so..i 0550: 74 20 75 6e 72 65 67 69 73 74 65 72 73 20 74 68 t unregisters th 0560: 65 20 63 68 61 6e 6e 65 6c 20 68 61 6e 64 6c 65 e channel handle 0570: 72 20 6f 6e 20 74 68 65 20 73 75 70 65 72 63 65 r on the superce 0580: 64 65 64 20 63 68 61 6e 6e 65 6c 0a 09 69 6e 73 ded channel..ins 0590: 74 65 61 64 20 6f 66 20 74 68 65 20 75 70 70 65 tead of the uppe 05a0: 72 20 63 68 61 6e 6e 65 6c 2e 20 41 6c 73 6f 20 r channel. Also 05b0: 72 65 6d 6f 76 65 64 20 74 68 65 20 63 61 6c 6c removed the call 05c0: 20 74 6f 0a 09 54 63 6c 5f 4e 6f 74 69 66 79 43 to..Tcl_NotifyC 05d0: 68 61 6e 6e 65 6c 20 69 6e 20 74 68 65 20 43 68 hannel in the Ch 05e0: 61 6e 6e 65 6c 48 61 6e 64 6c 65 72 20 62 65 63 annelHandler bec 05f0: 61 75 73 65 20 74 68 69 73 20 77 69 6c 6c 20 72 ause this will r 0600: 65 73 75 6c 74 0a 09 69 6e 20 61 6e 20 69 6e 66 esult..in an inf 0610: 69 6e 69 74 65 20 6c 6f 6f 70 20 69 66 20 64 61 inite loop if da 0620: 74 61 20 69 73 20 65 76 65 72 20 62 75 66 66 65 ta is ever buffe 0630: 72 65 64 20 69 6e 20 74 68 65 20 42 49 4f 0a 09 red in the BIO.. 0640: 73 74 72 75 63 74 75 72 65 2e 20 5b 42 75 67 3a structure. [Bug: 0650: 20 35 36 32 33 5d 0a 0a 32 30 30 30 2d 30 35 2d 5623]..2000-05- 0660: 33 31 20 20 42 72 65 6e 74 20 57 65 6c 63 68 20 31 Brent Welch 0670: 3c 77 65 6c 63 68 40 73 63 72 69 70 74 69 63 73 <welch@scriptics 0680: 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 2e 63 3a .com>...* tls.c: 0690: 20 43 68 61 6e 67 65 20 74 68 65 20 43 68 61 6e Change the Chan 06a0: 6e 65 6c 48 61 6e 64 6c 65 72 20 74 6f 20 62 65 nelHandler to be 06b0: 20 72 65 67 69 73 74 65 72 65 64 20 6f 6e 20 74 registered on t 06c0: 68 65 20 6d 61 69 6e 0a 09 63 68 61 6e 6e 65 6c he main..channel 06d0: 20 61 73 20 6f 70 70 73 65 64 20 74 6f 20 74 68 as oppsed to th 06e0: 65 20 22 70 61 72 65 6e 74 22 2c 20 6f 72 20 73 e "parent", or s 06f0: 75 70 65 72 63 65 65 64 65 64 2c 20 63 68 61 6e uperceeded, chan 0700: 6e 65 6c 2e 20 20 54 68 69 73 0a 09 69 73 20 62 nel. This..is b 0710: 65 63 61 75 73 65 20 74 68 65 20 73 6f 63 6b 65 ecause the socke 0720: 74 20 64 72 69 76 65 72 20 6e 6f 74 69 66 69 65 t driver notifie 0730: 73 20 74 68 65 20 6d 61 69 6e 20 63 68 61 6e 6e s the main chann 0740: 65 6c 2c 20 61 6e 64 20 74 68 65 72 65 0a 09 61 el, and there..a 0750: 72 65 20 74 69 6d 65 73 20 77 69 74 68 20 74 68 re times with th 0760: 65 20 6d 61 69 6e 20 63 68 61 6e 6e 65 6c 20 67 e main channel g 0770: 65 74 73 20 63 6c 6f 73 65 64 2c 20 62 75 74 20 ets closed, but 0780: 74 68 65 20 73 75 70 65 72 63 65 64 65 64 0a 09 the superceded.. 0790: 6f 6e 65 20 69 73 20 6e 6f 74 20 79 65 74 20 63 one is not yet c 07a0: 6c 6f 73 65 64 2e 20 20 49 66 20 74 68 65 20 63 losed. If the c 07b0: 68 61 6e 6e 65 6c 20 68 61 6e 64 6c 65 72 20 67 hannel handler g 07c0: 65 74 73 20 74 72 69 67 67 65 72 65 64 20 69 6e ets triggered in 07d0: 0a 09 74 68 69 73 20 68 61 6c 66 2d 6f 70 65 6e ..this half-open 07e0: 20 73 74 61 74 65 20 69 74 20 69 73 20 61 73 73 state it is ass 07f0: 6f 63 69 61 74 65 64 20 77 69 74 68 20 74 68 65 ociated with the 0800: 20 73 75 70 65 72 63 65 65 64 65 64 0a 09 63 68 superceeded..ch 0810: 61 6e 6e 65 64 6c 2c 20 62 75 74 20 75 73 65 73 annedl, but uses 0820: 20 69 74 73 20 70 72 69 76 61 74 65 20 70 6f 69 its private poi 0830: 6e 74 65 72 20 74 6f 20 74 68 65 20 6d 61 69 6e nter to the main 0840: 20 63 68 61 6e 6e 65 6c 2c 20 77 68 69 63 68 0a channel, which. 0850: 09 69 73 20 6d 6f 73 74 6c 79 20 64 65 73 74 72 .is mostly destr 0860: 6f 79 65 64 2e 20 20 45 6c 69 6d 69 6e 61 74 65 oyed. Eliminate 0870: 64 20 74 68 65 20 72 65 64 75 6e 64 61 6e 74 20 d the redundant 0880: 63 61 6c 6c 20 74 6f 0a 09 54 63 6c 5f 4e 6f 74 call to..Tcl_Not 0890: 69 66 79 43 68 61 6e 6e 65 6c 20 66 72 6f 6d 20 ifyChannel from 08a0: 54 6c 73 57 61 74 63 68 50 72 6f 63 2e 20 5b 42 TlsWatchProc. [B 08b0: 75 67 3a 20 35 36 32 33 5d 0a ug: 5623].