Artifact 2accd518be3a7b7a27bfca1040f91b1f14199435:
- File ChangeLog — part of check-in [e64e21d80e] at 2000-07-26 22:15:07 on branch tls-1-3-io-rewrite — * tls.c (ImportObjCmd): removed unnecessary use of 'bio' arg. (Tls_Init): check return value of SSL_library_init. Also lots of whitespace cleanup (more like Tcl Eng style guide), but not all code was cleaned up. * tlsBIO.c: minor whitespace cleanup * tlsIO.c: minor whitespace cleanup. (TlsInputProc, TlsOutputProc): Added ERR_clear_error before calls to BIO_read or BIO_write, because we could otherwise end up pulling an error off the stack that didn't belong to us. Also cleanup up excessive use of gotos. (user: hobbs, size: 4789) [annotate] [blame] [check-ins using]
 
0000: 32 30 30 30 2d 30 37 2d 32 36 20 20 4a 65 66 66 2000-07-26 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 2e 63 20 28 49 6d 70 6f 72 74 4f * tls.c (ImportO 0040: 62 6a 43 6d 64 29 3a 20 72 65 6d 6f 76 65 64 20 bjCmd): removed 0050: 75 6e 6e 65 63 65 73 73 61 72 79 20 75 73 65 20 unnecessary use 0060: 6f 66 20 27 62 69 6f 27 20 61 72 67 2e 0a 09 28 of 'bio' arg...( 0070: 54 6c 73 5f 49 6e 69 74 29 3a 20 63 68 65 63 6b Tls_Init): check 0080: 20 72 65 74 75 72 6e 20 76 61 6c 75 65 20 6f 66 return value of 0090: 20 53 53 4c 5f 6c 69 62 72 61 72 79 5f 69 6e 69 SSL_library_ini 00a0: 74 2e 20 20 41 6c 73 6f 20 6c 6f 74 73 20 6f 66 t. Also lots of 00b0: 0a 09 77 68 69 74 65 73 70 61 63 65 20 63 6c 65 ..whitespace cle 00c0: 61 6e 75 70 20 28 6d 6f 72 65 20 6c 69 6b 65 20 anup (more like 00d0: 54 63 6c 20 45 6e 67 20 73 74 79 6c 65 20 67 75 Tcl Eng style gu 00e0: 69 64 65 29 2c 20 62 75 74 20 6e 6f 74 20 61 6c ide), but not al 00f0: 6c 0a 09 63 6f 64 65 20 77 61 73 20 63 6c 65 61 l..code was clea 0100: 6e 65 64 20 75 70 2e 0a 0a 09 2a 20 74 6c 73 42 ned up....* tlsB 0110: 49 4f 2e 63 3a 20 6d 69 6e 6f 72 20 77 68 69 74 IO.c: minor whit 0120: 65 73 70 61 63 65 20 63 6c 65 61 6e 75 70 0a 0a espace cleanup.. 0130: 09 2a 20 74 6c 73 49 4f 2e 63 3a 20 6d 69 6e 6f .* tlsIO.c: mino 0140: 72 20 77 68 69 74 65 73 70 61 63 65 20 63 6c 65 r whitespace cle 0150: 61 6e 75 70 2e 0a 09 28 54 6c 73 49 6e 70 75 74 anup...(TlsInput 0160: 50 72 6f 63 2c 20 54 6c 73 4f 75 74 70 75 74 50 Proc, TlsOutputP 0170: 72 6f 63 29 3a 20 41 64 64 65 64 20 45 52 52 5f roc): Added ERR_ 0180: 63 6c 65 61 72 5f 65 72 72 6f 72 20 62 65 66 6f clear_error befo 0190: 72 65 20 63 61 6c 6c 73 0a 09 74 6f 20 42 49 4f re calls..to BIO 01a0: 5f 72 65 61 64 20 6f 72 20 42 49 4f 5f 77 72 69 _read or BIO_wri 01b0: 74 65 2c 20 62 65 63 61 75 73 65 20 77 65 20 63 te, because we c 01c0: 6f 75 6c 64 20 6f 74 68 65 72 77 69 73 65 20 65 ould otherwise e 01d0: 6e 64 20 75 70 0a 09 70 75 6c 6c 69 6e 67 20 61 nd up..pulling a 01e0: 6e 20 65 72 72 6f 72 20 6f 66 66 20 74 68 65 20 n error off the 01f0: 73 74 61 63 6b 20 74 68 61 74 20 64 69 64 6e 27 stack that didn' 0200: 74 20 62 65 6c 6f 6e 67 20 74 6f 20 75 73 2e 20 t belong to us. 0210: 20 41 6c 73 6f 0a 09 63 6c 65 61 6e 75 70 20 75 Also..cleanup u 0220: 70 20 65 78 63 65 73 73 69 76 65 20 75 73 65 20 p excessive use 0230: 6f 66 20 67 6f 74 6f 73 2e 0a 0a 32 30 30 30 2d of gotos...2000- 0240: 30 37 2d 32 30 20 20 4a 65 66 66 20 48 6f 62 62 07-20 Jeff Hobb 0250: 73 20 20 3c 68 6f 62 62 73 40 73 63 72 69 70 74 s <hobbs@script 0260: 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 65 73 ics.com>...* tes 0270: 74 73 2f 74 6c 73 49 4f 2e 74 65 73 74 3a 20 63 ts/tlsIO.test: c 0280: 6f 72 72 65 63 74 65 64 20 76 61 72 69 6f 75 73 orrected various 0290: 20 74 65 73 74 73 20 74 6f 20 62 65 20 63 6f 72 tests to be cor 02a0: 72 65 63 74 20 66 6f 72 20 54 4c 53 0a 09 73 74 rect for TLS..st 02b0: 61 63 6b 65 64 20 63 68 61 6e 6e 65 6c 73 20 28 acked channels ( 02c0: 61 73 20 6f 70 70 6f 73 65 64 20 74 6f 20 74 68 as opposed to th 02d0: 65 20 73 74 61 6e 64 61 72 64 20 73 6f 63 6b 65 e standard socke 02e0: 74 73 20 74 68 65 20 74 65 73 74 0a 09 73 75 69 ts the test..sui 02f0: 74 65 20 77 61 73 20 61 64 6f 70 74 65 64 20 66 te was adopted f 0300: 72 6f 6d 29 2e 20 20 4b 65 79 20 64 69 66 66 65 rom). Key diffe 0310: 72 65 6e 63 65 73 20 61 72 65 20 74 68 61 74 20 rences are that 0320: 54 4c 53 20 63 61 6e 6e 6f 74 0a 09 6f 70 65 72 TLS cannot..oper 0330: 61 74 65 20 69 6e 20 6f 6e 65 20 70 72 6f 63 65 ate in one proce 0340: 73 73 20 77 69 74 68 6f 75 74 20 61 6c 6c 20 63 ss without all c 0350: 68 61 6e 6e 65 6c 73 20 62 65 69 6e 67 20 6e 6f hannels being no 0360: 6e 2d 62 6c 6f 63 6b 69 6e 67 2c 20 6f 72 0a 09 n-blocking, or.. 0370: 74 68 65 20 68 61 6e 64 73 68 61 6b 65 20 77 69 the handshake wi 0380: 6c 6c 20 62 6c 6f 63 6b 2c 20 61 6e 64 20 68 61 ll block, and ha 0390: 6e 64 73 68 61 6b 69 6e 67 20 6d 75 73 74 20 62 ndshaking must b 03a0: 65 20 66 6f 72 63 65 64 20 69 6e 20 73 6f 6d 65 e forced in some 03b0: 0a 09 63 61 73 65 73 2e 20 20 41 6c 73 6f 2c 20 ..cases. Also, 03c0: 68 61 6e 64 73 68 61 6b 65 73 20 64 6f 6e 27 74 handshakes don't 03d0: 20 73 65 65 6d 20 74 6f 20 63 6f 6d 70 6c 65 74 seem to complet 03e0: 65 20 75 6e 6c 65 73 73 20 74 68 65 20 63 6c 69 e unless the cli 03f0: 65 6e 74 0a 09 68 61 73 20 70 6c 61 63 65 64 20 ent..has placed 0400: 61 74 20 6c 65 61 73 74 20 6f 6e 65 20 62 79 74 at least one byt 0410: 65 20 66 6f 72 20 74 68 65 20 73 65 72 76 65 72 e for the server 0420: 20 74 6f 20 72 65 61 64 20 69 6e 20 74 68 65 20 to read in the 0430: 63 68 61 6e 6e 65 6c 2e 0a 0a 09 2a 20 74 65 73 channel....* tes 0440: 74 73 2f 72 65 6d 6f 74 65 2e 74 63 6c 3a 20 63 ts/remote.tcl: c 0450: 6f 72 72 65 63 74 65 64 20 74 68 65 20 66 69 6e orrected the fin 0460: 64 69 6e 67 20 6f 66 20 74 65 73 74 73 20 63 65 ding of tests ce 0470: 72 74 69 66 69 63 61 74 65 73 0a 0a 09 2a 20 74 rtificates...* t 0480: 6c 73 49 4f 2e 63 20 28 54 6c 73 43 6c 6f 73 65 lsIO.c (TlsClose 0490: 50 72 6f 63 29 3a 20 72 65 6d 6f 76 65 64 20 64 Proc): removed d 04a0: 65 6c 65 74 69 6e 67 20 6f 66 20 74 69 6d 65 72 eleting of timer 04b0: 20 68 61 6e 64 6c 65 72 20 61 73 0a 09 74 68 61 handler as..tha 04c0: 74 20 69 73 20 68 61 6e 64 6c 65 64 20 62 79 20 t is handled by 04d0: 54 6c 73 5f 43 6c 65 61 6e 2e 0a 0a 09 2a 20 74 Tls_Clean....* t 04e0: 6c 73 2e 74 63 6c 20 28 74 6c 73 3a 3a 5f 61 63 ls.tcl (tls::_ac 04f0: 63 65 70 74 29 3a 20 63 6f 72 72 65 63 74 65 64 cept): corrected 0500: 20 74 68 65 20 69 6e 74 65 72 6e 61 6c 20 5f 61 the internal _a 0510: 63 63 65 70 74 20 74 6f 0a 09 74 72 69 63 6b 6c ccept to..trickl 0520: 65 20 63 61 6c 6c 62 61 63 6b 20 65 72 72 6f 72 e callback error 0530: 73 20 74 6f 20 74 68 65 20 75 73 65 72 2e 0a 0a s to the user... 0540: 09 2a 20 4d 61 6b 65 66 69 6c 65 2e 69 6e 3a 20 .* Makefile.in: 0550: 6d 61 64 65 20 74 68 65 20 69 6e 73 74 61 6c 6c made the install 0560: 2d 62 69 6e 61 72 69 65 73 20 74 61 72 67 65 74 -binaries target 0570: 20 72 65 67 65 6e 65 72 61 74 65 20 74 68 65 0a regenerate the. 0580: 09 70 6b 67 49 6e 64 65 78 2e 74 63 6c 20 63 6f .pkgIndex.tcl co 0590: 72 72 65 63 74 6c 79 2e 20 20 54 68 65 20 74 65 rrectly. The te 05a0: 73 74 20 74 61 72 67 65 74 20 70 72 6f 62 61 62 st target probab 05b0: 6c 79 20 73 68 6f 75 6c 64 6e 27 74 20 73 63 72 ly shouldn't scr 05c0: 65 77 0a 09 69 74 20 75 70 2c 20 62 75 74 20 74 ew..it up, but t 05d0: 68 69 73 20 69 73 20 74 6f 20 62 65 20 6f 6e 20 his is to be on 05e0: 74 68 65 20 73 61 66 65 20 73 69 64 65 2e 0a 0a the safe side... 05f0: 32 30 30 30 2d 30 37 2d 31 37 20 20 4a 65 66 66 2000-07-17 Jeff 0600: 20 48 6f 62 62 73 20 20 3c 68 6f 62 62 73 40 73 Hobbs <hobbs@s 0610: 63 72 69 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 criptics.com>... 0620: 2a 20 70 6b 67 49 6e 64 65 78 2e 74 63 6c 2e 69 * pkgIndex.tcl.i 0630: 6e 3a 0a 09 2a 20 63 6f 6e 66 69 67 75 72 65 2e n:..* configure. 0640: 69 6e 3a 20 75 70 64 61 74 65 64 20 76 65 72 73 in: updated vers 0650: 69 6f 6e 20 74 6f 20 31 2e 34 0a 0a 32 30 30 30 ion to 1.4..2000 0660: 2d 30 37 2d 31 33 20 20 4a 65 66 66 20 48 6f 62 -07-13 Jeff Hob 0670: 62 73 20 20 3c 68 6f 62 62 73 40 73 63 72 69 70 bs <hobbs@scrip 0680: 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 65 tics.com>...* te 0690: 73 74 73 2f 74 6c 73 49 4f 2e 74 65 73 74 3a 20 sts/tlsIO.test: 06a0: 65 6e 61 62 6c 65 64 20 74 65 73 74 73 20 32 2e enabled tests 2. 06b0: 31 30 2c 20 37 2e 5b 31 32 34 35 5d 20 28 74 68 10, 7.[1245] (th 06c0: 65 72 65 20 69 73 20 6e 6f 20 33 29 2c 0a 09 77 ere is no 3),..w 06d0: 68 69 63 68 20 6e 6f 77 20 70 61 73 73 2e 20 20 hich now pass. 06e0: 41 64 64 65 64 20 73 6f 6d 65 20 63 6f 6d 6d 65 Added some comme 06f0: 6e 74 73 20 74 6f 20 6f 74 68 65 72 20 66 61 69 nts to other fai 0700: 6c 69 6e 67 20 74 65 73 74 73 2e 0a 0a 32 30 30 ling tests...200 0710: 30 2d 30 37 2d 31 31 20 20 4a 65 66 66 20 48 6f 0-07-11 Jeff Ho 0720: 62 62 73 20 20 3c 68 6f 62 62 73 40 73 63 72 69 bbs <hobbs@scri 0730: 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 ptics.com>...* t 0740: 6c 73 49 4f 2e 63 3a 20 63 68 61 6e 67 65 64 20 lsIO.c: changed 0750: 61 6c 6c 20 74 68 65 20 63 68 61 6e 6e 65 6c 20 all the channel 0760: 70 72 6f 63 73 20 74 6f 20 73 74 61 72 74 20 77 procs to start w 0770: 69 74 68 20 54 6c 73 2a 20 66 6f 72 0a 09 62 65 ith Tls* for..be 0780: 74 74 65 72 20 70 61 72 69 74 79 20 77 68 65 6e tter parity when 0790: 20 63 6f 6d 70 61 72 69 6e 67 20 77 69 74 68 20 comparing with 07a0: 54 72 61 6e 73 66 6f 72 6d 20 63 68 61 6e 6e 65 Transform channe 07b0: 6c 20 70 72 6f 63 73 2e 0a 09 52 65 77 72 6f 74 l procs...Rewrot 07c0: 65 20 54 6c 73 57 61 74 63 68 50 72 6f 63 2c 20 e TlsWatchProc, 07d0: 61 64 64 65 64 20 54 6c 73 4e 6f 74 69 66 79 50 added TlsNotifyP 07e0: 72 6f 63 20 61 63 63 6f 72 64 69 6e 67 20 74 6f roc according to 07f0: 20 74 68 65 20 6e 65 77 0a 09 63 68 61 6e 6e 65 the new..channe 0800: 6c 20 64 65 73 69 67 6e 2c 20 77 68 69 63 68 20 l design, which 0810: 61 6c 73 6f 20 6c 65 61 76 65 73 20 54 6c 73 43 also leaves TlsC 0820: 68 61 6e 6e 65 6c 48 61 6e 64 6c 65 72 20 75 6e hannelHandler un 0830: 75 73 65 64 2e 0a 0a 09 2a 20 74 6c 73 42 49 4f used....* tlsBIO 0840: 2e 63 20 28 42 69 6f 43 74 72 6c 29 3a 20 63 68 .c (BioCtrl): ch 0850: 61 6e 67 65 64 20 42 49 4f 5f 43 54 52 4c 5f 46 anged BIO_CTRL_F 0860: 4c 55 53 48 20 63 61 73 65 20 74 6f 20 75 73 65 LUSH case to use 0870: 0a 09 54 63 6c 5f 57 72 69 74 65 52 61 77 20 69 ..Tcl_WriteRaw i 0880: 6e 73 74 65 61 64 20 6f 66 20 54 63 6c 5f 46 6c nstead of Tcl_Fl 0890: 75 73 68 20 28 74 6f 20 6f 70 65 72 61 74 65 20 ush (to operate 08a0: 6f 6e 20 63 6f 72 72 65 63 74 20 63 68 61 6e 6e on correct chann 08b0: 65 6c 0a 09 69 6e 20 74 68 65 20 73 74 61 63 6b el..in the stack 08c0: 20 69 6e 73 74 65 61 64 20 6f 66 20 73 74 61 72 instead of star 08d0: 74 69 6e 67 20 61 74 20 74 68 65 20 74 6f 70 20 ting at the top 08e0: 61 67 61 69 6e 29 2e 20 20 57 6f 75 6c 64 0a 09 again). Would.. 08f0: 6f 74 68 65 72 77 69 73 65 20 63 61 75 73 65 20 otherwise cause 0900: 61 20 72 65 63 75 72 73 69 76 65 20 73 74 61 63 a recursive stac 0910: 6b 20 62 6f 6d 62 20 77 68 65 6e 20 69 6d 70 6c k bomb when impl 0920: 69 63 69 74 20 68 61 6e 64 73 68 61 6b 69 6e 67 icit handshaking 0930: 0a 09 74 6f 6f 6b 20 65 66 66 65 63 74 2e 0a 0a ..took effect... 0940: 09 2a 20 74 65 73 74 73 2f 74 6c 73 49 4f 2e 74 .* tests/tlsIO.t 0950: 65 73 74 3a 20 72 65 6d 6f 76 65 64 20 63 68 61 est: removed cha 0960: 6e 67 65 73 20 6d 61 64 65 20 74 6f 20 74 65 73 nges made to tes 0970: 74 20 73 75 69 74 65 20 28 61 6c 6c 20 74 65 73 t suite (all tes 0980: 74 73 0a 09 74 68 61 74 20 72 61 6e 20 62 65 66 ts..that ran bef 0990: 6f 72 65 20 6e 6f 77 20 70 61 73 73 20 63 6f 72 ore now pass cor 09a0: 72 65 63 74 6c 79 29 2c 20 61 6e 64 20 63 68 61 rectly), and cha 09b0: 6e 67 65 64 20 73 6f 6d 65 20 61 63 63 65 70 74 nged some accept 09c0: 20 70 72 6f 63 0a 09 61 72 67 73 20 74 6f 20 72 proc..args to r 09d0: 65 66 6c 65 63 74 20 74 68 61 74 20 61 20 73 6f eflect that a so 09e0: 63 6b 20 69 73 20 61 6e 20 61 72 67 2c 20 6e 6f ck is an arg, no 09f0: 74 20 61 20 66 69 6c 65 2e 0a 0a 32 30 30 30 2d t a file...2000- 0a00: 30 37 2d 31 30 20 20 4a 65 66 66 20 48 6f 62 62 07-10 Jeff Hobb 0a10: 73 20 20 3c 68 6f 62 62 73 40 73 63 72 69 70 74 s <hobbs@script 0a20: 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 ics.com>...* tls 0a30: 42 49 4f 2e 63 20 28 42 69 6f 57 72 69 74 65 2c BIO.c (BioWrite, 0a40: 20 42 69 6f 52 65 61 64 29 3a 20 63 68 61 6e 67 BioRead): chang 0a50: 65 64 20 54 63 6c 5f 52 65 61 64 2f 57 72 69 74 ed Tcl_Read/Writ 0a60: 65 20 74 6f 0a 09 54 63 6c 5f 52 65 61 64 52 61 e to..Tcl_ReadRa 0a70: 77 2f 54 63 6c 57 72 69 74 65 52 61 77 2e 0a 0a w/TclWriteRaw... 0a80: 09 2a 20 74 6c 73 2e 63 3a 20 61 64 64 65 64 20 .* tls.c: added 0a90: 75 73 65 20 6f 66 20 54 63 6c 5f 47 65 74 54 6f use of Tcl_GetTo 0aa0: 70 43 68 61 6e 6e 65 6c 20 61 66 74 65 72 20 54 pChannel after T 0ab0: 63 6c 5f 47 65 74 43 68 61 6e 6e 65 6c 20 61 6e cl_GetChannel an 0ac0: 64 0a 09 67 6f 74 20 72 65 74 75 72 6e 20 76 61 d..got return va 0ad0: 6c 75 65 20 66 72 6f 6d 20 54 63 6c 5f 53 74 61 lue from Tcl_Sta 0ae0: 63 6b 43 68 61 6e 6e 65 6c 2e 0a 0a 09 2a 20 74 ckChannel....* t 0af0: 65 73 74 73 2f 74 6c 73 49 4f 2e 74 65 73 74 3a ests/tlsIO.test: 0b00: 20 61 64 64 65 64 20 73 6f 6d 65 20 68 61 6e 64 added some hand 0b10: 73 68 61 6b 69 6e 67 20 74 68 61 74 20 73 68 6f shaking that sho 0b20: 75 6c 64 6e 27 74 20 62 65 0a 09 6e 65 63 65 73 uldn't be..neces 0b30: 73 61 72 79 2c 20 62 75 74 20 77 65 20 63 72 61 sary, but we cra 0b40: 73 68 20 6f 74 68 65 72 77 69 73 65 20 28 6e 65 sh otherwise (ne 0b50: 65 64 73 20 6d 6f 72 65 20 74 65 73 74 69 6e 67 eds more testing 0b60: 29 2e 0a 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 20 )....* tlsIO.c: 0b70: 61 64 64 65 64 20 73 75 70 70 6f 72 74 20 66 6f added support fo 0b80: 72 20 22 63 6f 72 72 65 63 74 65 64 22 20 73 74 r "corrected" st 0b90: 61 63 6b 65 64 20 63 68 61 6e 6e 65 6c 73 2e 20 acked channels. 0ba0: 20 41 6c 6c 0a 09 74 68 65 20 61 62 6f 76 65 20 All..the above 0bb0: 63 68 61 6e 6e 65 6c 73 20 61 72 65 20 69 6e 20 channels are in 0bc0: 54 43 4c 5f 43 48 41 4e 4e 45 4c 5f 56 45 52 53 TCL_CHANNEL_VERS 0bd0: 49 4f 4e 5f 32 20 23 69 66 64 65 66 73 2e 0a 0a ION_2 #ifdefs... 0be0: 32 30 30 30 2d 30 36 2d 30 35 20 20 53 63 6f 74 2000-06-05 Scot 0bf0: 74 20 53 74 61 6e 74 6f 6e 20 20 3c 73 74 61 6e t Stanton <stan 0c00: 74 6f 6e 40 61 6a 75 62 61 73 6f 6c 75 74 69 6f ton@ajubasolutio 0c10: 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 4d 61 6b 65 ns.com>...* Make 0c20: 66 69 6c 65 2e 69 6e 3a 20 46 69 78 65 64 20 62 file.in: Fixed b 0c30: 72 6f 6b 65 6e 20 74 65 73 74 20 74 61 72 67 65 roken test targe 0c40: 74 2e 0a 0a 09 2a 20 74 6c 73 49 6e 74 2e 68 3a t....* tlsInt.h: 0c50: 20 0a 09 2a 20 74 6c 73 2e 63 3a 20 43 6c 65 61 ..* tls.c: Clea 0c60: 6e 65 64 20 75 70 20 64 65 63 6c 61 72 61 74 69 ned up declarati 0c70: 6f 6e 73 20 6f 66 20 54 6c 73 5f 43 6c 65 61 6e ons of Tls_Clean 0c80: 20 74 6f 20 61 76 6f 69 64 20 65 72 72 6f 72 73 to avoid errors 0c90: 20 6f 6e 0a 09 57 69 6e 64 6f 77 73 20 28 6c 69 on..Windows (li 0ca0: 6e 74 29 2e 0a 0a 32 30 30 30 2d 30 36 2d 30 35 nt)...2000-06-05 0cb0: 20 20 42 72 65 6e 74 20 57 65 6c 63 68 20 3c 77 Brent Welch <w 0cc0: 65 6c 63 68 40 61 6a 75 62 61 73 6f 6c 75 74 69 elch@ajubasoluti 0cd0: 6f 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 ons.com>...* tls 0ce0: 2e 63 2c 20 74 6c 73 49 4f 2e 63 3a 20 20 53 70 .c, tlsIO.c: Sp 0cf0: 6c 69 74 20 54 6c 73 5f 46 72 65 65 20 69 6e 74 lit Tls_Free int 0d00: 6f 20 54 6c 73 5f 43 6c 65 61 6e 2c 20 77 68 69 o Tls_Clean, whi 0d10: 63 68 20 64 6f 65 73 0a 09 74 68 65 20 53 53 4c ch does..the SSL 0d20: 20 63 6c 65 61 6e 75 70 2c 20 61 6e 64 20 74 68 cleanup, and th 0d30: 65 20 54 63 6c 5f 46 72 65 65 20 63 61 6c 6c 2e e Tcl_Free call. 0d40: 20 20 49 74 20 69 73 20 69 6d 70 6f 72 74 61 6e It is importan 0d50: 74 20 74 6f 20 73 68 75 74 64 6f 77 6e 0a 09 74 t to shutdown..t 0d60: 68 65 20 53 53 4c 20 73 74 61 74 65 20 22 73 79 he SSL state "sy 0d70: 6e 63 68 72 6f 6e 6f 75 73 6c 79 22 20 64 75 72 nchronously" dur 0d80: 69 6e 67 20 61 20 73 74 61 63 6b 65 64 20 66 6c ing a stacked fl 0d90: 75 73 68 2e 0a 0a 32 30 30 30 2d 30 36 2d 30 31 ush...2000-06-01 0da0: 20 20 53 63 6f 74 74 20 53 74 61 6e 74 6f 6e 20 Scott Stanton 0db0: 20 3c 73 74 61 6e 74 6f 6e 40 61 6a 75 62 61 73 <stanton@ajubas 0dc0: 6f 6c 75 74 69 6f 6e 73 2e 63 6f 6d 3e 0a 0a 09 olutions.com>... 0dd0: 2a 20 74 6c 73 49 4f 2e 63 3a 20 52 65 73 74 6f * tlsIO.c: Resto 0de0: 72 65 64 20 63 61 6c 6c 20 74 6f 20 54 63 6c 5f red call to Tcl_ 0df0: 4e 6f 74 69 66 79 43 68 61 6e 6e 65 6c 20 66 72 NotifyChannel fr 0e00: 6f 6d 20 43 68 61 6e 6e 65 6c 48 61 6e 64 6c 65 om ChannelHandle 0e10: 72 0a 09 74 6f 20 65 6e 73 75 72 65 20 74 68 61 r..to ensure tha 0e20: 74 20 65 76 65 6e 74 73 20 70 72 6f 70 61 67 61 t events propaga 0e30: 74 65 20 66 72 6f 6d 20 74 68 65 20 6c 6f 77 65 te from the lowe 0e40: 72 20 64 72 69 76 65 72 2e 20 20 54 68 69 73 20 r driver. This 0e50: 6d 61 79 0a 09 72 65 73 75 6c 74 20 69 6e 20 61 may..result in a 0e60: 6e 20 69 6e 66 69 6e 69 74 65 20 6c 6f 6f 70 20 n infinite loop 0e70: 69 6e 20 73 6f 6d 65 20 63 61 73 65 73 2c 20 73 in some cases, s 0e80: 6f 20 74 68 69 73 20 69 73 20 6e 6f 74 20 61 20 o this is not a 0e90: 74 6f 74 61 6c 0a 09 66 69 78 2e 20 20 54 68 69 total..fix. Thi 0ea0: 73 20 6d 61 79 20 62 65 20 73 75 66 66 69 63 69 s may be suffici 0eb0: 65 6e 74 20 66 6f 72 20 6e 6f 77 2c 20 68 6f 77 ent for now, how 0ec0: 65 76 65 72 2e 20 5b 42 75 67 3a 20 35 36 32 33 ever. [Bug: 5623 0ed0: 5d 0a 0a 32 30 30 30 2d 30 36 2d 30 31 20 20 53 ]..2000-06-01 S 0ee0: 63 6f 74 74 20 53 74 61 6e 74 6f 6e 20 20 3c 73 cott Stanton <s 0ef0: 74 61 6e 74 6f 6e 40 73 63 72 69 70 74 69 63 73 tanton@scriptics 0f00: 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 49 4f 2e .com>...* tlsIO. 0f10: 63 3a 20 52 65 73 74 6f 72 65 20 74 68 65 20 70 c: Restore the p 0f20: 72 65 76 69 6f 75 73 20 76 65 72 73 69 6f 6e 2e revious version. 0f30: 20 20 46 69 78 65 64 20 74 68 65 20 43 6c 6f 73 Fixed the Clos 0f40: 65 50 72 6f 63 20 73 6f 0a 09 69 74 20 75 6e 72 eProc so..it unr 0f50: 65 67 69 73 74 65 72 73 20 74 68 65 20 63 68 61 egisters the cha 0f60: 6e 6e 65 6c 20 68 61 6e 64 6c 65 72 20 6f 6e 20 nnel handler on 0f70: 74 68 65 20 73 75 70 65 72 63 65 64 65 64 20 63 the superceded c 0f80: 68 61 6e 6e 65 6c 0a 09 69 6e 73 74 65 61 64 20 hannel..instead 0f90: 6f 66 20 74 68 65 20 75 70 70 65 72 20 63 68 61 of the upper cha 0fa0: 6e 6e 65 6c 2e 20 41 6c 73 6f 20 72 65 6d 6f 76 nnel. Also remov 0fb0: 65 64 20 74 68 65 20 63 61 6c 6c 20 74 6f 0a 09 ed the call to.. 0fc0: 54 63 6c 5f 4e 6f 74 69 66 79 43 68 61 6e 6e 65 Tcl_NotifyChanne 0fd0: 6c 20 69 6e 20 74 68 65 20 43 68 61 6e 6e 65 6c l in the Channel 0fe0: 48 61 6e 64 6c 65 72 20 62 65 63 61 75 73 65 20 Handler because 0ff0: 74 68 69 73 20 77 69 6c 6c 20 72 65 73 75 6c 74 this will result 1000: 0a 09 69 6e 20 61 6e 20 69 6e 66 69 6e 69 74 65 ..in an infinite 1010: 20 6c 6f 6f 70 20 69 66 20 64 61 74 61 20 69 73 loop if data is 1020: 20 65 76 65 72 20 62 75 66 66 65 72 65 64 20 69 ever buffered i 1030: 6e 20 74 68 65 20 42 49 4f 0a 09 73 74 72 75 63 n the BIO..struc 1040: 74 75 72 65 2e 20 5b 42 75 67 3a 20 35 36 32 33 ture. [Bug: 5623 1050: 5d 0a 0a 32 30 30 30 2d 30 35 2d 33 31 20 20 42 ]..2000-05-31 B 1060: 72 65 6e 74 20 57 65 6c 63 68 20 3c 77 65 6c 63 rent Welch <welc 1070: 68 40 73 63 72 69 70 74 69 63 73 2e 63 6f 6d 3e h@scriptics.com> 1080: 0a 0a 09 2a 20 74 6c 73 2e 63 3a 20 43 68 61 6e ...* tls.c: Chan 1090: 67 65 20 74 68 65 20 43 68 61 6e 6e 65 6c 48 61 ge the ChannelHa 10a0: 6e 64 6c 65 72 20 74 6f 20 62 65 20 72 65 67 69 ndler to be regi 10b0: 73 74 65 72 65 64 20 6f 6e 20 74 68 65 20 6d 61 stered on the ma 10c0: 69 6e 0a 09 63 68 61 6e 6e 65 6c 20 61 73 20 6f in..channel as o 10d0: 70 70 73 65 64 20 74 6f 20 74 68 65 20 22 70 61 ppsed to the "pa 10e0: 72 65 6e 74 22 2c 20 6f 72 20 73 75 70 65 72 63 rent", or superc 10f0: 65 65 64 65 64 2c 20 63 68 61 6e 6e 65 6c 2e 20 eeded, channel. 1100: 20 54 68 69 73 0a 09 69 73 20 62 65 63 61 75 73 This..is becaus 1110: 65 20 74 68 65 20 73 6f 63 6b 65 74 20 64 72 69 e the socket dri 1120: 76 65 72 20 6e 6f 74 69 66 69 65 73 20 74 68 65 ver notifies the 1130: 20 6d 61 69 6e 20 63 68 61 6e 6e 65 6c 2c 20 61 main channel, a 1140: 6e 64 20 74 68 65 72 65 0a 09 61 72 65 20 74 69 nd there..are ti 1150: 6d 65 73 20 77 69 74 68 20 74 68 65 20 6d 61 69 mes with the mai 1160: 6e 20 63 68 61 6e 6e 65 6c 20 67 65 74 73 20 63 n channel gets c 1170: 6c 6f 73 65 64 2c 20 62 75 74 20 74 68 65 20 73 losed, but the s 1180: 75 70 65 72 63 65 64 65 64 0a 09 6f 6e 65 20 69 uperceded..one i 1190: 73 20 6e 6f 74 20 79 65 74 20 63 6c 6f 73 65 64 s not yet closed 11a0: 2e 20 20 49 66 20 74 68 65 20 63 68 61 6e 6e 65 . If the channe 11b0: 6c 20 68 61 6e 64 6c 65 72 20 67 65 74 73 20 74 l handler gets t 11c0: 72 69 67 67 65 72 65 64 20 69 6e 0a 09 74 68 69 riggered in..thi 11d0: 73 20 68 61 6c 66 2d 6f 70 65 6e 20 73 74 61 74 s half-open stat 11e0: 65 20 69 74 20 69 73 20 61 73 73 6f 63 69 61 74 e it is associat 11f0: 65 64 20 77 69 74 68 20 74 68 65 20 73 75 70 65 ed with the supe 1200: 72 63 65 65 64 65 64 0a 09 63 68 61 6e 6e 65 64 rceeded..channed 1210: 6c 2c 20 62 75 74 20 75 73 65 73 20 69 74 73 20 l, but uses its 1220: 70 72 69 76 61 74 65 20 70 6f 69 6e 74 65 72 20 private pointer 1230: 74 6f 20 74 68 65 20 6d 61 69 6e 20 63 68 61 6e to the main chan 1240: 6e 65 6c 2c 20 77 68 69 63 68 0a 09 69 73 20 6d nel, which..is m 1250: 6f 73 74 6c 79 20 64 65 73 74 72 6f 79 65 64 2e ostly destroyed. 1260: 20 20 45 6c 69 6d 69 6e 61 74 65 64 20 74 68 65 Eliminated the 1270: 20 72 65 64 75 6e 64 61 6e 74 20 63 61 6c 6c 20 redundant call 1280: 74 6f 0a 09 54 63 6c 5f 4e 6f 74 69 66 79 43 68 to..Tcl_NotifyCh 1290: 61 6e 6e 65 6c 20 66 72 6f 6d 20 54 6c 73 57 61 annel from TlsWa 12a0: 74 63 68 50 72 6f 63 2e 20 5b 42 75 67 3a 20 35 tchProc. [Bug: 5 12b0: 36 32 33 5d 0a 623].