Artifact
fac07465ee64dd28d5c0fcb418abe91d57c8a651:
0000: 32 30 30 30 2d 30 37 2d 31 33 20 20 4a 65 66 66 2000-07-13 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 65 73 74 73 2f 74 6c 73 49 4f 2e 74 65 * tests/tlsIO.te
0040: 73 74 3a 20 65 6e 61 62 6c 65 64 20 74 65 73 74 st: enabled test
0050: 73 20 32 2e 31 30 2c 20 37 2e 5b 31 32 34 35 5d s 2.10, 7.[1245]
0060: 20 28 74 68 65 72 65 20 69 73 20 6e 6f 20 33 29 (there is no 3)
0070: 2c 0a 09 77 68 69 63 68 20 6e 6f 77 20 70 61 73 ,..which now pas
0080: 73 2e 20 20 41 64 64 65 64 20 73 6f 6d 65 20 63 s. Added some c
0090: 6f 6d 6d 65 6e 74 73 20 74 6f 20 6f 74 68 65 72 omments to other
00a0: 20 66 61 69 6c 69 6e 67 20 74 65 73 74 73 2e 0a failing tests..
00b0: 0a 32 30 30 30 2d 30 37 2d 31 31 20 20 4a 65 66 .2000-07-11 Jef
00c0: 66 20 48 6f 62 62 73 20 20 3c 68 6f 62 62 73 40 f Hobbs <hobbs@
00d0: 73 63 72 69 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a scriptics.com>..
00e0: 09 2a 20 74 6c 73 49 4f 2e 63 3a 20 63 68 61 6e .* tlsIO.c: chan
00f0: 67 65 64 20 61 6c 6c 20 74 68 65 20 63 68 61 6e ged all the chan
0100: 6e 65 6c 20 70 72 6f 63 73 20 74 6f 20 73 74 61 nel procs to sta
0110: 72 74 20 77 69 74 68 20 54 6c 73 2a 20 66 6f 72 rt with Tls* for
0120: 0a 09 62 65 74 74 65 72 20 70 61 72 69 74 79 20 ..better parity
0130: 77 68 65 6e 20 63 6f 6d 70 61 72 69 6e 67 20 77 when comparing w
0140: 69 74 68 20 54 72 61 6e 73 66 6f 72 6d 20 63 68 ith Transform ch
0150: 61 6e 6e 65 6c 20 70 72 6f 63 73 2e 0a 09 52 65 annel procs...Re
0160: 77 72 6f 74 65 20 54 6c 73 57 61 74 63 68 50 72 wrote TlsWatchPr
0170: 6f 63 2c 20 61 64 64 65 64 20 54 6c 73 4e 6f 74 oc, added TlsNot
0180: 69 66 79 50 72 6f 63 20 61 63 63 6f 72 64 69 6e ifyProc accordin
0190: 67 20 74 6f 20 74 68 65 20 6e 65 77 0a 09 63 68 g to the new..ch
01a0: 61 6e 6e 65 6c 20 64 65 73 69 67 6e 2c 20 77 68 annel design, wh
01b0: 69 63 68 20 61 6c 73 6f 20 6c 65 61 76 65 73 20 ich also leaves
01c0: 54 6c 73 43 68 61 6e 6e 65 6c 48 61 6e 64 6c 65 TlsChannelHandle
01d0: 72 20 75 6e 75 73 65 64 2e 0a 0a 09 2a 20 74 6c r unused....* tl
01e0: 73 42 49 4f 2e 63 20 28 42 69 6f 43 74 72 6c 29 sBIO.c (BioCtrl)
01f0: 3a 20 63 68 61 6e 67 65 64 20 42 49 4f 5f 43 54 : changed BIO_CT
0200: 52 4c 5f 46 4c 55 53 48 20 63 61 73 65 20 74 6f RL_FLUSH case to
0210: 20 75 73 65 0a 09 54 63 6c 5f 57 72 69 74 65 52 use..Tcl_WriteR
0220: 61 77 20 69 6e 73 74 65 61 64 20 6f 66 20 54 63 aw instead of Tc
0230: 6c 5f 46 6c 75 73 68 20 28 74 6f 20 6f 70 65 72 l_Flush (to oper
0240: 61 74 65 20 6f 6e 20 63 6f 72 72 65 63 74 20 63 ate on correct c
0250: 68 61 6e 6e 65 6c 0a 09 69 6e 20 74 68 65 20 73 hannel..in the s
0260: 74 61 63 6b 20 69 6e 73 74 65 61 64 20 6f 66 20 tack instead of
0270: 73 74 61 72 74 69 6e 67 20 61 74 20 74 68 65 20 starting at the
0280: 74 6f 70 20 61 67 61 69 6e 29 2e 20 20 57 6f 75 top again). Wou
0290: 6c 64 0a 09 6f 74 68 65 72 77 69 73 65 20 63 61 ld..otherwise ca
02a0: 75 73 65 20 61 20 72 65 63 75 72 73 69 76 65 20 use a recursive
02b0: 73 74 61 63 6b 20 62 6f 6d 62 20 77 68 65 6e 20 stack bomb when
02c0: 69 6d 70 6c 69 63 69 74 20 68 61 6e 64 73 68 61 implicit handsha
02d0: 6b 69 6e 67 0a 09 74 6f 6f 6b 20 65 66 66 65 63 king..took effec
02e0: 74 2e 0a 0a 09 2a 20 74 65 73 74 73 2f 74 6c 73 t....* tests/tls
02f0: 49 4f 2e 74 65 73 74 3a 20 72 65 6d 6f 76 65 64 IO.test: removed
0300: 20 63 68 61 6e 67 65 73 20 6d 61 64 65 20 74 6f changes made to
0310: 20 74 65 73 74 20 73 75 69 74 65 20 28 61 6c 6c test suite (all
0320: 20 74 65 73 74 73 0a 09 74 68 61 74 20 72 61 6e tests..that ran
0330: 20 62 65 66 6f 72 65 20 6e 6f 77 20 70 61 73 73 before now pass
0340: 20 63 6f 72 72 65 63 74 6c 79 29 2c 20 61 6e 64 correctly), and
0350: 20 63 68 61 6e 67 65 64 20 73 6f 6d 65 20 61 63 changed some ac
0360: 63 65 70 74 20 70 72 6f 63 0a 09 61 72 67 73 20 cept proc..args
0370: 74 6f 20 72 65 66 6c 65 63 74 20 74 68 61 74 20 to reflect that
0380: 61 20 73 6f 63 6b 20 69 73 20 61 6e 20 61 72 67 a sock is an arg
0390: 2c 20 6e 6f 74 20 61 20 66 69 6c 65 2e 0a 0a 32 , not a file...2
03a0: 30 30 30 2d 30 37 2d 31 30 20 20 4a 65 66 66 20 000-07-10 Jeff
03b0: 48 6f 62 62 73 20 20 3c 68 6f 62 62 73 40 73 63 Hobbs <hobbs@sc
03c0: 72 69 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a riptics.com>...*
03d0: 20 74 6c 73 42 49 4f 2e 63 20 28 42 69 6f 57 72 tlsBIO.c (BioWr
03e0: 69 74 65 2c 20 42 69 6f 52 65 61 64 29 3a 20 63 ite, BioRead): c
03f0: 68 61 6e 67 65 64 20 54 63 6c 5f 52 65 61 64 2f hanged Tcl_Read/
0400: 57 72 69 74 65 20 74 6f 0a 09 54 63 6c 5f 52 65 Write to..Tcl_Re
0410: 61 64 52 61 77 2f 54 63 6c 57 72 69 74 65 52 61 adRaw/TclWriteRa
0420: 77 2e 0a 0a 09 2a 20 74 6c 73 2e 63 3a 20 61 64 w....* tls.c: ad
0430: 64 65 64 20 75 73 65 20 6f 66 20 54 63 6c 5f 47 ded use of Tcl_G
0440: 65 74 54 6f 70 43 68 61 6e 6e 65 6c 20 61 66 74 etTopChannel aft
0450: 65 72 20 54 63 6c 5f 47 65 74 43 68 61 6e 6e 65 er Tcl_GetChanne
0460: 6c 20 61 6e 64 0a 09 67 6f 74 20 72 65 74 75 72 l and..got retur
0470: 6e 20 76 61 6c 75 65 20 66 72 6f 6d 20 54 63 6c n value from Tcl
0480: 5f 53 74 61 63 6b 43 68 61 6e 6e 65 6c 2e 0a 0a _StackChannel...
0490: 09 2a 20 74 65 73 74 73 2f 74 6c 73 49 4f 2e 74 .* tests/tlsIO.t
04a0: 65 73 74 3a 20 61 64 64 65 64 20 73 6f 6d 65 20 est: added some
04b0: 68 61 6e 64 73 68 61 6b 69 6e 67 20 74 68 61 74 handshaking that
04c0: 20 73 68 6f 75 6c 64 6e 27 74 20 62 65 0a 09 6e shouldn't be..n
04d0: 65 63 65 73 73 61 72 79 2c 20 62 75 74 20 77 65 ecessary, but we
04e0: 20 63 72 61 73 68 20 6f 74 68 65 72 77 69 73 65 crash otherwise
04f0: 20 28 6e 65 65 64 73 20 6d 6f 72 65 20 74 65 73 (needs more tes
0500: 74 69 6e 67 29 2e 0a 0a 09 2a 20 74 6c 73 49 4f ting)....* tlsIO
0510: 2e 63 3a 20 61 64 64 65 64 20 73 75 70 70 6f 72 .c: added suppor
0520: 74 20 66 6f 72 20 22 63 6f 72 72 65 63 74 65 64 t for "corrected
0530: 22 20 73 74 61 63 6b 65 64 20 63 68 61 6e 6e 65 " stacked channe
0540: 6c 73 2e 20 20 41 6c 6c 0a 09 74 68 65 20 61 62 ls. All..the ab
0550: 6f 76 65 20 63 68 61 6e 6e 65 6c 73 20 61 72 65 ove channels are
0560: 20 69 6e 20 54 43 4c 5f 43 48 41 4e 4e 45 4c 5f in TCL_CHANNEL_
0570: 56 45 52 53 49 4f 4e 5f 32 20 23 69 66 64 65 66 VERSION_2 #ifdef
0580: 73 2e 0a 0a 32 30 30 30 2d 30 36 2d 30 35 20 20 s...2000-06-05
0590: 53 63 6f 74 74 20 53 74 61 6e 74 6f 6e 20 20 3c Scott Stanton <
05a0: 73 74 61 6e 74 6f 6e 40 61 6a 75 62 61 73 6f 6c stanton@ajubasol
05b0: 75 74 69 6f 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 utions.com>...*
05c0: 4d 61 6b 65 66 69 6c 65 2e 69 6e 3a 20 46 69 78 Makefile.in: Fix
05d0: 65 64 20 62 72 6f 6b 65 6e 20 74 65 73 74 20 74 ed broken test t
05e0: 61 72 67 65 74 2e 0a 0a 09 2a 20 74 6c 73 49 6e arget....* tlsIn
05f0: 74 2e 68 3a 20 0a 09 2a 20 74 6c 73 2e 63 3a 20 t.h: ..* tls.c:
0600: 43 6c 65 61 6e 65 64 20 75 70 20 64 65 63 6c 61 Cleaned up decla
0610: 72 61 74 69 6f 6e 73 20 6f 66 20 54 6c 73 5f 43 rations of Tls_C
0620: 6c 65 61 6e 20 74 6f 20 61 76 6f 69 64 20 65 72 lean to avoid er
0630: 72 6f 72 73 20 6f 6e 0a 09 57 69 6e 64 6f 77 73 rors on..Windows
0640: 20 28 6c 69 6e 74 29 2e 0a 0a 32 30 30 30 2d 30 (lint)...2000-0
0650: 36 2d 30 35 20 20 42 72 65 6e 74 20 57 65 6c 63 6-05 Brent Welc
0660: 68 20 3c 77 65 6c 63 68 40 61 6a 75 62 61 73 6f h <welch@ajubaso
0670: 6c 75 74 69 6f 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a lutions.com>...*
0680: 20 74 6c 73 2e 63 2c 20 74 6c 73 49 4f 2e 63 3a tls.c, tlsIO.c:
0690: 20 20 53 70 6c 69 74 20 54 6c 73 5f 46 72 65 65 Split Tls_Free
06a0: 20 69 6e 74 6f 20 54 6c 73 5f 43 6c 65 61 6e 2c into Tls_Clean,
06b0: 20 77 68 69 63 68 20 64 6f 65 73 0a 09 74 68 65 which does..the
06c0: 20 53 53 4c 20 63 6c 65 61 6e 75 70 2c 20 61 6e SSL cleanup, an
06d0: 64 20 74 68 65 20 54 63 6c 5f 46 72 65 65 20 63 d the Tcl_Free c
06e0: 61 6c 6c 2e 20 20 49 74 20 69 73 20 69 6d 70 6f all. It is impo
06f0: 72 74 61 6e 74 20 74 6f 20 73 68 75 74 64 6f 77 rtant to shutdow
0700: 6e 0a 09 74 68 65 20 53 53 4c 20 73 74 61 74 65 n..the SSL state
0710: 20 22 73 79 6e 63 68 72 6f 6e 6f 75 73 6c 79 22 "synchronously"
0720: 20 64 75 72 69 6e 67 20 61 20 73 74 61 63 6b 65 during a stacke
0730: 64 20 66 6c 75 73 68 2e 0a 0a 32 30 30 30 2d 30 d flush...2000-0
0740: 36 2d 30 31 20 20 53 63 6f 74 74 20 53 74 61 6e 6-01 Scott Stan
0750: 74 6f 6e 20 20 3c 73 74 61 6e 74 6f 6e 40 61 6a ton <stanton@aj
0760: 75 62 61 73 6f 6c 75 74 69 6f 6e 73 2e 63 6f 6d ubasolutions.com
0770: 3e 0a 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 20 52 >...* tlsIO.c: R
0780: 65 73 74 6f 72 65 64 20 63 61 6c 6c 20 74 6f 20 estored call to
0790: 54 63 6c 5f 4e 6f 74 69 66 79 43 68 61 6e 6e 65 Tcl_NotifyChanne
07a0: 6c 20 66 72 6f 6d 20 43 68 61 6e 6e 65 6c 48 61 l from ChannelHa
07b0: 6e 64 6c 65 72 0a 09 74 6f 20 65 6e 73 75 72 65 ndler..to ensure
07c0: 20 74 68 61 74 20 65 76 65 6e 74 73 20 70 72 6f that events pro
07d0: 70 61 67 61 74 65 20 66 72 6f 6d 20 74 68 65 20 pagate from the
07e0: 6c 6f 77 65 72 20 64 72 69 76 65 72 2e 20 20 54 lower driver. T
07f0: 68 69 73 20 6d 61 79 0a 09 72 65 73 75 6c 74 20 his may..result
0800: 69 6e 20 61 6e 20 69 6e 66 69 6e 69 74 65 20 6c in an infinite l
0810: 6f 6f 70 20 69 6e 20 73 6f 6d 65 20 63 61 73 65 oop in some case
0820: 73 2c 20 73 6f 20 74 68 69 73 20 69 73 20 6e 6f s, so this is no
0830: 74 20 61 20 74 6f 74 61 6c 0a 09 66 69 78 2e 20 t a total..fix.
0840: 20 54 68 69 73 20 6d 61 79 20 62 65 20 73 75 66 This may be suf
0850: 66 69 63 69 65 6e 74 20 66 6f 72 20 6e 6f 77 2c ficient for now,
0860: 20 68 6f 77 65 76 65 72 2e 20 5b 42 75 67 3a 20 however. [Bug:
0870: 35 36 32 33 5d 0a 0a 32 30 30 30 2d 30 36 2d 30 5623]..2000-06-0
0880: 31 20 20 53 63 6f 74 74 20 53 74 61 6e 74 6f 6e 1 Scott Stanton
0890: 20 20 3c 73 74 61 6e 74 6f 6e 40 73 63 72 69 70 <stanton@scrip
08a0: 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c tics.com>...* tl
08b0: 73 49 4f 2e 63 3a 20 52 65 73 74 6f 72 65 20 74 sIO.c: Restore t
08c0: 68 65 20 70 72 65 76 69 6f 75 73 20 76 65 72 73 he previous vers
08d0: 69 6f 6e 2e 20 20 46 69 78 65 64 20 74 68 65 20 ion. Fixed the
08e0: 43 6c 6f 73 65 50 72 6f 63 20 73 6f 0a 09 69 74 CloseProc so..it
08f0: 20 75 6e 72 65 67 69 73 74 65 72 73 20 74 68 65 unregisters the
0900: 20 63 68 61 6e 6e 65 6c 20 68 61 6e 64 6c 65 72 channel handler
0910: 20 6f 6e 20 74 68 65 20 73 75 70 65 72 63 65 64 on the superced
0920: 65 64 20 63 68 61 6e 6e 65 6c 0a 09 69 6e 73 74 ed channel..inst
0930: 65 61 64 20 6f 66 20 74 68 65 20 75 70 70 65 72 ead of the upper
0940: 20 63 68 61 6e 6e 65 6c 2e 20 41 6c 73 6f 20 72 channel. Also r
0950: 65 6d 6f 76 65 64 20 74 68 65 20 63 61 6c 6c 20 emoved the call
0960: 74 6f 0a 09 54 63 6c 5f 4e 6f 74 69 66 79 43 68 to..Tcl_NotifyCh
0970: 61 6e 6e 65 6c 20 69 6e 20 74 68 65 20 43 68 61 annel in the Cha
0980: 6e 6e 65 6c 48 61 6e 64 6c 65 72 20 62 65 63 61 nnelHandler beca
0990: 75 73 65 20 74 68 69 73 20 77 69 6c 6c 20 72 65 use this will re
09a0: 73 75 6c 74 0a 09 69 6e 20 61 6e 20 69 6e 66 69 sult..in an infi
09b0: 6e 69 74 65 20 6c 6f 6f 70 20 69 66 20 64 61 74 nite loop if dat
09c0: 61 20 69 73 20 65 76 65 72 20 62 75 66 66 65 72 a is ever buffer
09d0: 65 64 20 69 6e 20 74 68 65 20 42 49 4f 0a 09 73 ed in the BIO..s
09e0: 74 72 75 63 74 75 72 65 2e 20 5b 42 75 67 3a 20 tructure. [Bug:
09f0: 35 36 32 33 5d 0a 0a 32 30 30 30 2d 30 35 2d 33 5623]..2000-05-3
0a00: 31 20 20 42 72 65 6e 74 20 57 65 6c 63 68 20 3c 1 Brent Welch <
0a10: 77 65 6c 63 68 40 73 63 72 69 70 74 69 63 73 2e welch@scriptics.
0a20: 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 2e 63 3a 20 com>...* tls.c:
0a30: 43 68 61 6e 67 65 20 74 68 65 20 43 68 61 6e 6e Change the Chann
0a40: 65 6c 48 61 6e 64 6c 65 72 20 74 6f 20 62 65 20 elHandler to be
0a50: 72 65 67 69 73 74 65 72 65 64 20 6f 6e 20 74 68 registered on th
0a60: 65 20 6d 61 69 6e 0a 09 63 68 61 6e 6e 65 6c 20 e main..channel
0a70: 61 73 20 6f 70 70 73 65 64 20 74 6f 20 74 68 65 as oppsed to the
0a80: 20 22 70 61 72 65 6e 74 22 2c 20 6f 72 20 73 75 "parent", or su
0a90: 70 65 72 63 65 65 64 65 64 2c 20 63 68 61 6e 6e perceeded, chann
0aa0: 65 6c 2e 20 20 54 68 69 73 0a 09 69 73 20 62 65 el. This..is be
0ab0: 63 61 75 73 65 20 74 68 65 20 73 6f 63 6b 65 74 cause the socket
0ac0: 20 64 72 69 76 65 72 20 6e 6f 74 69 66 69 65 73 driver notifies
0ad0: 20 74 68 65 20 6d 61 69 6e 20 63 68 61 6e 6e 65 the main channe
0ae0: 6c 2c 20 61 6e 64 20 74 68 65 72 65 0a 09 61 72 l, and there..ar
0af0: 65 20 74 69 6d 65 73 20 77 69 74 68 20 74 68 65 e times with the
0b00: 20 6d 61 69 6e 20 63 68 61 6e 6e 65 6c 20 67 65 main channel ge
0b10: 74 73 20 63 6c 6f 73 65 64 2c 20 62 75 74 20 74 ts closed, but t
0b20: 68 65 20 73 75 70 65 72 63 65 64 65 64 0a 09 6f he superceded..o
0b30: 6e 65 20 69 73 20 6e 6f 74 20 79 65 74 20 63 6c ne is not yet cl
0b40: 6f 73 65 64 2e 20 20 49 66 20 74 68 65 20 63 68 osed. If the ch
0b50: 61 6e 6e 65 6c 20 68 61 6e 64 6c 65 72 20 67 65 annel handler ge
0b60: 74 73 20 74 72 69 67 67 65 72 65 64 20 69 6e 0a ts triggered in.
0b70: 09 74 68 69 73 20 68 61 6c 66 2d 6f 70 65 6e 20 .this half-open
0b80: 73 74 61 74 65 20 69 74 20 69 73 20 61 73 73 6f state it is asso
0b90: 63 69 61 74 65 64 20 77 69 74 68 20 74 68 65 20 ciated with the
0ba0: 73 75 70 65 72 63 65 65 64 65 64 0a 09 63 68 61 superceeded..cha
0bb0: 6e 6e 65 64 6c 2c 20 62 75 74 20 75 73 65 73 20 nnedl, but uses
0bc0: 69 74 73 20 70 72 69 76 61 74 65 20 70 6f 69 6e its private poin
0bd0: 74 65 72 20 74 6f 20 74 68 65 20 6d 61 69 6e 20 ter to the main
0be0: 63 68 61 6e 6e 65 6c 2c 20 77 68 69 63 68 0a 09 channel, which..
0bf0: 69 73 20 6d 6f 73 74 6c 79 20 64 65 73 74 72 6f is mostly destro
0c00: 79 65 64 2e 20 20 45 6c 69 6d 69 6e 61 74 65 64 yed. Eliminated
0c10: 20 74 68 65 20 72 65 64 75 6e 64 61 6e 74 20 63 the redundant c
0c20: 61 6c 6c 20 74 6f 0a 09 54 63 6c 5f 4e 6f 74 69 all to..Tcl_Noti
0c30: 66 79 43 68 61 6e 6e 65 6c 20 66 72 6f 6d 20 54 fyChannel from T
0c40: 6c 73 57 61 74 63 68 50 72 6f 63 2e 20 5b 42 75 lsWatchProc. [Bu
0c50: 67 3a 20 35 36 32 33 5d 0a g: 5623].