Artifact
26e006953bed1d507eb9517e80559ef3e798d2fe:
0000: 32 30 30 30 2d 30 37 2d 31 37 20 20 4a 65 66 66 2000-07-17 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 70 6b 67 49 6e 64 65 78 2e 74 63 6c 2e 69 * pkgIndex.tcl.i
0040: 6e 3a 0a 09 2a 20 63 6f 6e 66 69 67 75 72 65 2e n:..* configure.
0050: 69 6e 3a 20 75 70 64 61 74 65 64 20 76 65 72 73 in: updated vers
0060: 69 6f 6e 20 74 6f 20 31 2e 34 0a 0a 32 30 30 30 ion to 1.4..2000
0070: 2d 30 37 2d 31 33 20 20 4a 65 66 66 20 48 6f 62 -07-13 Jeff Hob
0080: 62 73 20 20 3c 68 6f 62 62 73 40 73 63 72 69 70 bs <hobbs@scrip
0090: 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 65 tics.com>...* te
00a0: 73 74 73 2f 74 6c 73 49 4f 2e 74 65 73 74 3a 20 sts/tlsIO.test:
00b0: 65 6e 61 62 6c 65 64 20 74 65 73 74 73 20 32 2e enabled tests 2.
00c0: 31 30 2c 20 37 2e 5b 31 32 34 35 5d 20 28 74 68 10, 7.[1245] (th
00d0: 65 72 65 20 69 73 20 6e 6f 20 33 29 2c 0a 09 77 ere is no 3),..w
00e0: 68 69 63 68 20 6e 6f 77 20 70 61 73 73 2e 20 20 hich now pass.
00f0: 41 64 64 65 64 20 73 6f 6d 65 20 63 6f 6d 6d 65 Added some comme
0100: 6e 74 73 20 74 6f 20 6f 74 68 65 72 20 66 61 69 nts to other fai
0110: 6c 69 6e 67 20 74 65 73 74 73 2e 0a 0a 32 30 30 ling tests...200
0120: 30 2d 30 37 2d 31 31 20 20 4a 65 66 66 20 48 6f 0-07-11 Jeff Ho
0130: 62 62 73 20 20 3c 68 6f 62 62 73 40 73 63 72 69 bbs <hobbs@scri
0140: 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 ptics.com>...* t
0150: 6c 73 49 4f 2e 63 3a 20 63 68 61 6e 67 65 64 20 lsIO.c: changed
0160: 61 6c 6c 20 74 68 65 20 63 68 61 6e 6e 65 6c 20 all the channel
0170: 70 72 6f 63 73 20 74 6f 20 73 74 61 72 74 20 77 procs to start w
0180: 69 74 68 20 54 6c 73 2a 20 66 6f 72 0a 09 62 65 ith Tls* for..be
0190: 74 74 65 72 20 70 61 72 69 74 79 20 77 68 65 6e tter parity when
01a0: 20 63 6f 6d 70 61 72 69 6e 67 20 77 69 74 68 20 comparing with
01b0: 54 72 61 6e 73 66 6f 72 6d 20 63 68 61 6e 6e 65 Transform channe
01c0: 6c 20 70 72 6f 63 73 2e 0a 09 52 65 77 72 6f 74 l procs...Rewrot
01d0: 65 20 54 6c 73 57 61 74 63 68 50 72 6f 63 2c 20 e TlsWatchProc,
01e0: 61 64 64 65 64 20 54 6c 73 4e 6f 74 69 66 79 50 added TlsNotifyP
01f0: 72 6f 63 20 61 63 63 6f 72 64 69 6e 67 20 74 6f roc according to
0200: 20 74 68 65 20 6e 65 77 0a 09 63 68 61 6e 6e 65 the new..channe
0210: 6c 20 64 65 73 69 67 6e 2c 20 77 68 69 63 68 20 l design, which
0220: 61 6c 73 6f 20 6c 65 61 76 65 73 20 54 6c 73 43 also leaves TlsC
0230: 68 61 6e 6e 65 6c 48 61 6e 64 6c 65 72 20 75 6e hannelHandler un
0240: 75 73 65 64 2e 0a 0a 09 2a 20 74 6c 73 42 49 4f used....* tlsBIO
0250: 2e 63 20 28 42 69 6f 43 74 72 6c 29 3a 20 63 68 .c (BioCtrl): ch
0260: 61 6e 67 65 64 20 42 49 4f 5f 43 54 52 4c 5f 46 anged BIO_CTRL_F
0270: 4c 55 53 48 20 63 61 73 65 20 74 6f 20 75 73 65 LUSH case to use
0280: 0a 09 54 63 6c 5f 57 72 69 74 65 52 61 77 20 69 ..Tcl_WriteRaw i
0290: 6e 73 74 65 61 64 20 6f 66 20 54 63 6c 5f 46 6c nstead of Tcl_Fl
02a0: 75 73 68 20 28 74 6f 20 6f 70 65 72 61 74 65 20 ush (to operate
02b0: 6f 6e 20 63 6f 72 72 65 63 74 20 63 68 61 6e 6e on correct chann
02c0: 65 6c 0a 09 69 6e 20 74 68 65 20 73 74 61 63 6b el..in the stack
02d0: 20 69 6e 73 74 65 61 64 20 6f 66 20 73 74 61 72 instead of star
02e0: 74 69 6e 67 20 61 74 20 74 68 65 20 74 6f 70 20 ting at the top
02f0: 61 67 61 69 6e 29 2e 20 20 57 6f 75 6c 64 0a 09 again). Would..
0300: 6f 74 68 65 72 77 69 73 65 20 63 61 75 73 65 20 otherwise cause
0310: 61 20 72 65 63 75 72 73 69 76 65 20 73 74 61 63 a recursive stac
0320: 6b 20 62 6f 6d 62 20 77 68 65 6e 20 69 6d 70 6c k bomb when impl
0330: 69 63 69 74 20 68 61 6e 64 73 68 61 6b 69 6e 67 icit handshaking
0340: 0a 09 74 6f 6f 6b 20 65 66 66 65 63 74 2e 0a 0a ..took effect...
0350: 09 2a 20 74 65 73 74 73 2f 74 6c 73 49 4f 2e 74 .* tests/tlsIO.t
0360: 65 73 74 3a 20 72 65 6d 6f 76 65 64 20 63 68 61 est: removed cha
0370: 6e 67 65 73 20 6d 61 64 65 20 74 6f 20 74 65 73 nges made to tes
0380: 74 20 73 75 69 74 65 20 28 61 6c 6c 20 74 65 73 t suite (all tes
0390: 74 73 0a 09 74 68 61 74 20 72 61 6e 20 62 65 66 ts..that ran bef
03a0: 6f 72 65 20 6e 6f 77 20 70 61 73 73 20 63 6f 72 ore now pass cor
03b0: 72 65 63 74 6c 79 29 2c 20 61 6e 64 20 63 68 61 rectly), and cha
03c0: 6e 67 65 64 20 73 6f 6d 65 20 61 63 63 65 70 74 nged some accept
03d0: 20 70 72 6f 63 0a 09 61 72 67 73 20 74 6f 20 72 proc..args to r
03e0: 65 66 6c 65 63 74 20 74 68 61 74 20 61 20 73 6f eflect that a so
03f0: 63 6b 20 69 73 20 61 6e 20 61 72 67 2c 20 6e 6f ck is an arg, no
0400: 74 20 61 20 66 69 6c 65 2e 0a 0a 32 30 30 30 2d t a file...2000-
0410: 30 37 2d 31 30 20 20 4a 65 66 66 20 48 6f 62 62 07-10 Jeff Hobb
0420: 73 20 20 3c 68 6f 62 62 73 40 73 63 72 69 70 74 s <hobbs@script
0430: 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 ics.com>...* tls
0440: 42 49 4f 2e 63 20 28 42 69 6f 57 72 69 74 65 2c BIO.c (BioWrite,
0450: 20 42 69 6f 52 65 61 64 29 3a 20 63 68 61 6e 67 BioRead): chang
0460: 65 64 20 54 63 6c 5f 52 65 61 64 2f 57 72 69 74 ed Tcl_Read/Writ
0470: 65 20 74 6f 0a 09 54 63 6c 5f 52 65 61 64 52 61 e to..Tcl_ReadRa
0480: 77 2f 54 63 6c 57 72 69 74 65 52 61 77 2e 0a 0a w/TclWriteRaw...
0490: 09 2a 20 74 6c 73 2e 63 3a 20 61 64 64 65 64 20 .* tls.c: added
04a0: 75 73 65 20 6f 66 20 54 63 6c 5f 47 65 74 54 6f use of Tcl_GetTo
04b0: 70 43 68 61 6e 6e 65 6c 20 61 66 74 65 72 20 54 pChannel after T
04c0: 63 6c 5f 47 65 74 43 68 61 6e 6e 65 6c 20 61 6e cl_GetChannel an
04d0: 64 0a 09 67 6f 74 20 72 65 74 75 72 6e 20 76 61 d..got return va
04e0: 6c 75 65 20 66 72 6f 6d 20 54 63 6c 5f 53 74 61 lue from Tcl_Sta
04f0: 63 6b 43 68 61 6e 6e 65 6c 2e 0a 0a 09 2a 20 74 ckChannel....* t
0500: 65 73 74 73 2f 74 6c 73 49 4f 2e 74 65 73 74 3a ests/tlsIO.test:
0510: 20 61 64 64 65 64 20 73 6f 6d 65 20 68 61 6e 64 added some hand
0520: 73 68 61 6b 69 6e 67 20 74 68 61 74 20 73 68 6f shaking that sho
0530: 75 6c 64 6e 27 74 20 62 65 0a 09 6e 65 63 65 73 uldn't be..neces
0540: 73 61 72 79 2c 20 62 75 74 20 77 65 20 63 72 61 sary, but we cra
0550: 73 68 20 6f 74 68 65 72 77 69 73 65 20 28 6e 65 sh otherwise (ne
0560: 65 64 73 20 6d 6f 72 65 20 74 65 73 74 69 6e 67 eds more testing
0570: 29 2e 0a 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 20 )....* tlsIO.c:
0580: 61 64 64 65 64 20 73 75 70 70 6f 72 74 20 66 6f added support fo
0590: 72 20 22 63 6f 72 72 65 63 74 65 64 22 20 73 74 r "corrected" st
05a0: 61 63 6b 65 64 20 63 68 61 6e 6e 65 6c 73 2e 20 acked channels.
05b0: 20 41 6c 6c 0a 09 74 68 65 20 61 62 6f 76 65 20 All..the above
05c0: 63 68 61 6e 6e 65 6c 73 20 61 72 65 20 69 6e 20 channels are in
05d0: 54 43 4c 5f 43 48 41 4e 4e 45 4c 5f 56 45 52 53 TCL_CHANNEL_VERS
05e0: 49 4f 4e 5f 32 20 23 69 66 64 65 66 73 2e 0a 0a ION_2 #ifdefs...
05f0: 32 30 30 30 2d 30 36 2d 30 35 20 20 53 63 6f 74 2000-06-05 Scot
0600: 74 20 53 74 61 6e 74 6f 6e 20 20 3c 73 74 61 6e t Stanton <stan
0610: 74 6f 6e 40 61 6a 75 62 61 73 6f 6c 75 74 69 6f ton@ajubasolutio
0620: 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 4d 61 6b 65 ns.com>...* Make
0630: 66 69 6c 65 2e 69 6e 3a 20 46 69 78 65 64 20 62 file.in: Fixed b
0640: 72 6f 6b 65 6e 20 74 65 73 74 20 74 61 72 67 65 roken test targe
0650: 74 2e 0a 0a 09 2a 20 74 6c 73 49 6e 74 2e 68 3a t....* tlsInt.h:
0660: 20 0a 09 2a 20 74 6c 73 2e 63 3a 20 43 6c 65 61 ..* tls.c: Clea
0670: 6e 65 64 20 75 70 20 64 65 63 6c 61 72 61 74 69 ned up declarati
0680: 6f 6e 73 20 6f 66 20 54 6c 73 5f 43 6c 65 61 6e ons of Tls_Clean
0690: 20 74 6f 20 61 76 6f 69 64 20 65 72 72 6f 72 73 to avoid errors
06a0: 20 6f 6e 0a 09 57 69 6e 64 6f 77 73 20 28 6c 69 on..Windows (li
06b0: 6e 74 29 2e 0a 0a 32 30 30 30 2d 30 36 2d 30 35 nt)...2000-06-05
06c0: 20 20 42 72 65 6e 74 20 57 65 6c 63 68 20 3c 77 Brent Welch <w
06d0: 65 6c 63 68 40 61 6a 75 62 61 73 6f 6c 75 74 69 elch@ajubasoluti
06e0: 6f 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 ons.com>...* tls
06f0: 2e 63 2c 20 74 6c 73 49 4f 2e 63 3a 20 20 53 70 .c, tlsIO.c: Sp
0700: 6c 69 74 20 54 6c 73 5f 46 72 65 65 20 69 6e 74 lit Tls_Free int
0710: 6f 20 54 6c 73 5f 43 6c 65 61 6e 2c 20 77 68 69 o Tls_Clean, whi
0720: 63 68 20 64 6f 65 73 0a 09 74 68 65 20 53 53 4c ch does..the SSL
0730: 20 63 6c 65 61 6e 75 70 2c 20 61 6e 64 20 74 68 cleanup, and th
0740: 65 20 54 63 6c 5f 46 72 65 65 20 63 61 6c 6c 2e e Tcl_Free call.
0750: 20 20 49 74 20 69 73 20 69 6d 70 6f 72 74 61 6e It is importan
0760: 74 20 74 6f 20 73 68 75 74 64 6f 77 6e 0a 09 74 t to shutdown..t
0770: 68 65 20 53 53 4c 20 73 74 61 74 65 20 22 73 79 he SSL state "sy
0780: 6e 63 68 72 6f 6e 6f 75 73 6c 79 22 20 64 75 72 nchronously" dur
0790: 69 6e 67 20 61 20 73 74 61 63 6b 65 64 20 66 6c ing a stacked fl
07a0: 75 73 68 2e 0a 0a 32 30 30 30 2d 30 36 2d 30 31 ush...2000-06-01
07b0: 20 20 53 63 6f 74 74 20 53 74 61 6e 74 6f 6e 20 Scott Stanton
07c0: 20 3c 73 74 61 6e 74 6f 6e 40 61 6a 75 62 61 73 <stanton@ajubas
07d0: 6f 6c 75 74 69 6f 6e 73 2e 63 6f 6d 3e 0a 0a 09 olutions.com>...
07e0: 2a 20 74 6c 73 49 4f 2e 63 3a 20 52 65 73 74 6f * tlsIO.c: Resto
07f0: 72 65 64 20 63 61 6c 6c 20 74 6f 20 54 63 6c 5f red call to Tcl_
0800: 4e 6f 74 69 66 79 43 68 61 6e 6e 65 6c 20 66 72 NotifyChannel fr
0810: 6f 6d 20 43 68 61 6e 6e 65 6c 48 61 6e 64 6c 65 om ChannelHandle
0820: 72 0a 09 74 6f 20 65 6e 73 75 72 65 20 74 68 61 r..to ensure tha
0830: 74 20 65 76 65 6e 74 73 20 70 72 6f 70 61 67 61 t events propaga
0840: 74 65 20 66 72 6f 6d 20 74 68 65 20 6c 6f 77 65 te from the lowe
0850: 72 20 64 72 69 76 65 72 2e 20 20 54 68 69 73 20 r driver. This
0860: 6d 61 79 0a 09 72 65 73 75 6c 74 20 69 6e 20 61 may..result in a
0870: 6e 20 69 6e 66 69 6e 69 74 65 20 6c 6f 6f 70 20 n infinite loop
0880: 69 6e 20 73 6f 6d 65 20 63 61 73 65 73 2c 20 73 in some cases, s
0890: 6f 20 74 68 69 73 20 69 73 20 6e 6f 74 20 61 20 o this is not a
08a0: 74 6f 74 61 6c 0a 09 66 69 78 2e 20 20 54 68 69 total..fix. Thi
08b0: 73 20 6d 61 79 20 62 65 20 73 75 66 66 69 63 69 s may be suffici
08c0: 65 6e 74 20 66 6f 72 20 6e 6f 77 2c 20 68 6f 77 ent for now, how
08d0: 65 76 65 72 2e 20 5b 42 75 67 3a 20 35 36 32 33 ever. [Bug: 5623
08e0: 5d 0a 0a 32 30 30 30 2d 30 36 2d 30 31 20 20 53 ]..2000-06-01 S
08f0: 63 6f 74 74 20 53 74 61 6e 74 6f 6e 20 20 3c 73 cott Stanton <s
0900: 74 61 6e 74 6f 6e 40 73 63 72 69 70 74 69 63 73 tanton@scriptics
0910: 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 49 4f 2e .com>...* tlsIO.
0920: 63 3a 20 52 65 73 74 6f 72 65 20 74 68 65 20 70 c: Restore the p
0930: 72 65 76 69 6f 75 73 20 76 65 72 73 69 6f 6e 2e revious version.
0940: 20 20 46 69 78 65 64 20 74 68 65 20 43 6c 6f 73 Fixed the Clos
0950: 65 50 72 6f 63 20 73 6f 0a 09 69 74 20 75 6e 72 eProc so..it unr
0960: 65 67 69 73 74 65 72 73 20 74 68 65 20 63 68 61 egisters the cha
0970: 6e 6e 65 6c 20 68 61 6e 64 6c 65 72 20 6f 6e 20 nnel handler on
0980: 74 68 65 20 73 75 70 65 72 63 65 64 65 64 20 63 the superceded c
0990: 68 61 6e 6e 65 6c 0a 09 69 6e 73 74 65 61 64 20 hannel..instead
09a0: 6f 66 20 74 68 65 20 75 70 70 65 72 20 63 68 61 of the upper cha
09b0: 6e 6e 65 6c 2e 20 41 6c 73 6f 20 72 65 6d 6f 76 nnel. Also remov
09c0: 65 64 20 74 68 65 20 63 61 6c 6c 20 74 6f 0a 09 ed the call to..
09d0: 54 63 6c 5f 4e 6f 74 69 66 79 43 68 61 6e 6e 65 Tcl_NotifyChanne
09e0: 6c 20 69 6e 20 74 68 65 20 43 68 61 6e 6e 65 6c l in the Channel
09f0: 48 61 6e 64 6c 65 72 20 62 65 63 61 75 73 65 20 Handler because
0a00: 74 68 69 73 20 77 69 6c 6c 20 72 65 73 75 6c 74 this will result
0a10: 0a 09 69 6e 20 61 6e 20 69 6e 66 69 6e 69 74 65 ..in an infinite
0a20: 20 6c 6f 6f 70 20 69 66 20 64 61 74 61 20 69 73 loop if data is
0a30: 20 65 76 65 72 20 62 75 66 66 65 72 65 64 20 69 ever buffered i
0a40: 6e 20 74 68 65 20 42 49 4f 0a 09 73 74 72 75 63 n the BIO..struc
0a50: 74 75 72 65 2e 20 5b 42 75 67 3a 20 35 36 32 33 ture. [Bug: 5623
0a60: 5d 0a 0a 32 30 30 30 2d 30 35 2d 33 31 20 20 42 ]..2000-05-31 B
0a70: 72 65 6e 74 20 57 65 6c 63 68 20 3c 77 65 6c 63 rent Welch <welc
0a80: 68 40 73 63 72 69 70 74 69 63 73 2e 63 6f 6d 3e h@scriptics.com>
0a90: 0a 0a 09 2a 20 74 6c 73 2e 63 3a 20 43 68 61 6e ...* tls.c: Chan
0aa0: 67 65 20 74 68 65 20 43 68 61 6e 6e 65 6c 48 61 ge the ChannelHa
0ab0: 6e 64 6c 65 72 20 74 6f 20 62 65 20 72 65 67 69 ndler to be regi
0ac0: 73 74 65 72 65 64 20 6f 6e 20 74 68 65 20 6d 61 stered on the ma
0ad0: 69 6e 0a 09 63 68 61 6e 6e 65 6c 20 61 73 20 6f in..channel as o
0ae0: 70 70 73 65 64 20 74 6f 20 74 68 65 20 22 70 61 ppsed to the "pa
0af0: 72 65 6e 74 22 2c 20 6f 72 20 73 75 70 65 72 63 rent", or superc
0b00: 65 65 64 65 64 2c 20 63 68 61 6e 6e 65 6c 2e 20 eeded, channel.
0b10: 20 54 68 69 73 0a 09 69 73 20 62 65 63 61 75 73 This..is becaus
0b20: 65 20 74 68 65 20 73 6f 63 6b 65 74 20 64 72 69 e the socket dri
0b30: 76 65 72 20 6e 6f 74 69 66 69 65 73 20 74 68 65 ver notifies the
0b40: 20 6d 61 69 6e 20 63 68 61 6e 6e 65 6c 2c 20 61 main channel, a
0b50: 6e 64 20 74 68 65 72 65 0a 09 61 72 65 20 74 69 nd there..are ti
0b60: 6d 65 73 20 77 69 74 68 20 74 68 65 20 6d 61 69 mes with the mai
0b70: 6e 20 63 68 61 6e 6e 65 6c 20 67 65 74 73 20 63 n channel gets c
0b80: 6c 6f 73 65 64 2c 20 62 75 74 20 74 68 65 20 73 losed, but the s
0b90: 75 70 65 72 63 65 64 65 64 0a 09 6f 6e 65 20 69 uperceded..one i
0ba0: 73 20 6e 6f 74 20 79 65 74 20 63 6c 6f 73 65 64 s not yet closed
0bb0: 2e 20 20 49 66 20 74 68 65 20 63 68 61 6e 6e 65 . If the channe
0bc0: 6c 20 68 61 6e 64 6c 65 72 20 67 65 74 73 20 74 l handler gets t
0bd0: 72 69 67 67 65 72 65 64 20 69 6e 0a 09 74 68 69 riggered in..thi
0be0: 73 20 68 61 6c 66 2d 6f 70 65 6e 20 73 74 61 74 s half-open stat
0bf0: 65 20 69 74 20 69 73 20 61 73 73 6f 63 69 61 74 e it is associat
0c00: 65 64 20 77 69 74 68 20 74 68 65 20 73 75 70 65 ed with the supe
0c10: 72 63 65 65 64 65 64 0a 09 63 68 61 6e 6e 65 64 rceeded..channed
0c20: 6c 2c 20 62 75 74 20 75 73 65 73 20 69 74 73 20 l, but uses its
0c30: 70 72 69 76 61 74 65 20 70 6f 69 6e 74 65 72 20 private pointer
0c40: 74 6f 20 74 68 65 20 6d 61 69 6e 20 63 68 61 6e to the main chan
0c50: 6e 65 6c 2c 20 77 68 69 63 68 0a 09 69 73 20 6d nel, which..is m
0c60: 6f 73 74 6c 79 20 64 65 73 74 72 6f 79 65 64 2e ostly destroyed.
0c70: 20 20 45 6c 69 6d 69 6e 61 74 65 64 20 74 68 65 Eliminated the
0c80: 20 72 65 64 75 6e 64 61 6e 74 20 63 61 6c 6c 20 redundant call
0c90: 74 6f 0a 09 54 63 6c 5f 4e 6f 74 69 66 79 43 68 to..Tcl_NotifyCh
0ca0: 61 6e 6e 65 6c 20 66 72 6f 6d 20 54 6c 73 57 61 annel from TlsWa
0cb0: 74 63 68 50 72 6f 63 2e 20 5b 42 75 67 3a 20 35 tchProc. [Bug: 5
0cc0: 36 32 33 5d 0a 623].