Hex Artifact Content

Artifact 1bd81afa717a3bd9bbb3807afb7c5c997abe8edd:


0000: 32 30 30 30 2d 30 38 2d 31 35 20 20 4a 65 66 66  2000-08-15  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 52 45 41 44 4d 45 2e 74 78 74 3a 20 61 64  * README.txt: ad
0040: 64 65 64 20 6e 6f 74 65 73 20 61 62 6f 75 74 20  ded notes about 
0050: 6e 65 65 64 20 74 6f 20 75 73 65 20 38 2e 32 2e  need to use 8.2.
0060: 30 2b 2e 0a 0a 09 2a 20 74 6c 73 49 6e 74 2e 68  0+....* tlsInt.h
0070: 3a 0a 09 2a 20 74 6c 73 2e 63 3a 0a 09 2a 20 74  :..* tls.c:..* t
0080: 6c 73 49 4f 2e 63 3a 20 63 6f 72 72 65 63 74 65  lsIO.c: correcte
0090: 64 20 73 74 72 75 63 74 75 72 65 20 69 6e 69 74  d structure init
00a0: 69 61 6c 69 7a 61 74 69 6f 6e 20 74 6f 20 77 6f  ialization to wo
00b0: 72 6b 20 77 68 65 6e 0a 09 63 6f 6d 70 69 6c 69  rk when..compili
00c0: 6e 67 20 77 69 74 68 20 38 2e 32 2e 20 20 4e 6f  ng with 8.2.  No
00d0: 77 20 63 6f 6d 70 69 6c 65 73 20 77 69 74 68 20  w compiles with 
00e0: 38 2e 32 2b 20 61 6e 64 20 74 65 73 74 65 64 20  8.2+ and tested 
00f0: 74 6f 20 77 6f 72 6b 0a 09 77 69 74 68 20 38 2e  to work..with 8.
0100: 32 2b 20 61 6e 64 20 64 79 6e 61 6d 69 63 61 6c  2+ and dynamical
0110: 6c 79 20 61 64 6a 75 73 74 20 74 6f 20 74 68 65  ly adjust to the
0120: 20 76 65 72 73 69 6f 6e 20 6f 66 20 54 63 6c 20   version of Tcl 
0130: 69 74 20 77 61 73 0a 09 6c 6f 61 64 65 64 20 69  it was..loaded i
0140: 6e 74 6f 2e 20 20 54 4c 53 20 77 69 6c 6c 20 66  nto.  TLS will f
0150: 61 69 6c 20 74 68 65 20 74 65 73 74 20 73 75 69  ail the test sui
0160: 74 65 20 77 69 74 68 20 54 63 6c 20 38 2e 32 2d  te with Tcl 8.2-
0170: 38 2e 33 2e 31 2e 0a 0a 09 2a 20 74 65 73 74 73  8.3.1....* tests
0180: 2f 61 6c 6c 2e 74 63 6c 3a 20 61 64 64 65 64 20  /all.tcl: added 
0190: 63 61 74 63 68 20 61 72 6f 75 6e 64 20 3a 3a 74  catch around ::t
01a0: 63 6c 74 65 73 74 3a 3a 6e 6f 72 6d 61 6c 69 7a  cltest::normaliz
01b0: 65 50 61 74 68 0a 09 62 65 63 61 75 73 65 20 69  ePath..because i
01c0: 74 20 64 6f 65 73 6e 27 74 20 65 78 69 73 74 20  t doesn't exist 
01d0: 69 6e 20 70 72 65 2d 38 2e 33 20 74 63 6c 74 65  in pre-8.3 tclte
01e0: 73 74 2e 0a 0a 09 2a 20 74 65 73 74 73 2f 73 69  st....* tests/si
01f0: 6d 70 6c 65 43 6c 69 65 6e 74 2e 74 63 6c 3a 20  mpleClient.tcl: 
0200: 0a 09 2a 20 74 65 73 74 73 2f 73 69 6d 70 6c 65  ..* tests/simple
0210: 53 65 72 76 65 72 2e 74 63 6c 3a 20 61 64 64 65  Server.tcl: adde
0220: 64 20 73 69 6d 70 6c 65 20 63 6c 69 65 6e 74 2f  d simple client/
0230: 73 65 72 76 65 72 20 74 65 73 74 20 73 63 72 69  server test scri
0240: 70 74 73 0a 09 74 68 61 74 20 75 73 65 20 74 65  pts..that use te
0250: 73 74 20 63 65 72 74 73 20 61 6e 64 20 63 61 6e  st certs and can
0260: 20 64 6f 20 73 69 6d 70 6c 65 20 73 74 72 65 73   do simple stres
0270: 73 20 74 65 73 74 73 2e 0a 0a 32 30 30 30 2d 30  s tests...2000-0
0280: 38 2d 31 34 20 20 4a 65 66 66 20 48 6f 62 62 73  8-14  Jeff Hobbs
0290: 20 20 3c 68 6f 62 62 73 40 73 63 72 69 70 74 69    <hobbs@scripti
02a0: 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 49  cs.com>...* tlsI
02b0: 6e 74 2e 68 3a 0a 09 2a 20 74 6c 73 49 4f 2e 63  nt.h:..* tlsIO.c
02c0: 3a 0a 09 2a 20 74 6c 73 42 49 4f 2e 63 3a 0a 09  :..* tlsBIO.c:..
02d0: 2a 20 74 6c 73 2e 63 3a 20 63 68 61 6e 67 65 64  * tls.c: changed
02e0: 20 61 72 6f 75 6e 64 20 74 6f 20 6f 6e 6c 79 20   around to only 
02f0: 77 6f 72 6b 69 6e 67 20 77 69 74 68 20 38 2e 32  working with 8.2
0300: 2e 30 2b 20 28 38 2e 33 2e 32 2b 0a 09 70 72 65  .0+ (8.3.2+..pre
0310: 66 65 72 72 65 64 29 2c 20 77 69 74 68 20 72 75  ferred), with ru
0320: 6e 74 69 6d 65 20 63 68 65 63 6b 73 20 66 6f 72  ntime checks for
0330: 20 70 72 65 2d 20 61 6e 64 20 70 6f 73 74 2d 69   pre- and post-i
0340: 6f 2d 72 65 77 72 69 74 65 2e 0a 0a 09 2a 20 74  o-rewrite....* t
0350: 6c 73 2e 63 20 28 54 6c 73 5f 49 6e 69 74 29 3a  ls.c (Tls_Init):
0360: 20 63 68 61 6e 67 65 64 20 69 74 20 74 6f 20 72   changed it to r
0370: 65 71 75 69 72 65 20 38 2e 33 2e 32 20 77 68 65  equire 8.3.2 whe
0380: 6e 20 54 63 6c 5f 49 6e 69 74 53 74 75 62 73 0a  n Tcl_InitStubs.
0390: 09 77 61 73 20 63 61 6c 6c 65 64 20 62 65 63 61  .was called beca
03a0: 75 73 65 20 77 65 20 64 6f 6e 27 74 20 77 61 6e  use we don't wan
03b0: 74 20 70 65 6f 70 6c 65 20 75 73 69 6e 67 20 54  t people using T
03c0: 4c 53 20 77 69 74 68 20 74 68 65 0a 09 6f 72 69  LS with the..ori
03d0: 67 69 6e 61 6c 20 73 74 61 63 6b 65 64 20 63 68  ginal stacked ch
03e0: 61 6e 6e 65 6c 20 69 6d 70 6c 65 6d 65 6e 74 61  annel implementa
03f0: 74 69 6f 6e 2e 0a 0a 32 30 30 30 2d 30 37 2d 32  tion...2000-07-2
0400: 36 20 20 4a 65 66 66 20 48 6f 62 62 73 20 20 3c  6  Jeff Hobbs  <
0410: 68 6f 62 62 73 40 73 63 72 69 70 74 69 63 73 2e  hobbs@scriptics.
0420: 63 6f 6d 3e 0a 0a 09 2a 20 6d 65 72 67 65 64 20  com>...* merged 
0430: 61 6c 6c 20 63 68 61 6e 67 65 73 20 66 72 6f 6d  all changes from
0440: 20 74 6c 73 2d 31 2d 33 2d 69 6f 2d 72 65 77 72   tls-1-3-io-rewr
0450: 69 74 65 20 62 61 63 6b 20 69 6e 74 6f 20 6d 61  ite back into ma
0460: 69 6e 20 62 72 61 6e 63 68 0a 0a 09 2a 20 74 65  in branch...* te
0470: 73 74 73 2f 74 6c 73 49 4f 2e 74 65 73 74 3a 20  sts/tlsIO.test: 
0480: 75 70 64 61 74 65 64 20 63 6f 6d 6d 65 6e 74 73  updated comments
0490: 2c 20 66 69 78 65 64 20 61 20 70 63 43 72 61 73  , fixed a pcCras
04a0: 68 20 63 61 73 65 20 74 68 61 74 0a 09 77 61 73  h case that..was
04b0: 20 64 75 65 20 74 6f 20 64 65 62 75 67 20 61 73   due to debug as
04c0: 73 65 72 74 69 6f 6e 20 69 6e 20 57 69 6e 64 6f  sertion in Windo
04d0: 77 73 20 53 53 4c 2e 0a 0a 09 2a 20 74 6c 73 2e  ws SSL....* tls.
04e0: 63 20 28 49 6d 70 6f 72 74 4f 62 6a 43 6d 64 29  c (ImportObjCmd)
04f0: 3a 20 72 65 6d 6f 76 65 64 20 75 6e 6e 65 63 65  : removed unnece
0500: 73 73 61 72 79 20 75 73 65 20 6f 66 20 27 62 69  ssary use of 'bi
0510: 6f 27 20 61 72 67 2e 0a 09 28 54 6c 73 5f 49 6e  o' arg...(Tls_In
0520: 69 74 29 3a 20 63 68 65 63 6b 20 72 65 74 75 72  it): check retur
0530: 6e 20 76 61 6c 75 65 20 6f 66 20 53 53 4c 5f 6c  n value of SSL_l
0540: 69 62 72 61 72 79 5f 69 6e 69 74 2e 20 20 41 6c  ibrary_init.  Al
0550: 73 6f 20 6c 6f 74 73 20 6f 66 0a 09 77 68 69 74  so lots of..whit
0560: 65 73 70 61 63 65 20 63 6c 65 61 6e 75 70 20 28  espace cleanup (
0570: 6d 6f 72 65 20 6c 69 6b 65 20 54 63 6c 20 45 6e  more like Tcl En
0580: 67 20 73 74 79 6c 65 20 67 75 69 64 65 29 2c 20  g style guide), 
0590: 62 75 74 20 6e 6f 74 20 61 6c 6c 0a 09 63 6f 64  but not all..cod
05a0: 65 20 77 61 73 20 63 6c 65 61 6e 65 64 20 75 70  e was cleaned up
05b0: 2e 0a 0a 09 2a 20 74 6c 73 42 49 4f 2e 63 3a 20  ....* tlsBIO.c: 
05c0: 6d 69 6e 6f 72 20 77 68 69 74 65 73 70 61 63 65  minor whitespace
05d0: 20 63 6c 65 61 6e 75 70 0a 0a 09 2a 20 74 6c 73   cleanup...* tls
05e0: 49 4f 2e 63 3a 20 6d 69 6e 6f 72 20 77 68 69 74  IO.c: minor whit
05f0: 65 73 70 61 63 65 20 63 6c 65 61 6e 75 70 2e 0a  espace cleanup..
0600: 09 28 54 6c 73 49 6e 70 75 74 50 72 6f 63 2c 20  .(TlsInputProc, 
0610: 54 6c 73 4f 75 74 70 75 74 50 72 6f 63 29 3a 20  TlsOutputProc): 
0620: 41 64 64 65 64 20 45 52 52 5f 63 6c 65 61 72 5f  Added ERR_clear_
0630: 65 72 72 6f 72 20 62 65 66 6f 72 65 20 63 61 6c  error before cal
0640: 6c 73 0a 09 74 6f 20 42 49 4f 5f 72 65 61 64 20  ls..to BIO_read 
0650: 6f 72 20 42 49 4f 5f 77 72 69 74 65 2c 20 62 65  or BIO_write, be
0660: 63 61 75 73 65 20 77 65 20 63 6f 75 6c 64 20 6f  cause we could o
0670: 74 68 65 72 77 69 73 65 20 65 6e 64 20 75 70 0a  therwise end up.
0680: 09 70 75 6c 6c 69 6e 67 20 61 6e 20 65 72 72 6f  .pulling an erro
0690: 72 20 6f 66 66 20 74 68 65 20 73 74 61 63 6b 20  r off the stack 
06a0: 74 68 61 74 20 64 69 64 6e 27 74 20 62 65 6c 6f  that didn't belo
06b0: 6e 67 20 74 6f 20 75 73 2e 20 20 41 6c 73 6f 0a  ng to us.  Also.
06c0: 09 63 6c 65 61 6e 75 70 20 75 70 20 65 78 63 65  .cleanup up exce
06d0: 73 73 69 76 65 20 75 73 65 20 6f 66 20 67 6f 74  ssive use of got
06e0: 6f 73 2e 0a 0a 32 30 30 30 2d 30 37 2d 32 30 20  os...2000-07-20 
06f0: 20 4a 65 66 66 20 48 6f 62 62 73 20 20 3c 68 6f   Jeff Hobbs  <ho
0700: 62 62 73 40 73 63 72 69 70 74 69 63 73 2e 63 6f  bbs@scriptics.co
0710: 6d 3e 0a 0a 09 2a 20 74 65 73 74 73 2f 74 6c 73  m>...* tests/tls
0720: 49 4f 2e 74 65 73 74 3a 20 63 6f 72 72 65 63 74  IO.test: correct
0730: 65 64 20 76 61 72 69 6f 75 73 20 74 65 73 74 73  ed various tests
0740: 20 74 6f 20 62 65 20 63 6f 72 72 65 63 74 20 66   to be correct f
0750: 6f 72 20 54 4c 53 0a 09 73 74 61 63 6b 65 64 20  or TLS..stacked 
0760: 63 68 61 6e 6e 65 6c 73 20 28 61 73 20 6f 70 70  channels (as opp
0770: 6f 73 65 64 20 74 6f 20 74 68 65 20 73 74 61 6e  osed to the stan
0780: 64 61 72 64 20 73 6f 63 6b 65 74 73 20 74 68 65  dard sockets the
0790: 20 74 65 73 74 0a 09 73 75 69 74 65 20 77 61 73   test..suite was
07a0: 20 61 64 6f 70 74 65 64 20 66 72 6f 6d 29 2e 20   adopted from). 
07b0: 20 4b 65 79 20 64 69 66 66 65 72 65 6e 63 65 73   Key differences
07c0: 20 61 72 65 20 74 68 61 74 20 54 4c 53 20 63 61   are that TLS ca
07d0: 6e 6e 6f 74 0a 09 6f 70 65 72 61 74 65 20 69 6e  nnot..operate in
07e0: 20 6f 6e 65 20 70 72 6f 63 65 73 73 20 77 69 74   one process wit
07f0: 68 6f 75 74 20 61 6c 6c 20 63 68 61 6e 6e 65 6c  hout all channel
0800: 73 20 62 65 69 6e 67 20 6e 6f 6e 2d 62 6c 6f 63  s being non-bloc
0810: 6b 69 6e 67 2c 20 6f 72 0a 09 74 68 65 20 68 61  king, or..the ha
0820: 6e 64 73 68 61 6b 65 20 77 69 6c 6c 20 62 6c 6f  ndshake will blo
0830: 63 6b 2c 20 61 6e 64 20 68 61 6e 64 73 68 61 6b  ck, and handshak
0840: 69 6e 67 20 6d 75 73 74 20 62 65 20 66 6f 72 63  ing must be forc
0850: 65 64 20 69 6e 20 73 6f 6d 65 0a 09 63 61 73 65  ed in some..case
0860: 73 2e 20 20 41 6c 73 6f 2c 20 68 61 6e 64 73 68  s.  Also, handsh
0870: 61 6b 65 73 20 64 6f 6e 27 74 20 73 65 65 6d 20  akes don't seem 
0880: 74 6f 20 63 6f 6d 70 6c 65 74 65 20 75 6e 6c 65  to complete unle
0890: 73 73 20 74 68 65 20 63 6c 69 65 6e 74 0a 09 68  ss the client..h
08a0: 61 73 20 70 6c 61 63 65 64 20 61 74 20 6c 65 61  as placed at lea
08b0: 73 74 20 6f 6e 65 20 62 79 74 65 20 66 6f 72 20  st one byte for 
08c0: 74 68 65 20 73 65 72 76 65 72 20 74 6f 20 72 65  the server to re
08d0: 61 64 20 69 6e 20 74 68 65 20 63 68 61 6e 6e 65  ad in the channe
08e0: 6c 2e 0a 0a 09 2a 20 74 65 73 74 73 2f 72 65 6d  l....* tests/rem
08f0: 6f 74 65 2e 74 63 6c 3a 20 63 6f 72 72 65 63 74  ote.tcl: correct
0900: 65 64 20 74 68 65 20 66 69 6e 64 69 6e 67 20 6f  ed the finding o
0910: 66 20 74 65 73 74 73 20 63 65 72 74 69 66 69 63  f tests certific
0920: 61 74 65 73 0a 0a 09 2a 20 74 6c 73 49 4f 2e 63  ates...* tlsIO.c
0930: 20 28 54 6c 73 43 6c 6f 73 65 50 72 6f 63 29 3a   (TlsCloseProc):
0940: 20 72 65 6d 6f 76 65 64 20 64 65 6c 65 74 69 6e   removed deletin
0950: 67 20 6f 66 20 74 69 6d 65 72 20 68 61 6e 64 6c  g of timer handl
0960: 65 72 20 61 73 0a 09 74 68 61 74 20 69 73 20 68  er as..that is h
0970: 61 6e 64 6c 65 64 20 62 79 20 54 6c 73 5f 43 6c  andled by Tls_Cl
0980: 65 61 6e 2e 0a 0a 09 2a 20 74 6c 73 2e 74 63 6c  ean....* tls.tcl
0990: 20 28 74 6c 73 3a 3a 5f 61 63 63 65 70 74 29 3a   (tls::_accept):
09a0: 20 63 6f 72 72 65 63 74 65 64 20 74 68 65 20 69   corrected the i
09b0: 6e 74 65 72 6e 61 6c 20 5f 61 63 63 65 70 74 20  nternal _accept 
09c0: 74 6f 0a 09 74 72 69 63 6b 6c 65 20 63 61 6c 6c  to..trickle call
09d0: 62 61 63 6b 20 65 72 72 6f 72 73 20 74 6f 20 74  back errors to t
09e0: 68 65 20 75 73 65 72 2e 0a 0a 09 2a 20 4d 61 6b  he user....* Mak
09f0: 65 66 69 6c 65 2e 69 6e 3a 20 6d 61 64 65 20 74  efile.in: made t
0a00: 68 65 20 69 6e 73 74 61 6c 6c 2d 62 69 6e 61 72  he install-binar
0a10: 69 65 73 20 74 61 72 67 65 74 20 72 65 67 65 6e  ies target regen
0a20: 65 72 61 74 65 20 74 68 65 0a 09 70 6b 67 49 6e  erate the..pkgIn
0a30: 64 65 78 2e 74 63 6c 20 63 6f 72 72 65 63 74 6c  dex.tcl correctl
0a40: 79 2e 20 20 54 68 65 20 74 65 73 74 20 74 61 72  y.  The test tar
0a50: 67 65 74 20 70 72 6f 62 61 62 6c 79 20 73 68 6f  get probably sho
0a60: 75 6c 64 6e 27 74 20 73 63 72 65 77 0a 09 69 74  uldn't screw..it
0a70: 20 75 70 2c 20 62 75 74 20 74 68 69 73 20 69 73   up, but this is
0a80: 20 74 6f 20 62 65 20 6f 6e 20 74 68 65 20 73 61   to be on the sa
0a90: 66 65 20 73 69 64 65 2e 0a 0a 32 30 30 30 2d 30  fe side...2000-0
0aa0: 37 2d 31 37 20 20 4a 65 66 66 20 48 6f 62 62 73  7-17  Jeff Hobbs
0ab0: 20 20 3c 68 6f 62 62 73 40 73 63 72 69 70 74 69    <hobbs@scripti
0ac0: 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 70 6b 67 49  cs.com>...* pkgI
0ad0: 6e 64 65 78 2e 74 63 6c 2e 69 6e 3a 0a 09 2a 20  ndex.tcl.in:..* 
0ae0: 63 6f 6e 66 69 67 75 72 65 2e 69 6e 3a 20 75 70  configure.in: up
0af0: 64 61 74 65 64 20 76 65 72 73 69 6f 6e 20 74 6f  dated version to
0b00: 20 31 2e 34 0a 0a 32 30 30 30 2d 30 37 2d 31 33   1.4..2000-07-13
0b10: 20 20 4a 65 66 66 20 48 6f 62 62 73 20 20 3c 68    Jeff Hobbs  <h
0b20: 6f 62 62 73 40 73 63 72 69 70 74 69 63 73 2e 63  obbs@scriptics.c
0b30: 6f 6d 3e 0a 0a 09 2a 20 74 65 73 74 73 2f 74 6c  om>...* tests/tl
0b40: 73 49 4f 2e 74 65 73 74 3a 20 65 6e 61 62 6c 65  sIO.test: enable
0b50: 64 20 74 65 73 74 73 20 32 2e 31 30 2c 20 37 2e  d tests 2.10, 7.
0b60: 5b 31 32 34 35 5d 20 28 74 68 65 72 65 20 69 73  [1245] (there is
0b70: 20 6e 6f 20 33 29 2c 0a 09 77 68 69 63 68 20 6e   no 3),..which n
0b80: 6f 77 20 70 61 73 73 2e 20 20 41 64 64 65 64 20  ow pass.  Added 
0b90: 73 6f 6d 65 20 63 6f 6d 6d 65 6e 74 73 20 74 6f  some comments to
0ba0: 20 6f 74 68 65 72 20 66 61 69 6c 69 6e 67 20 74   other failing t
0bb0: 65 73 74 73 2e 0a 0a 32 30 30 30 2d 30 37 2d 31  ests...2000-07-1
0bc0: 31 20 20 4a 65 66 66 20 48 6f 62 62 73 20 20 3c  1  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 74 6c 73 49 4f 2e 63  com>...* tlsIO.c
0bf0: 3a 20 63 68 61 6e 67 65 64 20 61 6c 6c 20 74 68  : changed all th
0c00: 65 20 63 68 61 6e 6e 65 6c 20 70 72 6f 63 73 20  e channel procs 
0c10: 74 6f 20 73 74 61 72 74 20 77 69 74 68 20 54 6c  to start with Tl
0c20: 73 2a 20 66 6f 72 0a 09 62 65 74 74 65 72 20 70  s* for..better p
0c30: 61 72 69 74 79 20 77 68 65 6e 20 63 6f 6d 70 61  arity when compa
0c40: 72 69 6e 67 20 77 69 74 68 20 54 72 61 6e 73 66  ring with Transf
0c50: 6f 72 6d 20 63 68 61 6e 6e 65 6c 20 70 72 6f 63  orm channel proc
0c60: 73 2e 0a 09 52 65 77 72 6f 74 65 20 54 6c 73 57  s...Rewrote TlsW
0c70: 61 74 63 68 50 72 6f 63 2c 20 61 64 64 65 64 20  atchProc, added 
0c80: 54 6c 73 4e 6f 74 69 66 79 50 72 6f 63 20 61 63  TlsNotifyProc ac
0c90: 63 6f 72 64 69 6e 67 20 74 6f 20 74 68 65 20 6e  cording to the n
0ca0: 65 77 0a 09 63 68 61 6e 6e 65 6c 20 64 65 73 69  ew..channel desi
0cb0: 67 6e 2c 20 77 68 69 63 68 20 61 6c 73 6f 20 6c  gn, which also l
0cc0: 65 61 76 65 73 20 54 6c 73 43 68 61 6e 6e 65 6c  eaves TlsChannel
0cd0: 48 61 6e 64 6c 65 72 20 75 6e 75 73 65 64 2e 0a  Handler unused..
0ce0: 0a 09 2a 20 74 6c 73 42 49 4f 2e 63 20 28 42 69  ..* tlsBIO.c (Bi
0cf0: 6f 43 74 72 6c 29 3a 20 63 68 61 6e 67 65 64 20  oCtrl): changed 
0d00: 42 49 4f 5f 43 54 52 4c 5f 46 4c 55 53 48 20 63  BIO_CTRL_FLUSH c
0d10: 61 73 65 20 74 6f 20 75 73 65 0a 09 54 63 6c 5f  ase to use..Tcl_
0d20: 57 72 69 74 65 52 61 77 20 69 6e 73 74 65 61 64  WriteRaw instead
0d30: 20 6f 66 20 54 63 6c 5f 46 6c 75 73 68 20 28 74   of Tcl_Flush (t
0d40: 6f 20 6f 70 65 72 61 74 65 20 6f 6e 20 63 6f 72  o operate on cor
0d50: 72 65 63 74 20 63 68 61 6e 6e 65 6c 0a 09 69 6e  rect channel..in
0d60: 20 74 68 65 20 73 74 61 63 6b 20 69 6e 73 74 65   the stack inste
0d70: 61 64 20 6f 66 20 73 74 61 72 74 69 6e 67 20 61  ad of starting a
0d80: 74 20 74 68 65 20 74 6f 70 20 61 67 61 69 6e 29  t the top again)
0d90: 2e 20 20 57 6f 75 6c 64 0a 09 6f 74 68 65 72 77  .  Would..otherw
0da0: 69 73 65 20 63 61 75 73 65 20 61 20 72 65 63 75  ise cause a recu
0db0: 72 73 69 76 65 20 73 74 61 63 6b 20 62 6f 6d 62  rsive stack bomb
0dc0: 20 77 68 65 6e 20 69 6d 70 6c 69 63 69 74 20 68   when implicit h
0dd0: 61 6e 64 73 68 61 6b 69 6e 67 0a 09 74 6f 6f 6b  andshaking..took
0de0: 20 65 66 66 65 63 74 2e 0a 0a 09 2a 20 74 65 73   effect....* tes
0df0: 74 73 2f 74 6c 73 49 4f 2e 74 65 73 74 3a 20 72  ts/tlsIO.test: r
0e00: 65 6d 6f 76 65 64 20 63 68 61 6e 67 65 73 20 6d  emoved changes m
0e10: 61 64 65 20 74 6f 20 74 65 73 74 20 73 75 69 74  ade to test suit
0e20: 65 20 28 61 6c 6c 20 74 65 73 74 73 0a 09 74 68  e (all tests..th
0e30: 61 74 20 72 61 6e 20 62 65 66 6f 72 65 20 6e 6f  at ran before no
0e40: 77 20 70 61 73 73 20 63 6f 72 72 65 63 74 6c 79  w pass correctly
0e50: 29 2c 20 61 6e 64 20 63 68 61 6e 67 65 64 20 73  ), and changed s
0e60: 6f 6d 65 20 61 63 63 65 70 74 20 70 72 6f 63 0a  ome accept proc.
0e70: 09 61 72 67 73 20 74 6f 20 72 65 66 6c 65 63 74  .args to reflect
0e80: 20 74 68 61 74 20 61 20 73 6f 63 6b 20 69 73 20   that a sock is 
0e90: 61 6e 20 61 72 67 2c 20 6e 6f 74 20 61 20 66 69  an arg, not a fi
0ea0: 6c 65 2e 0a 0a 32 30 30 30 2d 30 37 2d 31 30 20  le...2000-07-10 
0eb0: 20 4a 65 66 66 20 48 6f 62 62 73 20 20 3c 68 6f   Jeff Hobbs  <ho
0ec0: 62 62 73 40 73 63 72 69 70 74 69 63 73 2e 63 6f  bbs@scriptics.co
0ed0: 6d 3e 0a 0a 09 2a 20 74 6c 73 42 49 4f 2e 63 20  m>...* tlsBIO.c 
0ee0: 28 42 69 6f 57 72 69 74 65 2c 20 42 69 6f 52 65  (BioWrite, BioRe
0ef0: 61 64 29 3a 20 63 68 61 6e 67 65 64 20 54 63 6c  ad): changed Tcl
0f00: 5f 52 65 61 64 2f 57 72 69 74 65 20 74 6f 0a 09  _Read/Write to..
0f10: 54 63 6c 5f 52 65 61 64 52 61 77 2f 54 63 6c 57  Tcl_ReadRaw/TclW
0f20: 72 69 74 65 52 61 77 2e 0a 0a 09 2a 20 74 6c 73  riteRaw....* tls
0f30: 2e 63 3a 20 61 64 64 65 64 20 75 73 65 20 6f 66  .c: added use of
0f40: 20 54 63 6c 5f 47 65 74 54 6f 70 43 68 61 6e 6e   Tcl_GetTopChann
0f50: 65 6c 20 61 66 74 65 72 20 54 63 6c 5f 47 65 74  el after Tcl_Get
0f60: 43 68 61 6e 6e 65 6c 20 61 6e 64 0a 09 67 6f 74  Channel and..got
0f70: 20 72 65 74 75 72 6e 20 76 61 6c 75 65 20 66 72   return value fr
0f80: 6f 6d 20 54 63 6c 5f 53 74 61 63 6b 43 68 61 6e  om Tcl_StackChan
0f90: 6e 65 6c 2e 0a 0a 09 2a 20 74 65 73 74 73 2f 74  nel....* tests/t
0fa0: 6c 73 49 4f 2e 74 65 73 74 3a 20 61 64 64 65 64  lsIO.test: added
0fb0: 20 73 6f 6d 65 20 68 61 6e 64 73 68 61 6b 69 6e   some handshakin
0fc0: 67 20 74 68 61 74 20 73 68 6f 75 6c 64 6e 27 74  g that shouldn't
0fd0: 20 62 65 0a 09 6e 65 63 65 73 73 61 72 79 2c 20   be..necessary, 
0fe0: 62 75 74 20 77 65 20 63 72 61 73 68 20 6f 74 68  but we crash oth
0ff0: 65 72 77 69 73 65 20 28 6e 65 65 64 73 20 6d 6f  erwise (needs mo
1000: 72 65 20 74 65 73 74 69 6e 67 29 2e 0a 0a 09 2a  re testing)....*
1010: 20 74 6c 73 49 4f 2e 63 3a 20 61 64 64 65 64 20   tlsIO.c: added 
1020: 73 75 70 70 6f 72 74 20 66 6f 72 20 22 63 6f 72  support for "cor
1030: 72 65 63 74 65 64 22 20 73 74 61 63 6b 65 64 20  rected" stacked 
1040: 63 68 61 6e 6e 65 6c 73 2e 20 20 41 6c 6c 0a 09  channels.  All..
1050: 74 68 65 20 61 62 6f 76 65 20 63 68 61 6e 6e 65  the above channe
1060: 6c 73 20 61 72 65 20 69 6e 20 54 43 4c 5f 43 48  ls are in TCL_CH
1070: 41 4e 4e 45 4c 5f 56 45 52 53 49 4f 4e 5f 32 20  ANNEL_VERSION_2 
1080: 23 69 66 64 65 66 73 2e 0a 0a 32 30 30 30 2d 30  #ifdefs...2000-0
1090: 36 2d 30 35 20 20 53 63 6f 74 74 20 53 74 61 6e  6-05  Scott Stan
10a0: 74 6f 6e 20 20 3c 73 74 61 6e 74 6f 6e 40 61 6a  ton  <stanton@aj
10b0: 75 62 61 73 6f 6c 75 74 69 6f 6e 73 2e 63 6f 6d  ubasolutions.com
10c0: 3e 0a 0a 09 2a 20 4d 61 6b 65 66 69 6c 65 2e 69  >...* Makefile.i
10d0: 6e 3a 20 46 69 78 65 64 20 62 72 6f 6b 65 6e 20  n: Fixed broken 
10e0: 74 65 73 74 20 74 61 72 67 65 74 2e 0a 0a 09 2a  test target....*
10f0: 20 74 6c 73 49 6e 74 2e 68 3a 20 0a 09 2a 20 74   tlsInt.h: ..* t
1100: 6c 73 2e 63 3a 20 43 6c 65 61 6e 65 64 20 75 70  ls.c: Cleaned up
1110: 20 64 65 63 6c 61 72 61 74 69 6f 6e 73 20 6f 66   declarations of
1120: 20 54 6c 73 5f 43 6c 65 61 6e 20 74 6f 20 61 76   Tls_Clean to av
1130: 6f 69 64 20 65 72 72 6f 72 73 20 6f 6e 0a 09 57  oid errors on..W
1140: 69 6e 64 6f 77 73 20 28 6c 69 6e 74 29 2e 0a 0a  indows (lint)...
1150: 32 30 30 30 2d 30 36 2d 30 35 20 20 42 72 65 6e  2000-06-05  Bren
1160: 74 20 57 65 6c 63 68 20 3c 77 65 6c 63 68 40 61  t Welch <welch@a
1170: 6a 75 62 61 73 6f 6c 75 74 69 6f 6e 73 2e 63 6f  jubasolutions.co
1180: 6d 3e 0a 0a 09 2a 20 74 6c 73 2e 63 2c 20 74 6c  m>...* tls.c, tl
1190: 73 49 4f 2e 63 3a 20 20 53 70 6c 69 74 20 54 6c  sIO.c:  Split Tl
11a0: 73 5f 46 72 65 65 20 69 6e 74 6f 20 54 6c 73 5f  s_Free into Tls_
11b0: 43 6c 65 61 6e 2c 20 77 68 69 63 68 20 64 6f 65  Clean, which doe
11c0: 73 0a 09 74 68 65 20 53 53 4c 20 63 6c 65 61 6e  s..the SSL clean
11d0: 75 70 2c 20 61 6e 64 20 74 68 65 20 54 63 6c 5f  up, and the Tcl_
11e0: 46 72 65 65 20 63 61 6c 6c 2e 20 20 49 74 20 69  Free call.  It i
11f0: 73 20 69 6d 70 6f 72 74 61 6e 74 20 74 6f 20 73  s important to s
1200: 68 75 74 64 6f 77 6e 0a 09 74 68 65 20 53 53 4c  hutdown..the SSL
1210: 20 73 74 61 74 65 20 22 73 79 6e 63 68 72 6f 6e   state "synchron
1220: 6f 75 73 6c 79 22 20 64 75 72 69 6e 67 20 61 20  ously" during a 
1230: 73 74 61 63 6b 65 64 20 66 6c 75 73 68 2e 0a 0a  stacked flush...
1240: 32 30 30 30 2d 30 36 2d 30 31 20 20 53 63 6f 74  2000-06-01  Scot
1250: 74 20 53 74 61 6e 74 6f 6e 20 20 3c 73 74 61 6e  t Stanton  <stan
1260: 74 6f 6e 40 61 6a 75 62 61 73 6f 6c 75 74 69 6f  ton@ajubasolutio
1270: 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 49  ns.com>...* tlsI
1280: 4f 2e 63 3a 20 52 65 73 74 6f 72 65 64 20 63 61  O.c: Restored ca
1290: 6c 6c 20 74 6f 20 54 63 6c 5f 4e 6f 74 69 66 79  ll to Tcl_Notify
12a0: 43 68 61 6e 6e 65 6c 20 66 72 6f 6d 20 43 68 61  Channel from Cha
12b0: 6e 6e 65 6c 48 61 6e 64 6c 65 72 0a 09 74 6f 20  nnelHandler..to 
12c0: 65 6e 73 75 72 65 20 74 68 61 74 20 65 76 65 6e  ensure that even
12d0: 74 73 20 70 72 6f 70 61 67 61 74 65 20 66 72 6f  ts propagate fro
12e0: 6d 20 74 68 65 20 6c 6f 77 65 72 20 64 72 69 76  m the lower driv
12f0: 65 72 2e 20 20 54 68 69 73 20 6d 61 79 0a 09 72  er.  This may..r
1300: 65 73 75 6c 74 20 69 6e 20 61 6e 20 69 6e 66 69  esult in an infi
1310: 6e 69 74 65 20 6c 6f 6f 70 20 69 6e 20 73 6f 6d  nite loop in som
1320: 65 20 63 61 73 65 73 2c 20 73 6f 20 74 68 69 73  e cases, so this
1330: 20 69 73 20 6e 6f 74 20 61 20 74 6f 74 61 6c 0a   is not a total.
1340: 09 66 69 78 2e 20 20 54 68 69 73 20 6d 61 79 20  .fix.  This may 
1350: 62 65 20 73 75 66 66 69 63 69 65 6e 74 20 66 6f  be sufficient fo
1360: 72 20 6e 6f 77 2c 20 68 6f 77 65 76 65 72 2e 20  r now, however. 
1370: 5b 42 75 67 3a 20 35 36 32 33 5d 0a 0a 32 30 30  [Bug: 5623]..200
1380: 30 2d 30 36 2d 30 31 20 20 53 63 6f 74 74 20 53  0-06-01  Scott S
1390: 74 61 6e 74 6f 6e 20 20 3c 73 74 61 6e 74 6f 6e  tanton  <stanton
13a0: 40 73 63 72 69 70 74 69 63 73 2e 63 6f 6d 3e 0a  @scriptics.com>.
13b0: 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 20 52 65 73  ..* tlsIO.c: Res
13c0: 74 6f 72 65 20 74 68 65 20 70 72 65 76 69 6f 75  tore the previou
13d0: 73 20 76 65 72 73 69 6f 6e 2e 20 20 46 69 78 65  s version.  Fixe
13e0: 64 20 74 68 65 20 43 6c 6f 73 65 50 72 6f 63 20  d the CloseProc 
13f0: 73 6f 0a 09 69 74 20 75 6e 72 65 67 69 73 74 65  so..it unregiste
1400: 72 73 20 74 68 65 20 63 68 61 6e 6e 65 6c 20 68  rs the channel h
1410: 61 6e 64 6c 65 72 20 6f 6e 20 74 68 65 20 73 75  andler on the su
1420: 70 65 72 63 65 64 65 64 20 63 68 61 6e 6e 65 6c  perceded channel
1430: 0a 09 69 6e 73 74 65 61 64 20 6f 66 20 74 68 65  ..instead of the
1440: 20 75 70 70 65 72 20 63 68 61 6e 6e 65 6c 2e 20   upper channel. 
1450: 41 6c 73 6f 20 72 65 6d 6f 76 65 64 20 74 68 65  Also removed the
1460: 20 63 61 6c 6c 20 74 6f 0a 09 54 63 6c 5f 4e 6f   call to..Tcl_No
1470: 74 69 66 79 43 68 61 6e 6e 65 6c 20 69 6e 20 74  tifyChannel in t
1480: 68 65 20 43 68 61 6e 6e 65 6c 48 61 6e 64 6c 65  he ChannelHandle
1490: 72 20 62 65 63 61 75 73 65 20 74 68 69 73 20 77  r because this w
14a0: 69 6c 6c 20 72 65 73 75 6c 74 0a 09 69 6e 20 61  ill result..in a
14b0: 6e 20 69 6e 66 69 6e 69 74 65 20 6c 6f 6f 70 20  n infinite loop 
14c0: 69 66 20 64 61 74 61 20 69 73 20 65 76 65 72 20  if data is ever 
14d0: 62 75 66 66 65 72 65 64 20 69 6e 20 74 68 65 20  buffered in the 
14e0: 42 49 4f 0a 09 73 74 72 75 63 74 75 72 65 2e 20  BIO..structure. 
14f0: 5b 42 75 67 3a 20 35 36 32 33 5d 0a 0a 32 30 30  [Bug: 5623]..200
1500: 30 2d 30 35 2d 33 31 20 20 42 72 65 6e 74 20 57  0-05-31  Brent W
1510: 65 6c 63 68 20 3c 77 65 6c 63 68 40 73 63 72 69  elch <welch@scri
1520: 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74  ptics.com>...* t
1530: 6c 73 2e 63 3a 20 43 68 61 6e 67 65 20 74 68 65  ls.c: Change the
1540: 20 43 68 61 6e 6e 65 6c 48 61 6e 64 6c 65 72 20   ChannelHandler 
1550: 74 6f 20 62 65 20 72 65 67 69 73 74 65 72 65 64  to be registered
1560: 20 6f 6e 20 74 68 65 20 6d 61 69 6e 0a 09 63 68   on the main..ch
1570: 61 6e 6e 65 6c 20 61 73 20 6f 70 70 73 65 64 20  annel as oppsed 
1580: 74 6f 20 74 68 65 20 22 70 61 72 65 6e 74 22 2c  to the "parent",
1590: 20 6f 72 20 73 75 70 65 72 63 65 65 64 65 64 2c   or superceeded,
15a0: 20 63 68 61 6e 6e 65 6c 2e 20 20 54 68 69 73 0a   channel.  This.
15b0: 09 69 73 20 62 65 63 61 75 73 65 20 74 68 65 20  .is because the 
15c0: 73 6f 63 6b 65 74 20 64 72 69 76 65 72 20 6e 6f  socket driver no
15d0: 74 69 66 69 65 73 20 74 68 65 20 6d 61 69 6e 20  tifies the main 
15e0: 63 68 61 6e 6e 65 6c 2c 20 61 6e 64 20 74 68 65  channel, and the
15f0: 72 65 0a 09 61 72 65 20 74 69 6d 65 73 20 77 69  re..are times wi
1600: 74 68 20 74 68 65 20 6d 61 69 6e 20 63 68 61 6e  th the main chan
1610: 6e 65 6c 20 67 65 74 73 20 63 6c 6f 73 65 64 2c  nel gets closed,
1620: 20 62 75 74 20 74 68 65 20 73 75 70 65 72 63 65   but the superce
1630: 64 65 64 0a 09 6f 6e 65 20 69 73 20 6e 6f 74 20  ded..one is not 
1640: 79 65 74 20 63 6c 6f 73 65 64 2e 20 20 49 66 20  yet closed.  If 
1650: 74 68 65 20 63 68 61 6e 6e 65 6c 20 68 61 6e 64  the channel hand
1660: 6c 65 72 20 67 65 74 73 20 74 72 69 67 67 65 72  ler gets trigger
1670: 65 64 20 69 6e 0a 09 74 68 69 73 20 68 61 6c 66  ed in..this half
1680: 2d 6f 70 65 6e 20 73 74 61 74 65 20 69 74 20 69  -open state it i
1690: 73 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74  s associated wit
16a0: 68 20 74 68 65 20 73 75 70 65 72 63 65 65 64 65  h the superceede
16b0: 64 0a 09 63 68 61 6e 6e 65 64 6c 2c 20 62 75 74  d..channedl, but
16c0: 20 75 73 65 73 20 69 74 73 20 70 72 69 76 61 74   uses its privat
16d0: 65 20 70 6f 69 6e 74 65 72 20 74 6f 20 74 68 65  e pointer to the
16e0: 20 6d 61 69 6e 20 63 68 61 6e 6e 65 6c 2c 20 77   main channel, w
16f0: 68 69 63 68 0a 09 69 73 20 6d 6f 73 74 6c 79 20  hich..is mostly 
1700: 64 65 73 74 72 6f 79 65 64 2e 20 20 45 6c 69 6d  destroyed.  Elim
1710: 69 6e 61 74 65 64 20 74 68 65 20 72 65 64 75 6e  inated the redun
1720: 64 61 6e 74 20 63 61 6c 6c 20 74 6f 0a 09 54 63  dant call to..Tc
1730: 6c 5f 4e 6f 74 69 66 79 43 68 61 6e 6e 65 6c 20  l_NotifyChannel 
1740: 66 72 6f 6d 20 54 6c 73 57 61 74 63 68 50 72 6f  from TlsWatchPro
1750: 63 2e 20 5b 42 75 67 3a 20 35 36 32 33 5d 0a     c. [Bug: 5623].