Artifact
47ac658e027ce25436720b219d2ab59240a651e4:
0000: 32 30 30 30 2d 30 38 2d 31 36 20 20 4a 65 66 66 2000-08-16 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 63 69 70 68 65 72 73 2e * tests/ciphers.
0040: 74 65 73 74 3a 20 69 6d 70 72 6f 76 65 64 20 61 test: improved a
0050: 62 69 6c 69 74 79 20 74 6f 20 63 68 61 6e 67 65 bility to change
0060: 20 63 6f 6e 73 74 72 61 69 6e 74 0a 09 73 65 74 constraint..set
0070: 74 69 6e 67 20 66 6f 72 20 77 68 65 74 68 65 72 ting for whether
0080: 20 75 73 65 72 20 63 6f 6d 70 69 6c 65 64 20 61 user compiled a
0090: 67 61 69 6e 73 74 20 52 53 41 20 6f 72 20 4f 70 gainst RSA or Op
00a0: 65 6e 53 53 4c 20 6c 69 62 73 2e 0a 0a 09 2a 20 enSSL libs....*
00b0: 74 6c 73 2e 63 20 28 54 6c 73 5f 49 6e 69 74 29 tls.c (Tls_Init)
00c0: 3a 20 63 6f 72 72 65 63 74 65 64 20 69 6e 74 65 : corrected inte
00d0: 72 70 72 65 74 61 74 69 6f 6e 20 6f 66 20 76 65 rpretation of ve
00e0: 72 73 69 6f 6e 20 6e 75 6d 62 65 72 0a 09 28 70 rsion number..(p
00f0: 61 74 63 68 6c 65 76 65 6c 20 61 6e 64 20 72 65 atchlevel and re
0100: 6c 65 61 73 65 2f 73 65 72 69 61 6c 20 77 65 72 lease/serial wer
0110: 65 20 73 77 61 70 70 65 64 29 2e 0a 0a 32 30 30 e swapped)...200
0120: 30 2d 30 38 2d 31 35 20 20 4a 65 66 66 20 48 6f 0-08-15 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 52 ptics.com>...* R
0150: 45 41 44 4d 45 2e 74 78 74 3a 20 61 64 64 65 64 EADME.txt: added
0160: 20 6e 6f 74 65 73 20 61 62 6f 75 74 20 6e 65 65 notes about nee
0170: 64 20 74 6f 20 75 73 65 20 38 2e 32 2e 30 2b 2e d to use 8.2.0+.
0180: 0a 0a 09 2a 20 74 6c 73 49 6e 74 2e 68 3a 0a 09 ...* tlsInt.h:..
0190: 2a 20 74 6c 73 2e 63 3a 0a 09 2a 20 74 6c 73 49 * tls.c:..* tlsI
01a0: 4f 2e 63 3a 20 63 6f 72 72 65 63 74 65 64 20 73 O.c: corrected s
01b0: 74 72 75 63 74 75 72 65 20 69 6e 69 74 69 61 6c tructure initial
01c0: 69 7a 61 74 69 6f 6e 20 74 6f 20 77 6f 72 6b 20 ization to work
01d0: 77 68 65 6e 0a 09 63 6f 6d 70 69 6c 69 6e 67 20 when..compiling
01e0: 77 69 74 68 20 38 2e 32 2e 20 20 4e 6f 77 20 63 with 8.2. Now c
01f0: 6f 6d 70 69 6c 65 73 20 77 69 74 68 20 38 2e 32 ompiles with 8.2
0200: 2b 20 61 6e 64 20 74 65 73 74 65 64 20 74 6f 20 + and tested to
0210: 77 6f 72 6b 0a 09 77 69 74 68 20 38 2e 32 2b 20 work..with 8.2+
0220: 61 6e 64 20 64 79 6e 61 6d 69 63 61 6c 6c 79 20 and dynamically
0230: 61 64 6a 75 73 74 20 74 6f 20 74 68 65 20 76 65 adjust to the ve
0240: 72 73 69 6f 6e 20 6f 66 20 54 63 6c 20 69 74 20 rsion of Tcl it
0250: 77 61 73 0a 09 6c 6f 61 64 65 64 20 69 6e 74 6f was..loaded into
0260: 2e 20 20 54 4c 53 20 77 69 6c 6c 20 66 61 69 6c . TLS will fail
0270: 20 74 68 65 20 74 65 73 74 20 73 75 69 74 65 20 the test suite
0280: 77 69 74 68 20 54 63 6c 20 38 2e 32 2d 38 2e 33 with Tcl 8.2-8.3
0290: 2e 31 2e 0a 0a 09 2a 20 74 65 73 74 73 2f 61 6c .1....* tests/al
02a0: 6c 2e 74 63 6c 3a 20 61 64 64 65 64 20 63 61 74 l.tcl: added cat
02b0: 63 68 20 61 72 6f 75 6e 64 20 3a 3a 74 63 6c 74 ch around ::tclt
02c0: 65 73 74 3a 3a 6e 6f 72 6d 61 6c 69 7a 65 50 61 est::normalizePa
02d0: 74 68 0a 09 62 65 63 61 75 73 65 20 69 74 20 64 th..because it d
02e0: 6f 65 73 6e 27 74 20 65 78 69 73 74 20 69 6e 20 oesn't exist in
02f0: 70 72 65 2d 38 2e 33 20 74 63 6c 74 65 73 74 2e pre-8.3 tcltest.
0300: 0a 0a 09 2a 20 74 65 73 74 73 2f 73 69 6d 70 6c ...* tests/simpl
0310: 65 43 6c 69 65 6e 74 2e 74 63 6c 3a 20 0a 09 2a eClient.tcl: ..*
0320: 20 74 65 73 74 73 2f 73 69 6d 70 6c 65 53 65 72 tests/simpleSer
0330: 76 65 72 2e 74 63 6c 3a 20 61 64 64 65 64 20 73 ver.tcl: added s
0340: 69 6d 70 6c 65 20 63 6c 69 65 6e 74 2f 73 65 72 imple client/ser
0350: 76 65 72 20 74 65 73 74 20 73 63 72 69 70 74 73 ver test scripts
0360: 0a 09 74 68 61 74 20 75 73 65 20 74 65 73 74 20 ..that use test
0370: 63 65 72 74 73 20 61 6e 64 20 63 61 6e 20 64 6f certs and can do
0380: 20 73 69 6d 70 6c 65 20 73 74 72 65 73 73 20 74 simple stress t
0390: 65 73 74 73 2e 0a 0a 32 30 30 30 2d 30 38 2d 31 ests...2000-08-1
03a0: 34 20 20 4a 65 66 66 20 48 6f 62 62 73 20 20 3c 4 Jeff Hobbs <
03b0: 68 6f 62 62 73 40 73 63 72 69 70 74 69 63 73 2e hobbs@scriptics.
03c0: 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 49 6e 74 2e com>...* tlsInt.
03d0: 68 3a 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 0a 09 h:..* tlsIO.c:..
03e0: 2a 20 74 6c 73 42 49 4f 2e 63 3a 0a 09 2a 20 74 * tlsBIO.c:..* t
03f0: 6c 73 2e 63 3a 20 63 68 61 6e 67 65 64 20 61 72 ls.c: changed ar
0400: 6f 75 6e 64 20 74 6f 20 6f 6e 6c 79 20 77 6f 72 ound to only wor
0410: 6b 69 6e 67 20 77 69 74 68 20 38 2e 32 2e 30 2b king with 8.2.0+
0420: 20 28 38 2e 33 2e 32 2b 0a 09 70 72 65 66 65 72 (8.3.2+..prefer
0430: 72 65 64 29 2c 20 77 69 74 68 20 72 75 6e 74 69 red), with runti
0440: 6d 65 20 63 68 65 63 6b 73 20 66 6f 72 20 70 72 me checks for pr
0450: 65 2d 20 61 6e 64 20 70 6f 73 74 2d 69 6f 2d 72 e- and post-io-r
0460: 65 77 72 69 74 65 2e 0a 0a 09 2a 20 74 6c 73 2e ewrite....* tls.
0470: 63 20 28 54 6c 73 5f 49 6e 69 74 29 3a 20 63 68 c (Tls_Init): ch
0480: 61 6e 67 65 64 20 69 74 20 74 6f 20 72 65 71 75 anged it to requ
0490: 69 72 65 20 38 2e 33 2e 32 20 77 68 65 6e 20 54 ire 8.3.2 when T
04a0: 63 6c 5f 49 6e 69 74 53 74 75 62 73 0a 09 77 61 cl_InitStubs..wa
04b0: 73 20 63 61 6c 6c 65 64 20 62 65 63 61 75 73 65 s called because
04c0: 20 77 65 20 64 6f 6e 27 74 20 77 61 6e 74 20 70 we don't want p
04d0: 65 6f 70 6c 65 20 75 73 69 6e 67 20 54 4c 53 20 eople using TLS
04e0: 77 69 74 68 20 74 68 65 0a 09 6f 72 69 67 69 6e with the..origin
04f0: 61 6c 20 73 74 61 63 6b 65 64 20 63 68 61 6e 6e al stacked chann
0500: 65 6c 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f el implementatio
0510: 6e 2e 0a 0a 32 30 30 30 2d 30 37 2d 32 36 20 20 n...2000-07-26
0520: 4a 65 66 66 20 48 6f 62 62 73 20 20 3c 68 6f 62 Jeff Hobbs <hob
0530: 62 73 40 73 63 72 69 70 74 69 63 73 2e 63 6f 6d bs@scriptics.com
0540: 3e 0a 0a 09 2a 20 6d 65 72 67 65 64 20 61 6c 6c >...* merged all
0550: 20 63 68 61 6e 67 65 73 20 66 72 6f 6d 20 74 6c changes from tl
0560: 73 2d 31 2d 33 2d 69 6f 2d 72 65 77 72 69 74 65 s-1-3-io-rewrite
0570: 20 62 61 63 6b 20 69 6e 74 6f 20 6d 61 69 6e 20 back into main
0580: 62 72 61 6e 63 68 0a 0a 09 2a 20 74 65 73 74 73 branch...* tests
0590: 2f 74 6c 73 49 4f 2e 74 65 73 74 3a 20 75 70 64 /tlsIO.test: upd
05a0: 61 74 65 64 20 63 6f 6d 6d 65 6e 74 73 2c 20 66 ated comments, f
05b0: 69 78 65 64 20 61 20 70 63 43 72 61 73 68 20 63 ixed a pcCrash c
05c0: 61 73 65 20 74 68 61 74 0a 09 77 61 73 20 64 75 ase that..was du
05d0: 65 20 74 6f 20 64 65 62 75 67 20 61 73 73 65 72 e to debug asser
05e0: 74 69 6f 6e 20 69 6e 20 57 69 6e 64 6f 77 73 20 tion in Windows
05f0: 53 53 4c 2e 0a 0a 09 2a 20 74 6c 73 2e 63 20 28 SSL....* tls.c (
0600: 49 6d 70 6f 72 74 4f 62 6a 43 6d 64 29 3a 20 72 ImportObjCmd): r
0610: 65 6d 6f 76 65 64 20 75 6e 6e 65 63 65 73 73 61 emoved unnecessa
0620: 72 79 20 75 73 65 20 6f 66 20 27 62 69 6f 27 20 ry use of 'bio'
0630: 61 72 67 2e 0a 09 28 54 6c 73 5f 49 6e 69 74 29 arg...(Tls_Init)
0640: 3a 20 63 68 65 63 6b 20 72 65 74 75 72 6e 20 76 : check return v
0650: 61 6c 75 65 20 6f 66 20 53 53 4c 5f 6c 69 62 72 alue of SSL_libr
0660: 61 72 79 5f 69 6e 69 74 2e 20 20 41 6c 73 6f 20 ary_init. Also
0670: 6c 6f 74 73 20 6f 66 0a 09 77 68 69 74 65 73 70 lots of..whitesp
0680: 61 63 65 20 63 6c 65 61 6e 75 70 20 28 6d 6f 72 ace cleanup (mor
0690: 65 20 6c 69 6b 65 20 54 63 6c 20 45 6e 67 20 73 e like Tcl Eng s
06a0: 74 79 6c 65 20 67 75 69 64 65 29 2c 20 62 75 74 tyle guide), but
06b0: 20 6e 6f 74 20 61 6c 6c 0a 09 63 6f 64 65 20 77 not all..code w
06c0: 61 73 20 63 6c 65 61 6e 65 64 20 75 70 2e 0a 0a as cleaned up...
06d0: 09 2a 20 74 6c 73 42 49 4f 2e 63 3a 20 6d 69 6e .* tlsBIO.c: min
06e0: 6f 72 20 77 68 69 74 65 73 70 61 63 65 20 63 6c or whitespace cl
06f0: 65 61 6e 75 70 0a 0a 09 2a 20 74 6c 73 49 4f 2e eanup...* tlsIO.
0700: 63 3a 20 6d 69 6e 6f 72 20 77 68 69 74 65 73 70 c: minor whitesp
0710: 61 63 65 20 63 6c 65 61 6e 75 70 2e 0a 09 28 54 ace cleanup...(T
0720: 6c 73 49 6e 70 75 74 50 72 6f 63 2c 20 54 6c 73 lsInputProc, Tls
0730: 4f 75 74 70 75 74 50 72 6f 63 29 3a 20 41 64 64 OutputProc): Add
0740: 65 64 20 45 52 52 5f 63 6c 65 61 72 5f 65 72 72 ed ERR_clear_err
0750: 6f 72 20 62 65 66 6f 72 65 20 63 61 6c 6c 73 0a or before calls.
0760: 09 74 6f 20 42 49 4f 5f 72 65 61 64 20 6f 72 20 .to BIO_read or
0770: 42 49 4f 5f 77 72 69 74 65 2c 20 62 65 63 61 75 BIO_write, becau
0780: 73 65 20 77 65 20 63 6f 75 6c 64 20 6f 74 68 65 se we could othe
0790: 72 77 69 73 65 20 65 6e 64 20 75 70 0a 09 70 75 rwise end up..pu
07a0: 6c 6c 69 6e 67 20 61 6e 20 65 72 72 6f 72 20 6f lling an error o
07b0: 66 66 20 74 68 65 20 73 74 61 63 6b 20 74 68 61 ff the stack tha
07c0: 74 20 64 69 64 6e 27 74 20 62 65 6c 6f 6e 67 20 t didn't belong
07d0: 74 6f 20 75 73 2e 20 20 41 6c 73 6f 0a 09 63 6c to us. Also..cl
07e0: 65 61 6e 75 70 20 75 70 20 65 78 63 65 73 73 69 eanup up excessi
07f0: 76 65 20 75 73 65 20 6f 66 20 67 6f 74 6f 73 2e ve use of gotos.
0800: 0a 0a 32 30 30 30 2d 30 37 2d 32 30 20 20 4a 65 ..2000-07-20 Je
0810: 66 66 20 48 6f 62 62 73 20 20 3c 68 6f 62 62 73 ff Hobbs <hobbs
0820: 40 73 63 72 69 70 74 69 63 73 2e 63 6f 6d 3e 0a @scriptics.com>.
0830: 0a 09 2a 20 74 65 73 74 73 2f 74 6c 73 49 4f 2e ..* tests/tlsIO.
0840: 74 65 73 74 3a 20 63 6f 72 72 65 63 74 65 64 20 test: corrected
0850: 76 61 72 69 6f 75 73 20 74 65 73 74 73 20 74 6f various tests to
0860: 20 62 65 20 63 6f 72 72 65 63 74 20 66 6f 72 20 be correct for
0870: 54 4c 53 0a 09 73 74 61 63 6b 65 64 20 63 68 61 TLS..stacked cha
0880: 6e 6e 65 6c 73 20 28 61 73 20 6f 70 70 6f 73 65 nnels (as oppose
0890: 64 20 74 6f 20 74 68 65 20 73 74 61 6e 64 61 72 d to the standar
08a0: 64 20 73 6f 63 6b 65 74 73 20 74 68 65 20 74 65 d sockets the te
08b0: 73 74 0a 09 73 75 69 74 65 20 77 61 73 20 61 64 st..suite was ad
08c0: 6f 70 74 65 64 20 66 72 6f 6d 29 2e 20 20 4b 65 opted from). Ke
08d0: 79 20 64 69 66 66 65 72 65 6e 63 65 73 20 61 72 y differences ar
08e0: 65 20 74 68 61 74 20 54 4c 53 20 63 61 6e 6e 6f e that TLS canno
08f0: 74 0a 09 6f 70 65 72 61 74 65 20 69 6e 20 6f 6e t..operate in on
0900: 65 20 70 72 6f 63 65 73 73 20 77 69 74 68 6f 75 e process withou
0910: 74 20 61 6c 6c 20 63 68 61 6e 6e 65 6c 73 20 62 t all channels b
0920: 65 69 6e 67 20 6e 6f 6e 2d 62 6c 6f 63 6b 69 6e eing non-blockin
0930: 67 2c 20 6f 72 0a 09 74 68 65 20 68 61 6e 64 73 g, or..the hands
0940: 68 61 6b 65 20 77 69 6c 6c 20 62 6c 6f 63 6b 2c hake will block,
0950: 20 61 6e 64 20 68 61 6e 64 73 68 61 6b 69 6e 67 and handshaking
0960: 20 6d 75 73 74 20 62 65 20 66 6f 72 63 65 64 20 must be forced
0970: 69 6e 20 73 6f 6d 65 0a 09 63 61 73 65 73 2e 20 in some..cases.
0980: 20 41 6c 73 6f 2c 20 68 61 6e 64 73 68 61 6b 65 Also, handshake
0990: 73 20 64 6f 6e 27 74 20 73 65 65 6d 20 74 6f 20 s don't seem to
09a0: 63 6f 6d 70 6c 65 74 65 20 75 6e 6c 65 73 73 20 complete unless
09b0: 74 68 65 20 63 6c 69 65 6e 74 0a 09 68 61 73 20 the client..has
09c0: 70 6c 61 63 65 64 20 61 74 20 6c 65 61 73 74 20 placed at least
09d0: 6f 6e 65 20 62 79 74 65 20 66 6f 72 20 74 68 65 one byte for the
09e0: 20 73 65 72 76 65 72 20 74 6f 20 72 65 61 64 20 server to read
09f0: 69 6e 20 74 68 65 20 63 68 61 6e 6e 65 6c 2e 0a in the channel..
0a00: 0a 09 2a 20 74 65 73 74 73 2f 72 65 6d 6f 74 65 ..* tests/remote
0a10: 2e 74 63 6c 3a 20 63 6f 72 72 65 63 74 65 64 20 .tcl: corrected
0a20: 74 68 65 20 66 69 6e 64 69 6e 67 20 6f 66 20 74 the finding of t
0a30: 65 73 74 73 20 63 65 72 74 69 66 69 63 61 74 65 ests certificate
0a40: 73 0a 0a 09 2a 20 74 6c 73 49 4f 2e 63 20 28 54 s...* tlsIO.c (T
0a50: 6c 73 43 6c 6f 73 65 50 72 6f 63 29 3a 20 72 65 lsCloseProc): re
0a60: 6d 6f 76 65 64 20 64 65 6c 65 74 69 6e 67 20 6f moved deleting o
0a70: 66 20 74 69 6d 65 72 20 68 61 6e 64 6c 65 72 20 f timer handler
0a80: 61 73 0a 09 74 68 61 74 20 69 73 20 68 61 6e 64 as..that is hand
0a90: 6c 65 64 20 62 79 20 54 6c 73 5f 43 6c 65 61 6e led by Tls_Clean
0aa0: 2e 0a 0a 09 2a 20 74 6c 73 2e 74 63 6c 20 28 74 ....* tls.tcl (t
0ab0: 6c 73 3a 3a 5f 61 63 63 65 70 74 29 3a 20 63 6f ls::_accept): co
0ac0: 72 72 65 63 74 65 64 20 74 68 65 20 69 6e 74 65 rrected the inte
0ad0: 72 6e 61 6c 20 5f 61 63 63 65 70 74 20 74 6f 0a rnal _accept to.
0ae0: 09 74 72 69 63 6b 6c 65 20 63 61 6c 6c 62 61 63 .trickle callbac
0af0: 6b 20 65 72 72 6f 72 73 20 74 6f 20 74 68 65 20 k errors to the
0b00: 75 73 65 72 2e 0a 0a 09 2a 20 4d 61 6b 65 66 69 user....* Makefi
0b10: 6c 65 2e 69 6e 3a 20 6d 61 64 65 20 74 68 65 20 le.in: made the
0b20: 69 6e 73 74 61 6c 6c 2d 62 69 6e 61 72 69 65 73 install-binaries
0b30: 20 74 61 72 67 65 74 20 72 65 67 65 6e 65 72 61 target regenera
0b40: 74 65 20 74 68 65 0a 09 70 6b 67 49 6e 64 65 78 te the..pkgIndex
0b50: 2e 74 63 6c 20 63 6f 72 72 65 63 74 6c 79 2e 20 .tcl correctly.
0b60: 20 54 68 65 20 74 65 73 74 20 74 61 72 67 65 74 The test target
0b70: 20 70 72 6f 62 61 62 6c 79 20 73 68 6f 75 6c 64 probably should
0b80: 6e 27 74 20 73 63 72 65 77 0a 09 69 74 20 75 70 n't screw..it up
0b90: 2c 20 62 75 74 20 74 68 69 73 20 69 73 20 74 6f , but this is to
0ba0: 20 62 65 20 6f 6e 20 74 68 65 20 73 61 66 65 20 be on the safe
0bb0: 73 69 64 65 2e 0a 0a 32 30 30 30 2d 30 37 2d 31 side...2000-07-1
0bc0: 37 20 20 4a 65 66 66 20 48 6f 62 62 73 20 20 3c 7 Jeff Hobbs <
0bd0: 68 6f 62 62 73 40 73 63 72 69 70 74 69 63 73 2e hobbs@scriptics.
0be0: 63 6f 6d 3e 0a 0a 09 2a 20 70 6b 67 49 6e 64 65 com>...* pkgInde
0bf0: 78 2e 74 63 6c 2e 69 6e 3a 0a 09 2a 20 63 6f 6e x.tcl.in:..* con
0c00: 66 69 67 75 72 65 2e 69 6e 3a 20 75 70 64 61 74 figure.in: updat
0c10: 65 64 20 76 65 72 73 69 6f 6e 20 74 6f 20 31 2e ed version to 1.
0c20: 34 0a 0a 32 30 30 30 2d 30 37 2d 31 33 20 20 4a 4..2000-07-13 J
0c30: 65 66 66 20 48 6f 62 62 73 20 20 3c 68 6f 62 62 eff Hobbs <hobb
0c40: 73 40 73 63 72 69 70 74 69 63 73 2e 63 6f 6d 3e s@scriptics.com>
0c50: 0a 0a 09 2a 20 74 65 73 74 73 2f 74 6c 73 49 4f ...* tests/tlsIO
0c60: 2e 74 65 73 74 3a 20 65 6e 61 62 6c 65 64 20 74 .test: enabled t
0c70: 65 73 74 73 20 32 2e 31 30 2c 20 37 2e 5b 31 32 ests 2.10, 7.[12
0c80: 34 35 5d 20 28 74 68 65 72 65 20 69 73 20 6e 6f 45] (there is no
0c90: 20 33 29 2c 0a 09 77 68 69 63 68 20 6e 6f 77 20 3),..which now
0ca0: 70 61 73 73 2e 20 20 41 64 64 65 64 20 73 6f 6d pass. Added som
0cb0: 65 20 63 6f 6d 6d 65 6e 74 73 20 74 6f 20 6f 74 e comments to ot
0cc0: 68 65 72 20 66 61 69 6c 69 6e 67 20 74 65 73 74 her failing test
0cd0: 73 2e 0a 0a 32 30 30 30 2d 30 37 2d 31 31 20 20 s...2000-07-11
0ce0: 4a 65 66 66 20 48 6f 62 62 73 20 20 3c 68 6f 62 Jeff Hobbs <hob
0cf0: 62 73 40 73 63 72 69 70 74 69 63 73 2e 63 6f 6d bs@scriptics.com
0d00: 3e 0a 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 20 63 >...* tlsIO.c: c
0d10: 68 61 6e 67 65 64 20 61 6c 6c 20 74 68 65 20 63 hanged all the c
0d20: 68 61 6e 6e 65 6c 20 70 72 6f 63 73 20 74 6f 20 hannel procs to
0d30: 73 74 61 72 74 20 77 69 74 68 20 54 6c 73 2a 20 start with Tls*
0d40: 66 6f 72 0a 09 62 65 74 74 65 72 20 70 61 72 69 for..better pari
0d50: 74 79 20 77 68 65 6e 20 63 6f 6d 70 61 72 69 6e ty when comparin
0d60: 67 20 77 69 74 68 20 54 72 61 6e 73 66 6f 72 6d g with Transform
0d70: 20 63 68 61 6e 6e 65 6c 20 70 72 6f 63 73 2e 0a channel procs..
0d80: 09 52 65 77 72 6f 74 65 20 54 6c 73 57 61 74 63 .Rewrote TlsWatc
0d90: 68 50 72 6f 63 2c 20 61 64 64 65 64 20 54 6c 73 hProc, added Tls
0da0: 4e 6f 74 69 66 79 50 72 6f 63 20 61 63 63 6f 72 NotifyProc accor
0db0: 64 69 6e 67 20 74 6f 20 74 68 65 20 6e 65 77 0a ding to the new.
0dc0: 09 63 68 61 6e 6e 65 6c 20 64 65 73 69 67 6e 2c .channel design,
0dd0: 20 77 68 69 63 68 20 61 6c 73 6f 20 6c 65 61 76 which also leav
0de0: 65 73 20 54 6c 73 43 68 61 6e 6e 65 6c 48 61 6e es TlsChannelHan
0df0: 64 6c 65 72 20 75 6e 75 73 65 64 2e 0a 0a 09 2a dler unused....*
0e00: 20 74 6c 73 42 49 4f 2e 63 20 28 42 69 6f 43 74 tlsBIO.c (BioCt
0e10: 72 6c 29 3a 20 63 68 61 6e 67 65 64 20 42 49 4f rl): changed BIO
0e20: 5f 43 54 52 4c 5f 46 4c 55 53 48 20 63 61 73 65 _CTRL_FLUSH case
0e30: 20 74 6f 20 75 73 65 0a 09 54 63 6c 5f 57 72 69 to use..Tcl_Wri
0e40: 74 65 52 61 77 20 69 6e 73 74 65 61 64 20 6f 66 teRaw instead of
0e50: 20 54 63 6c 5f 46 6c 75 73 68 20 28 74 6f 20 6f Tcl_Flush (to o
0e60: 70 65 72 61 74 65 20 6f 6e 20 63 6f 72 72 65 63 perate on correc
0e70: 74 20 63 68 61 6e 6e 65 6c 0a 09 69 6e 20 74 68 t channel..in th
0e80: 65 20 73 74 61 63 6b 20 69 6e 73 74 65 61 64 20 e stack instead
0e90: 6f 66 20 73 74 61 72 74 69 6e 67 20 61 74 20 74 of starting at t
0ea0: 68 65 20 74 6f 70 20 61 67 61 69 6e 29 2e 20 20 he top again).
0eb0: 57 6f 75 6c 64 0a 09 6f 74 68 65 72 77 69 73 65 Would..otherwise
0ec0: 20 63 61 75 73 65 20 61 20 72 65 63 75 72 73 69 cause a recursi
0ed0: 76 65 20 73 74 61 63 6b 20 62 6f 6d 62 20 77 68 ve stack bomb wh
0ee0: 65 6e 20 69 6d 70 6c 69 63 69 74 20 68 61 6e 64 en implicit hand
0ef0: 73 68 61 6b 69 6e 67 0a 09 74 6f 6f 6b 20 65 66 shaking..took ef
0f00: 66 65 63 74 2e 0a 0a 09 2a 20 74 65 73 74 73 2f fect....* tests/
0f10: 74 6c 73 49 4f 2e 74 65 73 74 3a 20 72 65 6d 6f tlsIO.test: remo
0f20: 76 65 64 20 63 68 61 6e 67 65 73 20 6d 61 64 65 ved changes made
0f30: 20 74 6f 20 74 65 73 74 20 73 75 69 74 65 20 28 to test suite (
0f40: 61 6c 6c 20 74 65 73 74 73 0a 09 74 68 61 74 20 all tests..that
0f50: 72 61 6e 20 62 65 66 6f 72 65 20 6e 6f 77 20 70 ran before now p
0f60: 61 73 73 20 63 6f 72 72 65 63 74 6c 79 29 2c 20 ass correctly),
0f70: 61 6e 64 20 63 68 61 6e 67 65 64 20 73 6f 6d 65 and changed some
0f80: 20 61 63 63 65 70 74 20 70 72 6f 63 0a 09 61 72 accept proc..ar
0f90: 67 73 20 74 6f 20 72 65 66 6c 65 63 74 20 74 68 gs to reflect th
0fa0: 61 74 20 61 20 73 6f 63 6b 20 69 73 20 61 6e 20 at a sock is an
0fb0: 61 72 67 2c 20 6e 6f 74 20 61 20 66 69 6c 65 2e arg, not a file.
0fc0: 0a 0a 32 30 30 30 2d 30 37 2d 31 30 20 20 4a 65 ..2000-07-10 Je
0fd0: 66 66 20 48 6f 62 62 73 20 20 3c 68 6f 62 62 73 ff Hobbs <hobbs
0fe0: 40 73 63 72 69 70 74 69 63 73 2e 63 6f 6d 3e 0a @scriptics.com>.
0ff0: 0a 09 2a 20 74 6c 73 42 49 4f 2e 63 20 28 42 69 ..* tlsBIO.c (Bi
1000: 6f 57 72 69 74 65 2c 20 42 69 6f 52 65 61 64 29 oWrite, BioRead)
1010: 3a 20 63 68 61 6e 67 65 64 20 54 63 6c 5f 52 65 : changed Tcl_Re
1020: 61 64 2f 57 72 69 74 65 20 74 6f 0a 09 54 63 6c ad/Write to..Tcl
1030: 5f 52 65 61 64 52 61 77 2f 54 63 6c 57 72 69 74 _ReadRaw/TclWrit
1040: 65 52 61 77 2e 0a 0a 09 2a 20 74 6c 73 2e 63 3a eRaw....* tls.c:
1050: 20 61 64 64 65 64 20 75 73 65 20 6f 66 20 54 63 added use of Tc
1060: 6c 5f 47 65 74 54 6f 70 43 68 61 6e 6e 65 6c 20 l_GetTopChannel
1070: 61 66 74 65 72 20 54 63 6c 5f 47 65 74 43 68 61 after Tcl_GetCha
1080: 6e 6e 65 6c 20 61 6e 64 0a 09 67 6f 74 20 72 65 nnel and..got re
1090: 74 75 72 6e 20 76 61 6c 75 65 20 66 72 6f 6d 20 turn value from
10a0: 54 63 6c 5f 53 74 61 63 6b 43 68 61 6e 6e 65 6c Tcl_StackChannel
10b0: 2e 0a 0a 09 2a 20 74 65 73 74 73 2f 74 6c 73 49 ....* tests/tlsI
10c0: 4f 2e 74 65 73 74 3a 20 61 64 64 65 64 20 73 6f O.test: added so
10d0: 6d 65 20 68 61 6e 64 73 68 61 6b 69 6e 67 20 74 me handshaking t
10e0: 68 61 74 20 73 68 6f 75 6c 64 6e 27 74 20 62 65 hat shouldn't be
10f0: 0a 09 6e 65 63 65 73 73 61 72 79 2c 20 62 75 74 ..necessary, but
1100: 20 77 65 20 63 72 61 73 68 20 6f 74 68 65 72 77 we crash otherw
1110: 69 73 65 20 28 6e 65 65 64 73 20 6d 6f 72 65 20 ise (needs more
1120: 74 65 73 74 69 6e 67 29 2e 0a 0a 09 2a 20 74 6c testing)....* tl
1130: 73 49 4f 2e 63 3a 20 61 64 64 65 64 20 73 75 70 sIO.c: added sup
1140: 70 6f 72 74 20 66 6f 72 20 22 63 6f 72 72 65 63 port for "correc
1150: 74 65 64 22 20 73 74 61 63 6b 65 64 20 63 68 61 ted" stacked cha
1160: 6e 6e 65 6c 73 2e 20 20 41 6c 6c 0a 09 74 68 65 nnels. All..the
1170: 20 61 62 6f 76 65 20 63 68 61 6e 6e 65 6c 73 20 above channels
1180: 61 72 65 20 69 6e 20 54 43 4c 5f 43 48 41 4e 4e are in TCL_CHANN
1190: 45 4c 5f 56 45 52 53 49 4f 4e 5f 32 20 23 69 66 EL_VERSION_2 #if
11a0: 64 65 66 73 2e 0a 0a 32 30 30 30 2d 30 36 2d 30 defs...2000-06-0
11b0: 35 20 20 53 63 6f 74 74 20 53 74 61 6e 74 6f 6e 5 Scott Stanton
11c0: 20 20 3c 73 74 61 6e 74 6f 6e 40 61 6a 75 62 61 <stanton@ajuba
11d0: 73 6f 6c 75 74 69 6f 6e 73 2e 63 6f 6d 3e 0a 0a solutions.com>..
11e0: 09 2a 20 4d 61 6b 65 66 69 6c 65 2e 69 6e 3a 20 .* Makefile.in:
11f0: 46 69 78 65 64 20 62 72 6f 6b 65 6e 20 74 65 73 Fixed broken tes
1200: 74 20 74 61 72 67 65 74 2e 0a 0a 09 2a 20 74 6c t target....* tl
1210: 73 49 6e 74 2e 68 3a 20 0a 09 2a 20 74 6c 73 2e sInt.h: ..* tls.
1220: 63 3a 20 43 6c 65 61 6e 65 64 20 75 70 20 64 65 c: Cleaned up de
1230: 63 6c 61 72 61 74 69 6f 6e 73 20 6f 66 20 54 6c clarations of Tl
1240: 73 5f 43 6c 65 61 6e 20 74 6f 20 61 76 6f 69 64 s_Clean to avoid
1250: 20 65 72 72 6f 72 73 20 6f 6e 0a 09 57 69 6e 64 errors on..Wind
1260: 6f 77 73 20 28 6c 69 6e 74 29 2e 0a 0a 32 30 30 ows (lint)...200
1270: 30 2d 30 36 2d 30 35 20 20 42 72 65 6e 74 20 57 0-06-05 Brent W
1280: 65 6c 63 68 20 3c 77 65 6c 63 68 40 61 6a 75 62 elch <welch@ajub
1290: 61 73 6f 6c 75 74 69 6f 6e 73 2e 63 6f 6d 3e 0a asolutions.com>.
12a0: 0a 09 2a 20 74 6c 73 2e 63 2c 20 74 6c 73 49 4f ..* tls.c, tlsIO
12b0: 2e 63 3a 20 20 53 70 6c 69 74 20 54 6c 73 5f 46 .c: Split Tls_F
12c0: 72 65 65 20 69 6e 74 6f 20 54 6c 73 5f 43 6c 65 ree into Tls_Cle
12d0: 61 6e 2c 20 77 68 69 63 68 20 64 6f 65 73 0a 09 an, which does..
12e0: 74 68 65 20 53 53 4c 20 63 6c 65 61 6e 75 70 2c the SSL cleanup,
12f0: 20 61 6e 64 20 74 68 65 20 54 63 6c 5f 46 72 65 and the Tcl_Fre
1300: 65 20 63 61 6c 6c 2e 20 20 49 74 20 69 73 20 69 e call. It is i
1310: 6d 70 6f 72 74 61 6e 74 20 74 6f 20 73 68 75 74 mportant to shut
1320: 64 6f 77 6e 0a 09 74 68 65 20 53 53 4c 20 73 74 down..the SSL st
1330: 61 74 65 20 22 73 79 6e 63 68 72 6f 6e 6f 75 73 ate "synchronous
1340: 6c 79 22 20 64 75 72 69 6e 67 20 61 20 73 74 61 ly" during a sta
1350: 63 6b 65 64 20 66 6c 75 73 68 2e 0a 0a 32 30 30 cked flush...200
1360: 30 2d 30 36 2d 30 31 20 20 53 63 6f 74 74 20 53 0-06-01 Scott S
1370: 74 61 6e 74 6f 6e 20 20 3c 73 74 61 6e 74 6f 6e tanton <stanton
1380: 40 61 6a 75 62 61 73 6f 6c 75 74 69 6f 6e 73 2e @ajubasolutions.
1390: 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 49 4f 2e 63 com>...* tlsIO.c
13a0: 3a 20 52 65 73 74 6f 72 65 64 20 63 61 6c 6c 20 : Restored call
13b0: 74 6f 20 54 63 6c 5f 4e 6f 74 69 66 79 43 68 61 to Tcl_NotifyCha
13c0: 6e 6e 65 6c 20 66 72 6f 6d 20 43 68 61 6e 6e 65 nnel from Channe
13d0: 6c 48 61 6e 64 6c 65 72 0a 09 74 6f 20 65 6e 73 lHandler..to ens
13e0: 75 72 65 20 74 68 61 74 20 65 76 65 6e 74 73 20 ure that events
13f0: 70 72 6f 70 61 67 61 74 65 20 66 72 6f 6d 20 74 propagate from t
1400: 68 65 20 6c 6f 77 65 72 20 64 72 69 76 65 72 2e he lower driver.
1410: 20 20 54 68 69 73 20 6d 61 79 0a 09 72 65 73 75 This may..resu
1420: 6c 74 20 69 6e 20 61 6e 20 69 6e 66 69 6e 69 74 lt in an infinit
1430: 65 20 6c 6f 6f 70 20 69 6e 20 73 6f 6d 65 20 63 e loop in some c
1440: 61 73 65 73 2c 20 73 6f 20 74 68 69 73 20 69 73 ases, so this is
1450: 20 6e 6f 74 20 61 20 74 6f 74 61 6c 0a 09 66 69 not a total..fi
1460: 78 2e 20 20 54 68 69 73 20 6d 61 79 20 62 65 20 x. This may be
1470: 73 75 66 66 69 63 69 65 6e 74 20 66 6f 72 20 6e sufficient for n
1480: 6f 77 2c 20 68 6f 77 65 76 65 72 2e 20 5b 42 75 ow, however. [Bu
1490: 67 3a 20 35 36 32 33 5d 0a 0a 32 30 30 30 2d 30 g: 5623]..2000-0
14a0: 36 2d 30 31 20 20 53 63 6f 74 74 20 53 74 61 6e 6-01 Scott Stan
14b0: 74 6f 6e 20 20 3c 73 74 61 6e 74 6f 6e 40 73 63 ton <stanton@sc
14c0: 72 69 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a riptics.com>...*
14d0: 20 74 6c 73 49 4f 2e 63 3a 20 52 65 73 74 6f 72 tlsIO.c: Restor
14e0: 65 20 74 68 65 20 70 72 65 76 69 6f 75 73 20 76 e the previous v
14f0: 65 72 73 69 6f 6e 2e 20 20 46 69 78 65 64 20 74 ersion. Fixed t
1500: 68 65 20 43 6c 6f 73 65 50 72 6f 63 20 73 6f 0a he CloseProc so.
1510: 09 69 74 20 75 6e 72 65 67 69 73 74 65 72 73 20 .it unregisters
1520: 74 68 65 20 63 68 61 6e 6e 65 6c 20 68 61 6e 64 the channel hand
1530: 6c 65 72 20 6f 6e 20 74 68 65 20 73 75 70 65 72 ler on the super
1540: 63 65 64 65 64 20 63 68 61 6e 6e 65 6c 0a 09 69 ceded channel..i
1550: 6e 73 74 65 61 64 20 6f 66 20 74 68 65 20 75 70 nstead of the up
1560: 70 65 72 20 63 68 61 6e 6e 65 6c 2e 20 41 6c 73 per channel. Als
1570: 6f 20 72 65 6d 6f 76 65 64 20 74 68 65 20 63 61 o removed the ca
1580: 6c 6c 20 74 6f 0a 09 54 63 6c 5f 4e 6f 74 69 66 ll to..Tcl_Notif
1590: 79 43 68 61 6e 6e 65 6c 20 69 6e 20 74 68 65 20 yChannel in the
15a0: 43 68 61 6e 6e 65 6c 48 61 6e 64 6c 65 72 20 62 ChannelHandler b
15b0: 65 63 61 75 73 65 20 74 68 69 73 20 77 69 6c 6c ecause this will
15c0: 20 72 65 73 75 6c 74 0a 09 69 6e 20 61 6e 20 69 result..in an i
15d0: 6e 66 69 6e 69 74 65 20 6c 6f 6f 70 20 69 66 20 nfinite loop if
15e0: 64 61 74 61 20 69 73 20 65 76 65 72 20 62 75 66 data is ever buf
15f0: 66 65 72 65 64 20 69 6e 20 74 68 65 20 42 49 4f fered in the BIO
1600: 0a 09 73 74 72 75 63 74 75 72 65 2e 20 5b 42 75 ..structure. [Bu
1610: 67 3a 20 35 36 32 33 5d 0a 0a 32 30 30 30 2d 30 g: 5623]..2000-0
1620: 35 2d 33 31 20 20 42 72 65 6e 74 20 57 65 6c 63 5-31 Brent Welc
1630: 68 20 3c 77 65 6c 63 68 40 73 63 72 69 70 74 69 h <welch@scripti
1640: 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 2e cs.com>...* tls.
1650: 63 3a 20 43 68 61 6e 67 65 20 74 68 65 20 43 68 c: Change the Ch
1660: 61 6e 6e 65 6c 48 61 6e 64 6c 65 72 20 74 6f 20 annelHandler to
1670: 62 65 20 72 65 67 69 73 74 65 72 65 64 20 6f 6e be registered on
1680: 20 74 68 65 20 6d 61 69 6e 0a 09 63 68 61 6e 6e the main..chann
1690: 65 6c 20 61 73 20 6f 70 70 73 65 64 20 74 6f 20 el as oppsed to
16a0: 74 68 65 20 22 70 61 72 65 6e 74 22 2c 20 6f 72 the "parent", or
16b0: 20 73 75 70 65 72 63 65 65 64 65 64 2c 20 63 68 superceeded, ch
16c0: 61 6e 6e 65 6c 2e 20 20 54 68 69 73 0a 09 69 73 annel. This..is
16d0: 20 62 65 63 61 75 73 65 20 74 68 65 20 73 6f 63 because the soc
16e0: 6b 65 74 20 64 72 69 76 65 72 20 6e 6f 74 69 66 ket driver notif
16f0: 69 65 73 20 74 68 65 20 6d 61 69 6e 20 63 68 61 ies the main cha
1700: 6e 6e 65 6c 2c 20 61 6e 64 20 74 68 65 72 65 0a nnel, and there.
1710: 09 61 72 65 20 74 69 6d 65 73 20 77 69 74 68 20 .are times with
1720: 74 68 65 20 6d 61 69 6e 20 63 68 61 6e 6e 65 6c the main channel
1730: 20 67 65 74 73 20 63 6c 6f 73 65 64 2c 20 62 75 gets closed, bu
1740: 74 20 74 68 65 20 73 75 70 65 72 63 65 64 65 64 t the superceded
1750: 0a 09 6f 6e 65 20 69 73 20 6e 6f 74 20 79 65 74 ..one is not yet
1760: 20 63 6c 6f 73 65 64 2e 20 20 49 66 20 74 68 65 closed. If the
1770: 20 63 68 61 6e 6e 65 6c 20 68 61 6e 64 6c 65 72 channel handler
1780: 20 67 65 74 73 20 74 72 69 67 67 65 72 65 64 20 gets triggered
1790: 69 6e 0a 09 74 68 69 73 20 68 61 6c 66 2d 6f 70 in..this half-op
17a0: 65 6e 20 73 74 61 74 65 20 69 74 20 69 73 20 61 en state it is a
17b0: 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 74 ssociated with t
17c0: 68 65 20 73 75 70 65 72 63 65 65 64 65 64 0a 09 he superceeded..
17d0: 63 68 61 6e 6e 65 64 6c 2c 20 62 75 74 20 75 73 channedl, but us
17e0: 65 73 20 69 74 73 20 70 72 69 76 61 74 65 20 70 es its private p
17f0: 6f 69 6e 74 65 72 20 74 6f 20 74 68 65 20 6d 61 ointer to the ma
1800: 69 6e 20 63 68 61 6e 6e 65 6c 2c 20 77 68 69 63 in channel, whic
1810: 68 0a 09 69 73 20 6d 6f 73 74 6c 79 20 64 65 73 h..is mostly des
1820: 74 72 6f 79 65 64 2e 20 20 45 6c 69 6d 69 6e 61 troyed. Elimina
1830: 74 65 64 20 74 68 65 20 72 65 64 75 6e 64 61 6e ted the redundan
1840: 74 20 63 61 6c 6c 20 74 6f 0a 09 54 63 6c 5f 4e t call to..Tcl_N
1850: 6f 74 69 66 79 43 68 61 6e 6e 65 6c 20 66 72 6f otifyChannel fro
1860: 6d 20 54 6c 73 57 61 74 63 68 50 72 6f 63 2e 20 m TlsWatchProc.
1870: 5b 42 75 67 3a 20 35 36 32 33 5d 0a [Bug: 5623].