Artifact acd3ab6a5a50e33a12a404fb50ee5ca0b393f1c2:
- File ChangeLog — part of check-in [a27c6affe5] at 2000-07-12 01:54:26 on branch tls-1-3-io-rewrite — * tlsIO.c: changed all the channel procs to start with Tls* for better parity when comparing with Transform channel procs. Rewrote TlsWatchProc, added TlsNotifyProc according to the new channel design, which also leaves TlsChannelHandler unused. * tlsBIO.c (BioCtrl): changed BIO_CTRL_FLUSH case to use Tcl_WriteRaw instead of Tcl_Flush (to operate on correct channel in the stack instead of starting at the top again). Would otherwise cause a recursive stack bomb when implicit handshaking took effect. (user: hobbs, size: 2984) [annotate] [blame] [check-ins using]
0000: 32 30 30 30 2d 30 37 2d 31 31 20 20 4a 65 66 66 2000-07-11 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 49 4f 2e 63 3a 20 63 68 61 6e 67 * tlsIO.c: chang 0040: 65 64 20 61 6c 6c 20 74 68 65 20 63 68 61 6e 6e ed all the chann 0050: 65 6c 20 70 72 6f 63 73 20 74 6f 20 73 74 61 72 el procs to star 0060: 74 20 77 69 74 68 20 54 6c 73 2a 20 66 6f 72 0a t with Tls* for. 0070: 09 62 65 74 74 65 72 20 70 61 72 69 74 79 20 77 .better parity w 0080: 68 65 6e 20 63 6f 6d 70 61 72 69 6e 67 20 77 69 hen comparing wi 0090: 74 68 20 54 72 61 6e 73 66 6f 72 6d 20 63 68 61 th Transform cha 00a0: 6e 6e 65 6c 20 70 72 6f 63 73 2e 0a 09 52 65 77 nnel procs...Rew 00b0: 72 6f 74 65 20 54 6c 73 57 61 74 63 68 50 72 6f rote TlsWatchPro 00c0: 63 2c 20 61 64 64 65 64 20 54 6c 73 4e 6f 74 69 c, added TlsNoti 00d0: 66 79 50 72 6f 63 20 61 63 63 6f 72 64 69 6e 67 fyProc according 00e0: 20 74 6f 20 74 68 65 20 6e 65 77 0a 09 63 68 61 to the new..cha 00f0: 6e 6e 65 6c 20 64 65 73 69 67 6e 2c 20 77 68 69 nnel design, whi 0100: 63 68 20 61 6c 73 6f 20 6c 65 61 76 65 73 20 54 ch also leaves T 0110: 6c 73 43 68 61 6e 6e 65 6c 48 61 6e 64 6c 65 72 lsChannelHandler 0120: 20 75 6e 75 73 65 64 2e 0a 0a 09 2a 20 74 6c 73 unused....* tls 0130: 42 49 4f 2e 63 20 28 42 69 6f 43 74 72 6c 29 3a BIO.c (BioCtrl): 0140: 20 63 68 61 6e 67 65 64 20 42 49 4f 5f 43 54 52 changed BIO_CTR 0150: 4c 5f 46 4c 55 53 48 20 63 61 73 65 20 74 6f 20 L_FLUSH case to 0160: 75 73 65 0a 09 54 63 6c 5f 57 72 69 74 65 52 61 use..Tcl_WriteRa 0170: 77 20 69 6e 73 74 65 61 64 20 6f 66 20 54 63 6c w instead of Tcl 0180: 5f 46 6c 75 73 68 20 28 74 6f 20 6f 70 65 72 61 _Flush (to opera 0190: 74 65 20 6f 6e 20 63 6f 72 72 65 63 74 20 63 68 te on correct ch 01a0: 61 6e 6e 65 6c 0a 09 69 6e 20 74 68 65 20 73 74 annel..in the st 01b0: 61 63 6b 20 69 6e 73 74 65 61 64 20 6f 66 20 73 ack instead of s 01c0: 74 61 72 74 69 6e 67 20 61 74 20 74 68 65 20 74 tarting at the t 01d0: 6f 70 20 61 67 61 69 6e 29 2e 20 20 57 6f 75 6c op again). Woul 01e0: 64 0a 09 6f 74 68 65 72 77 69 73 65 20 63 61 75 d..otherwise cau 01f0: 73 65 20 61 20 72 65 63 75 72 73 69 76 65 20 73 se a recursive s 0200: 74 61 63 6b 20 62 6f 6d 62 20 77 68 65 6e 20 69 tack bomb when i 0210: 6d 70 6c 69 63 69 74 20 68 61 6e 64 73 68 61 6b mplicit handshak 0220: 69 6e 67 0a 09 74 6f 6f 6b 20 65 66 66 65 63 74 ing..took effect 0230: 2e 0a 0a 09 2a 20 74 65 73 74 73 2f 74 6c 73 49 ....* tests/tlsI 0240: 4f 2e 74 65 73 74 3a 20 72 65 6d 6f 76 65 64 20 O.test: removed 0250: 63 68 61 6e 67 65 73 20 6d 61 64 65 20 74 6f 20 changes made to 0260: 74 65 73 74 20 73 75 69 74 65 20 28 61 6c 6c 20 test suite (all 0270: 74 65 73 74 73 0a 09 74 68 61 74 20 72 61 6e 20 tests..that ran 0280: 62 65 66 6f 72 65 20 6e 6f 77 20 70 61 73 73 20 before now pass 0290: 63 6f 72 72 65 63 74 6c 79 29 2c 20 61 6e 64 20 correctly), and 02a0: 63 68 61 6e 67 65 64 20 73 6f 6d 65 20 61 63 63 changed some acc 02b0: 65 70 74 20 70 72 6f 63 0a 09 61 72 67 73 20 74 ept proc..args t 02c0: 6f 20 72 65 66 6c 65 63 74 20 74 68 61 74 20 61 o reflect that a 02d0: 20 73 6f 63 6b 20 69 73 20 61 6e 20 61 72 67 2c sock is an arg, 02e0: 20 6e 6f 74 20 61 20 66 69 6c 65 2e 0a 0a 32 30 not a file...20 02f0: 30 30 2d 30 37 2d 31 30 20 20 4a 65 66 66 20 48 00-07-10 Jeff H 0300: 6f 62 62 73 20 20 3c 68 6f 62 62 73 40 73 63 72 obbs <hobbs@scr 0310: 69 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 iptics.com>...* 0320: 74 6c 73 42 49 4f 2e 63 20 28 42 69 6f 57 72 69 tlsBIO.c (BioWri 0330: 74 65 2c 20 42 69 6f 52 65 61 64 29 3a 20 63 68 te, BioRead): ch 0340: 61 6e 67 65 64 20 54 63 6c 5f 52 65 61 64 2f 57 anged Tcl_Read/W 0350: 72 69 74 65 20 74 6f 0a 09 54 63 6c 5f 52 65 61 rite to..Tcl_Rea 0360: 64 52 61 77 2f 54 63 6c 57 72 69 74 65 52 61 77 dRaw/TclWriteRaw 0370: 2e 0a 0a 09 2a 20 74 6c 73 2e 63 3a 20 61 64 64 ....* tls.c: add 0380: 65 64 20 75 73 65 20 6f 66 20 54 63 6c 5f 47 65 ed use of Tcl_Ge 0390: 74 54 6f 70 43 68 61 6e 6e 65 6c 20 61 66 74 65 tTopChannel afte 03a0: 72 20 54 63 6c 5f 47 65 74 43 68 61 6e 6e 65 6c r Tcl_GetChannel 03b0: 20 61 6e 64 0a 09 67 6f 74 20 72 65 74 75 72 6e and..got return 03c0: 20 76 61 6c 75 65 20 66 72 6f 6d 20 54 63 6c 5f value from Tcl_ 03d0: 53 74 61 63 6b 43 68 61 6e 6e 65 6c 2e 0a 0a 09 StackChannel.... 03e0: 2a 20 74 65 73 74 73 2f 74 6c 73 49 4f 2e 74 65 * tests/tlsIO.te 03f0: 73 74 3a 20 61 64 64 65 64 20 73 6f 6d 65 20 68 st: added some h 0400: 61 6e 64 73 68 61 6b 69 6e 67 20 74 68 61 74 20 andshaking that 0410: 73 68 6f 75 6c 64 6e 27 74 20 62 65 0a 09 6e 65 shouldn't be..ne 0420: 63 65 73 73 61 72 79 2c 20 62 75 74 20 77 65 20 cessary, but we 0430: 63 72 61 73 68 20 6f 74 68 65 72 77 69 73 65 20 crash otherwise 0440: 28 6e 65 65 64 73 20 6d 6f 72 65 20 74 65 73 74 (needs more test 0450: 69 6e 67 29 2e 0a 0a 09 2a 20 74 6c 73 49 4f 2e ing)....* tlsIO. 0460: 63 3a 20 61 64 64 65 64 20 73 75 70 70 6f 72 74 c: added support 0470: 20 66 6f 72 20 22 63 6f 72 72 65 63 74 65 64 22 for "corrected" 0480: 20 73 74 61 63 6b 65 64 20 63 68 61 6e 6e 65 6c stacked channel 0490: 73 2e 20 20 41 6c 6c 0a 09 74 68 65 20 61 62 6f s. All..the abo 04a0: 76 65 20 63 68 61 6e 6e 65 6c 73 20 61 72 65 20 ve channels are 04b0: 69 6e 20 54 43 4c 5f 43 48 41 4e 4e 45 4c 5f 56 in TCL_CHANNEL_V 04c0: 45 52 53 49 4f 4e 5f 32 20 23 69 66 64 65 66 73 ERSION_2 #ifdefs 04d0: 2e 0a 0a 32 30 30 30 2d 30 36 2d 30 35 20 20 53 ...2000-06-05 S 04e0: 63 6f 74 74 20 53 74 61 6e 74 6f 6e 20 20 3c 73 cott Stanton <s 04f0: 74 61 6e 74 6f 6e 40 61 6a 75 62 61 73 6f 6c 75 tanton@ajubasolu 0500: 74 69 6f 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 4d tions.com>...* M 0510: 61 6b 65 66 69 6c 65 2e 69 6e 3a 20 46 69 78 65 akefile.in: Fixe 0520: 64 20 62 72 6f 6b 65 6e 20 74 65 73 74 20 74 61 d broken test ta 0530: 72 67 65 74 2e 0a 0a 09 2a 20 74 6c 73 49 6e 74 rget....* tlsInt 0540: 2e 68 3a 20 0a 09 2a 20 74 6c 73 2e 63 3a 20 43 .h: ..* tls.c: C 0550: 6c 65 61 6e 65 64 20 75 70 20 64 65 63 6c 61 72 leaned up declar 0560: 61 74 69 6f 6e 73 20 6f 66 20 54 6c 73 5f 43 6c ations of Tls_Cl 0570: 65 61 6e 20 74 6f 20 61 76 6f 69 64 20 65 72 72 ean to avoid err 0580: 6f 72 73 20 6f 6e 0a 09 57 69 6e 64 6f 77 73 20 ors on..Windows 0590: 28 6c 69 6e 74 29 2e 0a 0a 32 30 30 30 2d 30 36 (lint)...2000-06 05a0: 2d 30 35 20 20 42 72 65 6e 74 20 57 65 6c 63 68 -05 Brent Welch 05b0: 20 3c 77 65 6c 63 68 40 61 6a 75 62 61 73 6f 6c <welch@ajubasol 05c0: 75 74 69 6f 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 utions.com>...* 05d0: 74 6c 73 2e 63 2c 20 74 6c 73 49 4f 2e 63 3a 20 tls.c, tlsIO.c: 05e0: 20 53 70 6c 69 74 20 54 6c 73 5f 46 72 65 65 20 Split Tls_Free 05f0: 69 6e 74 6f 20 54 6c 73 5f 43 6c 65 61 6e 2c 20 into Tls_Clean, 0600: 77 68 69 63 68 20 64 6f 65 73 0a 09 74 68 65 20 which does..the 0610: 53 53 4c 20 63 6c 65 61 6e 75 70 2c 20 61 6e 64 SSL cleanup, and 0620: 20 74 68 65 20 54 63 6c 5f 46 72 65 65 20 63 61 the Tcl_Free ca 0630: 6c 6c 2e 20 20 49 74 20 69 73 20 69 6d 70 6f 72 ll. It is impor 0640: 74 61 6e 74 20 74 6f 20 73 68 75 74 64 6f 77 6e tant to shutdown 0650: 0a 09 74 68 65 20 53 53 4c 20 73 74 61 74 65 20 ..the SSL state 0660: 22 73 79 6e 63 68 72 6f 6e 6f 75 73 6c 79 22 20 "synchronously" 0670: 64 75 72 69 6e 67 20 61 20 73 74 61 63 6b 65 64 during a stacked 0680: 20 66 6c 75 73 68 2e 0a 0a 32 30 30 30 2d 30 36 flush...2000-06 0690: 2d 30 31 20 20 53 63 6f 74 74 20 53 74 61 6e 74 -01 Scott Stant 06a0: 6f 6e 20 20 3c 73 74 61 6e 74 6f 6e 40 61 6a 75 on <stanton@aju 06b0: 62 61 73 6f 6c 75 74 69 6f 6e 73 2e 63 6f 6d 3e basolutions.com> 06c0: 0a 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 20 52 65 ...* tlsIO.c: Re 06d0: 73 74 6f 72 65 64 20 63 61 6c 6c 20 74 6f 20 54 stored call to T 06e0: 63 6c 5f 4e 6f 74 69 66 79 43 68 61 6e 6e 65 6c cl_NotifyChannel 06f0: 20 66 72 6f 6d 20 43 68 61 6e 6e 65 6c 48 61 6e from ChannelHan 0700: 64 6c 65 72 0a 09 74 6f 20 65 6e 73 75 72 65 20 dler..to ensure 0710: 74 68 61 74 20 65 76 65 6e 74 73 20 70 72 6f 70 that events prop 0720: 61 67 61 74 65 20 66 72 6f 6d 20 74 68 65 20 6c agate from the l 0730: 6f 77 65 72 20 64 72 69 76 65 72 2e 20 20 54 68 ower driver. Th 0740: 69 73 20 6d 61 79 0a 09 72 65 73 75 6c 74 20 69 is may..result i 0750: 6e 20 61 6e 20 69 6e 66 69 6e 69 74 65 20 6c 6f n an infinite lo 0760: 6f 70 20 69 6e 20 73 6f 6d 65 20 63 61 73 65 73 op in some cases 0770: 2c 20 73 6f 20 74 68 69 73 20 69 73 20 6e 6f 74 , so this is not 0780: 20 61 20 74 6f 74 61 6c 0a 09 66 69 78 2e 20 20 a total..fix. 0790: 54 68 69 73 20 6d 61 79 20 62 65 20 73 75 66 66 This may be suff 07a0: 69 63 69 65 6e 74 20 66 6f 72 20 6e 6f 77 2c 20 icient for now, 07b0: 68 6f 77 65 76 65 72 2e 20 5b 42 75 67 3a 20 35 however. [Bug: 5 07c0: 36 32 33 5d 0a 0a 32 30 30 30 2d 30 36 2d 30 31 623]..2000-06-01 07d0: 20 20 53 63 6f 74 74 20 53 74 61 6e 74 6f 6e 20 Scott Stanton 07e0: 20 3c 73 74 61 6e 74 6f 6e 40 73 63 72 69 70 74 <stanton@script 07f0: 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 ics.com>...* tls 0800: 49 4f 2e 63 3a 20 52 65 73 74 6f 72 65 20 74 68 IO.c: Restore th 0810: 65 20 70 72 65 76 69 6f 75 73 20 76 65 72 73 69 e previous versi 0820: 6f 6e 2e 20 20 46 69 78 65 64 20 74 68 65 20 43 on. Fixed the C 0830: 6c 6f 73 65 50 72 6f 63 20 73 6f 0a 09 69 74 20 loseProc so..it 0840: 75 6e 72 65 67 69 73 74 65 72 73 20 74 68 65 20 unregisters the 0850: 63 68 61 6e 6e 65 6c 20 68 61 6e 64 6c 65 72 20 channel handler 0860: 6f 6e 20 74 68 65 20 73 75 70 65 72 63 65 64 65 on the supercede 0870: 64 20 63 68 61 6e 6e 65 6c 0a 09 69 6e 73 74 65 d channel..inste 0880: 61 64 20 6f 66 20 74 68 65 20 75 70 70 65 72 20 ad of the upper 0890: 63 68 61 6e 6e 65 6c 2e 20 41 6c 73 6f 20 72 65 channel. Also re 08a0: 6d 6f 76 65 64 20 74 68 65 20 63 61 6c 6c 20 74 moved the call t 08b0: 6f 0a 09 54 63 6c 5f 4e 6f 74 69 66 79 43 68 61 o..Tcl_NotifyCha 08c0: 6e 6e 65 6c 20 69 6e 20 74 68 65 20 43 68 61 6e nnel in the Chan 08d0: 6e 65 6c 48 61 6e 64 6c 65 72 20 62 65 63 61 75 nelHandler becau 08e0: 73 65 20 74 68 69 73 20 77 69 6c 6c 20 72 65 73 se this will res 08f0: 75 6c 74 0a 09 69 6e 20 61 6e 20 69 6e 66 69 6e ult..in an infin 0900: 69 74 65 20 6c 6f 6f 70 20 69 66 20 64 61 74 61 ite loop if data 0910: 20 69 73 20 65 76 65 72 20 62 75 66 66 65 72 65 is ever buffere 0920: 64 20 69 6e 20 74 68 65 20 42 49 4f 0a 09 73 74 d in the BIO..st 0930: 72 75 63 74 75 72 65 2e 20 5b 42 75 67 3a 20 35 ructure. [Bug: 5 0940: 36 32 33 5d 0a 0a 32 30 30 30 2d 30 35 2d 33 31 623]..2000-05-31 0950: 20 20 42 72 65 6e 74 20 57 65 6c 63 68 20 3c 77 Brent Welch <w 0960: 65 6c 63 68 40 73 63 72 69 70 74 69 63 73 2e 63 elch@scriptics.c 0970: 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 2e 63 3a 20 43 om>...* tls.c: C 0980: 68 61 6e 67 65 20 74 68 65 20 43 68 61 6e 6e 65 hange the Channe 0990: 6c 48 61 6e 64 6c 65 72 20 74 6f 20 62 65 20 72 lHandler to be r 09a0: 65 67 69 73 74 65 72 65 64 20 6f 6e 20 74 68 65 egistered on the 09b0: 20 6d 61 69 6e 0a 09 63 68 61 6e 6e 65 6c 20 61 main..channel a 09c0: 73 20 6f 70 70 73 65 64 20 74 6f 20 74 68 65 20 s oppsed to the 09d0: 22 70 61 72 65 6e 74 22 2c 20 6f 72 20 73 75 70 "parent", or sup 09e0: 65 72 63 65 65 64 65 64 2c 20 63 68 61 6e 6e 65 erceeded, channe 09f0: 6c 2e 20 20 54 68 69 73 0a 09 69 73 20 62 65 63 l. This..is bec 0a00: 61 75 73 65 20 74 68 65 20 73 6f 63 6b 65 74 20 ause the socket 0a10: 64 72 69 76 65 72 20 6e 6f 74 69 66 69 65 73 20 driver notifies 0a20: 74 68 65 20 6d 61 69 6e 20 63 68 61 6e 6e 65 6c the main channel 0a30: 2c 20 61 6e 64 20 74 68 65 72 65 0a 09 61 72 65 , and there..are 0a40: 20 74 69 6d 65 73 20 77 69 74 68 20 74 68 65 20 times with the 0a50: 6d 61 69 6e 20 63 68 61 6e 6e 65 6c 20 67 65 74 main channel get 0a60: 73 20 63 6c 6f 73 65 64 2c 20 62 75 74 20 74 68 s closed, but th 0a70: 65 20 73 75 70 65 72 63 65 64 65 64 0a 09 6f 6e e superceded..on 0a80: 65 20 69 73 20 6e 6f 74 20 79 65 74 20 63 6c 6f e is not yet clo 0a90: 73 65 64 2e 20 20 49 66 20 74 68 65 20 63 68 61 sed. If the cha 0aa0: 6e 6e 65 6c 20 68 61 6e 64 6c 65 72 20 67 65 74 nnel handler get 0ab0: 73 20 74 72 69 67 67 65 72 65 64 20 69 6e 0a 09 s triggered in.. 0ac0: 74 68 69 73 20 68 61 6c 66 2d 6f 70 65 6e 20 73 this half-open s 0ad0: 74 61 74 65 20 69 74 20 69 73 20 61 73 73 6f 63 tate it is assoc 0ae0: 69 61 74 65 64 20 77 69 74 68 20 74 68 65 20 73 iated with the s 0af0: 75 70 65 72 63 65 65 64 65 64 0a 09 63 68 61 6e uperceeded..chan 0b00: 6e 65 64 6c 2c 20 62 75 74 20 75 73 65 73 20 69 nedl, but uses i 0b10: 74 73 20 70 72 69 76 61 74 65 20 70 6f 69 6e 74 ts private point 0b20: 65 72 20 74 6f 20 74 68 65 20 6d 61 69 6e 20 63 er to the main c 0b30: 68 61 6e 6e 65 6c 2c 20 77 68 69 63 68 0a 09 69 hannel, which..i 0b40: 73 20 6d 6f 73 74 6c 79 20 64 65 73 74 72 6f 79 s mostly destroy 0b50: 65 64 2e 20 20 45 6c 69 6d 69 6e 61 74 65 64 20 ed. Eliminated 0b60: 74 68 65 20 72 65 64 75 6e 64 61 6e 74 20 63 61 the redundant ca 0b70: 6c 6c 20 74 6f 0a 09 54 63 6c 5f 4e 6f 74 69 66 ll to..Tcl_Notif 0b80: 79 43 68 61 6e 6e 65 6c 20 66 72 6f 6d 20 54 6c yChannel from Tl 0b90: 73 57 61 74 63 68 50 72 6f 63 2e 20 5b 42 75 67 sWatchProc. [Bug 0ba0: 3a 20 35 36 32 33 5d 0a : 5623].