Hex Artifact Content

Artifact 109956acd8f293872a77cc5ef6c4eda14ac11834:


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 65 73 74 73 2f 74 6c 73 49 4f 2e 74 65  * tests/tlsIO.te
0040: 73 74 3a 20 75 70 64 61 74 65 64 20 63 6f 6d 6d  st: updated comm
0050: 65 6e 74 73 2c 20 66 69 78 65 64 20 61 20 70 63  ents, fixed a pc
0060: 43 72 61 73 68 20 63 61 73 65 20 74 68 61 74 0a  Crash case that.
0070: 09 77 61 73 20 64 75 65 20 74 6f 20 64 65 62 75  .was due to debu
0080: 67 20 61 73 73 65 72 74 69 6f 6e 20 69 6e 20 57  g assertion in W
0090: 69 6e 64 6f 77 73 20 53 53 4c 2e 0a 0a 09 2a 20  indows SSL....* 
00a0: 74 6c 73 2e 63 20 28 49 6d 70 6f 72 74 4f 62 6a  tls.c (ImportObj
00b0: 43 6d 64 29 3a 20 72 65 6d 6f 76 65 64 20 75 6e  Cmd): removed un
00c0: 6e 65 63 65 73 73 61 72 79 20 75 73 65 20 6f 66  necessary use of
00d0: 20 27 62 69 6f 27 20 61 72 67 2e 0a 09 28 54 6c   'bio' arg...(Tl
00e0: 73 5f 49 6e 69 74 29 3a 20 63 68 65 63 6b 20 72  s_Init): check r
00f0: 65 74 75 72 6e 20 76 61 6c 75 65 20 6f 66 20 53  eturn value of S
0100: 53 4c 5f 6c 69 62 72 61 72 79 5f 69 6e 69 74 2e  SL_library_init.
0110: 20 20 41 6c 73 6f 20 6c 6f 74 73 20 6f 66 0a 09    Also lots of..
0120: 77 68 69 74 65 73 70 61 63 65 20 63 6c 65 61 6e  whitespace clean
0130: 75 70 20 28 6d 6f 72 65 20 6c 69 6b 65 20 54 63  up (more like Tc
0140: 6c 20 45 6e 67 20 73 74 79 6c 65 20 67 75 69 64  l Eng style guid
0150: 65 29 2c 20 62 75 74 20 6e 6f 74 20 61 6c 6c 0a  e), but not all.
0160: 09 63 6f 64 65 20 77 61 73 20 63 6c 65 61 6e 65  .code was cleane
0170: 64 20 75 70 2e 0a 0a 09 2a 20 74 6c 73 42 49 4f  d up....* tlsBIO
0180: 2e 63 3a 20 6d 69 6e 6f 72 20 77 68 69 74 65 73  .c: minor whites
0190: 70 61 63 65 20 63 6c 65 61 6e 75 70 0a 0a 09 2a  pace cleanup...*
01a0: 20 74 6c 73 49 4f 2e 63 3a 20 6d 69 6e 6f 72 20   tlsIO.c: minor 
01b0: 77 68 69 74 65 73 70 61 63 65 20 63 6c 65 61 6e  whitespace clean
01c0: 75 70 2e 0a 09 28 54 6c 73 49 6e 70 75 74 50 72  up...(TlsInputPr
01d0: 6f 63 2c 20 54 6c 73 4f 75 74 70 75 74 50 72 6f  oc, TlsOutputPro
01e0: 63 29 3a 20 41 64 64 65 64 20 45 52 52 5f 63 6c  c): Added ERR_cl
01f0: 65 61 72 5f 65 72 72 6f 72 20 62 65 66 6f 72 65  ear_error before
0200: 20 63 61 6c 6c 73 0a 09 74 6f 20 42 49 4f 5f 72   calls..to BIO_r
0210: 65 61 64 20 6f 72 20 42 49 4f 5f 77 72 69 74 65  ead or BIO_write
0220: 2c 20 62 65 63 61 75 73 65 20 77 65 20 63 6f 75  , because we cou
0230: 6c 64 20 6f 74 68 65 72 77 69 73 65 20 65 6e 64  ld otherwise end
0240: 20 75 70 0a 09 70 75 6c 6c 69 6e 67 20 61 6e 20   up..pulling an 
0250: 65 72 72 6f 72 20 6f 66 66 20 74 68 65 20 73 74  error off the st
0260: 61 63 6b 20 74 68 61 74 20 64 69 64 6e 27 74 20  ack that didn't 
0270: 62 65 6c 6f 6e 67 20 74 6f 20 75 73 2e 20 20 41  belong to us.  A
0280: 6c 73 6f 0a 09 63 6c 65 61 6e 75 70 20 75 70 20  lso..cleanup up 
0290: 65 78 63 65 73 73 69 76 65 20 75 73 65 20 6f 66  excessive use of
02a0: 20 67 6f 74 6f 73 2e 0a 0a 32 30 30 30 2d 30 37   gotos...2000-07
02b0: 2d 32 30 20 20 4a 65 66 66 20 48 6f 62 62 73 20  -20  Jeff Hobbs 
02c0: 20 3c 68 6f 62 62 73 40 73 63 72 69 70 74 69 63   <hobbs@scriptic
02d0: 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 65 73 74 73  s.com>...* tests
02e0: 2f 74 6c 73 49 4f 2e 74 65 73 74 3a 20 63 6f 72  /tlsIO.test: cor
02f0: 72 65 63 74 65 64 20 76 61 72 69 6f 75 73 20 74  rected various t
0300: 65 73 74 73 20 74 6f 20 62 65 20 63 6f 72 72 65  ests to be corre
0310: 63 74 20 66 6f 72 20 54 4c 53 0a 09 73 74 61 63  ct for TLS..stac
0320: 6b 65 64 20 63 68 61 6e 6e 65 6c 73 20 28 61 73  ked channels (as
0330: 20 6f 70 70 6f 73 65 64 20 74 6f 20 74 68 65 20   opposed to the 
0340: 73 74 61 6e 64 61 72 64 20 73 6f 63 6b 65 74 73  standard sockets
0350: 20 74 68 65 20 74 65 73 74 0a 09 73 75 69 74 65   the test..suite
0360: 20 77 61 73 20 61 64 6f 70 74 65 64 20 66 72 6f   was adopted fro
0370: 6d 29 2e 20 20 4b 65 79 20 64 69 66 66 65 72 65  m).  Key differe
0380: 6e 63 65 73 20 61 72 65 20 74 68 61 74 20 54 4c  nces are that TL
0390: 53 20 63 61 6e 6e 6f 74 0a 09 6f 70 65 72 61 74  S cannot..operat
03a0: 65 20 69 6e 20 6f 6e 65 20 70 72 6f 63 65 73 73  e in one process
03b0: 20 77 69 74 68 6f 75 74 20 61 6c 6c 20 63 68 61   without all cha
03c0: 6e 6e 65 6c 73 20 62 65 69 6e 67 20 6e 6f 6e 2d  nnels being non-
03d0: 62 6c 6f 63 6b 69 6e 67 2c 20 6f 72 0a 09 74 68  blocking, or..th
03e0: 65 20 68 61 6e 64 73 68 61 6b 65 20 77 69 6c 6c  e handshake will
03f0: 20 62 6c 6f 63 6b 2c 20 61 6e 64 20 68 61 6e 64   block, and hand
0400: 73 68 61 6b 69 6e 67 20 6d 75 73 74 20 62 65 20  shaking must be 
0410: 66 6f 72 63 65 64 20 69 6e 20 73 6f 6d 65 0a 09  forced in some..
0420: 63 61 73 65 73 2e 20 20 41 6c 73 6f 2c 20 68 61  cases.  Also, ha
0430: 6e 64 73 68 61 6b 65 73 20 64 6f 6e 27 74 20 73  ndshakes don't s
0440: 65 65 6d 20 74 6f 20 63 6f 6d 70 6c 65 74 65 20  eem to complete 
0450: 75 6e 6c 65 73 73 20 74 68 65 20 63 6c 69 65 6e  unless the clien
0460: 74 0a 09 68 61 73 20 70 6c 61 63 65 64 20 61 74  t..has placed at
0470: 20 6c 65 61 73 74 20 6f 6e 65 20 62 79 74 65 20   least one byte 
0480: 66 6f 72 20 74 68 65 20 73 65 72 76 65 72 20 74  for the server t
0490: 6f 20 72 65 61 64 20 69 6e 20 74 68 65 20 63 68  o read in the ch
04a0: 61 6e 6e 65 6c 2e 0a 0a 09 2a 20 74 65 73 74 73  annel....* tests
04b0: 2f 72 65 6d 6f 74 65 2e 74 63 6c 3a 20 63 6f 72  /remote.tcl: cor
04c0: 72 65 63 74 65 64 20 74 68 65 20 66 69 6e 64 69  rected the findi
04d0: 6e 67 20 6f 66 20 74 65 73 74 73 20 63 65 72 74  ng of tests cert
04e0: 69 66 69 63 61 74 65 73 0a 0a 09 2a 20 74 6c 73  ificates...* tls
04f0: 49 4f 2e 63 20 28 54 6c 73 43 6c 6f 73 65 50 72  IO.c (TlsClosePr
0500: 6f 63 29 3a 20 72 65 6d 6f 76 65 64 20 64 65 6c  oc): removed del
0510: 65 74 69 6e 67 20 6f 66 20 74 69 6d 65 72 20 68  eting of timer h
0520: 61 6e 64 6c 65 72 20 61 73 0a 09 74 68 61 74 20  andler as..that 
0530: 69 73 20 68 61 6e 64 6c 65 64 20 62 79 20 54 6c  is handled by Tl
0540: 73 5f 43 6c 65 61 6e 2e 0a 0a 09 2a 20 74 6c 73  s_Clean....* tls
0550: 2e 74 63 6c 20 28 74 6c 73 3a 3a 5f 61 63 63 65  .tcl (tls::_acce
0560: 70 74 29 3a 20 63 6f 72 72 65 63 74 65 64 20 74  pt): corrected t
0570: 68 65 20 69 6e 74 65 72 6e 61 6c 20 5f 61 63 63  he internal _acc
0580: 65 70 74 20 74 6f 0a 09 74 72 69 63 6b 6c 65 20  ept to..trickle 
0590: 63 61 6c 6c 62 61 63 6b 20 65 72 72 6f 72 73 20  callback errors 
05a0: 74 6f 20 74 68 65 20 75 73 65 72 2e 0a 0a 09 2a  to the user....*
05b0: 20 4d 61 6b 65 66 69 6c 65 2e 69 6e 3a 20 6d 61   Makefile.in: ma
05c0: 64 65 20 74 68 65 20 69 6e 73 74 61 6c 6c 2d 62  de the install-b
05d0: 69 6e 61 72 69 65 73 20 74 61 72 67 65 74 20 72  inaries target r
05e0: 65 67 65 6e 65 72 61 74 65 20 74 68 65 0a 09 70  egenerate the..p
05f0: 6b 67 49 6e 64 65 78 2e 74 63 6c 20 63 6f 72 72  kgIndex.tcl corr
0600: 65 63 74 6c 79 2e 20 20 54 68 65 20 74 65 73 74  ectly.  The test
0610: 20 74 61 72 67 65 74 20 70 72 6f 62 61 62 6c 79   target probably
0620: 20 73 68 6f 75 6c 64 6e 27 74 20 73 63 72 65 77   shouldn't screw
0630: 0a 09 69 74 20 75 70 2c 20 62 75 74 20 74 68 69  ..it up, but thi
0640: 73 20 69 73 20 74 6f 20 62 65 20 6f 6e 20 74 68  s is to be on th
0650: 65 20 73 61 66 65 20 73 69 64 65 2e 0a 0a 32 30  e safe side...20
0660: 30 30 2d 30 37 2d 31 37 20 20 4a 65 66 66 20 48  00-07-17  Jeff H
0670: 6f 62 62 73 20 20 3c 68 6f 62 62 73 40 73 63 72  obbs  <hobbs@scr
0680: 69 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20  iptics.com>...* 
0690: 70 6b 67 49 6e 64 65 78 2e 74 63 6c 2e 69 6e 3a  pkgIndex.tcl.in:
06a0: 0a 09 2a 20 63 6f 6e 66 69 67 75 72 65 2e 69 6e  ..* configure.in
06b0: 3a 20 75 70 64 61 74 65 64 20 76 65 72 73 69 6f  : updated versio
06c0: 6e 20 74 6f 20 31 2e 34 0a 0a 32 30 30 30 2d 30  n to 1.4..2000-0
06d0: 37 2d 31 33 20 20 4a 65 66 66 20 48 6f 62 62 73  7-13  Jeff Hobbs
06e0: 20 20 3c 68 6f 62 62 73 40 73 63 72 69 70 74 69    <hobbs@scripti
06f0: 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 65 73 74  cs.com>...* test
0700: 73 2f 74 6c 73 49 4f 2e 74 65 73 74 3a 20 65 6e  s/tlsIO.test: en
0710: 61 62 6c 65 64 20 74 65 73 74 73 20 32 2e 31 30  abled tests 2.10
0720: 2c 20 37 2e 5b 31 32 34 35 5d 20 28 74 68 65 72  , 7.[1245] (ther
0730: 65 20 69 73 20 6e 6f 20 33 29 2c 0a 09 77 68 69  e is no 3),..whi
0740: 63 68 20 6e 6f 77 20 70 61 73 73 2e 20 20 41 64  ch now pass.  Ad
0750: 64 65 64 20 73 6f 6d 65 20 63 6f 6d 6d 65 6e 74  ded some comment
0760: 73 20 74 6f 20 6f 74 68 65 72 20 66 61 69 6c 69  s to other faili
0770: 6e 67 20 74 65 73 74 73 2e 0a 0a 32 30 30 30 2d  ng tests...2000-
0780: 30 37 2d 31 31 20 20 4a 65 66 66 20 48 6f 62 62  07-11  Jeff Hobb
0790: 73 20 20 3c 68 6f 62 62 73 40 73 63 72 69 70 74  s  <hobbs@script
07a0: 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73  ics.com>...* tls
07b0: 49 4f 2e 63 3a 20 63 68 61 6e 67 65 64 20 61 6c  IO.c: changed al
07c0: 6c 20 74 68 65 20 63 68 61 6e 6e 65 6c 20 70 72  l the channel pr
07d0: 6f 63 73 20 74 6f 20 73 74 61 72 74 20 77 69 74  ocs to start wit
07e0: 68 20 54 6c 73 2a 20 66 6f 72 0a 09 62 65 74 74  h Tls* for..bett
07f0: 65 72 20 70 61 72 69 74 79 20 77 68 65 6e 20 63  er parity when c
0800: 6f 6d 70 61 72 69 6e 67 20 77 69 74 68 20 54 72  omparing with Tr
0810: 61 6e 73 66 6f 72 6d 20 63 68 61 6e 6e 65 6c 20  ansform channel 
0820: 70 72 6f 63 73 2e 0a 09 52 65 77 72 6f 74 65 20  procs...Rewrote 
0830: 54 6c 73 57 61 74 63 68 50 72 6f 63 2c 20 61 64  TlsWatchProc, ad
0840: 64 65 64 20 54 6c 73 4e 6f 74 69 66 79 50 72 6f  ded TlsNotifyPro
0850: 63 20 61 63 63 6f 72 64 69 6e 67 20 74 6f 20 74  c according to t
0860: 68 65 20 6e 65 77 0a 09 63 68 61 6e 6e 65 6c 20  he new..channel 
0870: 64 65 73 69 67 6e 2c 20 77 68 69 63 68 20 61 6c  design, which al
0880: 73 6f 20 6c 65 61 76 65 73 20 54 6c 73 43 68 61  so leaves TlsCha
0890: 6e 6e 65 6c 48 61 6e 64 6c 65 72 20 75 6e 75 73  nnelHandler unus
08a0: 65 64 2e 0a 0a 09 2a 20 74 6c 73 42 49 4f 2e 63  ed....* tlsBIO.c
08b0: 20 28 42 69 6f 43 74 72 6c 29 3a 20 63 68 61 6e   (BioCtrl): chan
08c0: 67 65 64 20 42 49 4f 5f 43 54 52 4c 5f 46 4c 55  ged BIO_CTRL_FLU
08d0: 53 48 20 63 61 73 65 20 74 6f 20 75 73 65 0a 09  SH case to use..
08e0: 54 63 6c 5f 57 72 69 74 65 52 61 77 20 69 6e 73  Tcl_WriteRaw ins
08f0: 74 65 61 64 20 6f 66 20 54 63 6c 5f 46 6c 75 73  tead of Tcl_Flus
0900: 68 20 28 74 6f 20 6f 70 65 72 61 74 65 20 6f 6e  h (to operate on
0910: 20 63 6f 72 72 65 63 74 20 63 68 61 6e 6e 65 6c   correct channel
0920: 0a 09 69 6e 20 74 68 65 20 73 74 61 63 6b 20 69  ..in the stack i
0930: 6e 73 74 65 61 64 20 6f 66 20 73 74 61 72 74 69  nstead of starti
0940: 6e 67 20 61 74 20 74 68 65 20 74 6f 70 20 61 67  ng at the top ag
0950: 61 69 6e 29 2e 20 20 57 6f 75 6c 64 0a 09 6f 74  ain).  Would..ot
0960: 68 65 72 77 69 73 65 20 63 61 75 73 65 20 61 20  herwise cause a 
0970: 72 65 63 75 72 73 69 76 65 20 73 74 61 63 6b 20  recursive stack 
0980: 62 6f 6d 62 20 77 68 65 6e 20 69 6d 70 6c 69 63  bomb when implic
0990: 69 74 20 68 61 6e 64 73 68 61 6b 69 6e 67 0a 09  it handshaking..
09a0: 74 6f 6f 6b 20 65 66 66 65 63 74 2e 0a 0a 09 2a  took effect....*
09b0: 20 74 65 73 74 73 2f 74 6c 73 49 4f 2e 74 65 73   tests/tlsIO.tes
09c0: 74 3a 20 72 65 6d 6f 76 65 64 20 63 68 61 6e 67  t: removed chang
09d0: 65 73 20 6d 61 64 65 20 74 6f 20 74 65 73 74 20  es made to test 
09e0: 73 75 69 74 65 20 28 61 6c 6c 20 74 65 73 74 73  suite (all tests
09f0: 0a 09 74 68 61 74 20 72 61 6e 20 62 65 66 6f 72  ..that ran befor
0a00: 65 20 6e 6f 77 20 70 61 73 73 20 63 6f 72 72 65  e now pass corre
0a10: 63 74 6c 79 29 2c 20 61 6e 64 20 63 68 61 6e 67  ctly), and chang
0a20: 65 64 20 73 6f 6d 65 20 61 63 63 65 70 74 20 70  ed some accept p
0a30: 72 6f 63 0a 09 61 72 67 73 20 74 6f 20 72 65 66  roc..args to ref
0a40: 6c 65 63 74 20 74 68 61 74 20 61 20 73 6f 63 6b  lect that a sock
0a50: 20 69 73 20 61 6e 20 61 72 67 2c 20 6e 6f 74 20   is an arg, not 
0a60: 61 20 66 69 6c 65 2e 0a 0a 32 30 30 30 2d 30 37  a file...2000-07
0a70: 2d 31 30 20 20 4a 65 66 66 20 48 6f 62 62 73 20  -10  Jeff Hobbs 
0a80: 20 3c 68 6f 62 62 73 40 73 63 72 69 70 74 69 63   <hobbs@scriptic
0a90: 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 42 49  s.com>...* tlsBI
0aa0: 4f 2e 63 20 28 42 69 6f 57 72 69 74 65 2c 20 42  O.c (BioWrite, B
0ab0: 69 6f 52 65 61 64 29 3a 20 63 68 61 6e 67 65 64  ioRead): changed
0ac0: 20 54 63 6c 5f 52 65 61 64 2f 57 72 69 74 65 20   Tcl_Read/Write 
0ad0: 74 6f 0a 09 54 63 6c 5f 52 65 61 64 52 61 77 2f  to..Tcl_ReadRaw/
0ae0: 54 63 6c 57 72 69 74 65 52 61 77 2e 0a 0a 09 2a  TclWriteRaw....*
0af0: 20 74 6c 73 2e 63 3a 20 61 64 64 65 64 20 75 73   tls.c: added us
0b00: 65 20 6f 66 20 54 63 6c 5f 47 65 74 54 6f 70 43  e of Tcl_GetTopC
0b10: 68 61 6e 6e 65 6c 20 61 66 74 65 72 20 54 63 6c  hannel after Tcl
0b20: 5f 47 65 74 43 68 61 6e 6e 65 6c 20 61 6e 64 0a  _GetChannel and.
0b30: 09 67 6f 74 20 72 65 74 75 72 6e 20 76 61 6c 75  .got return valu
0b40: 65 20 66 72 6f 6d 20 54 63 6c 5f 53 74 61 63 6b  e from Tcl_Stack
0b50: 43 68 61 6e 6e 65 6c 2e 0a 0a 09 2a 20 74 65 73  Channel....* tes
0b60: 74 73 2f 74 6c 73 49 4f 2e 74 65 73 74 3a 20 61  ts/tlsIO.test: a
0b70: 64 64 65 64 20 73 6f 6d 65 20 68 61 6e 64 73 68  dded some handsh
0b80: 61 6b 69 6e 67 20 74 68 61 74 20 73 68 6f 75 6c  aking that shoul
0b90: 64 6e 27 74 20 62 65 0a 09 6e 65 63 65 73 73 61  dn't be..necessa
0ba0: 72 79 2c 20 62 75 74 20 77 65 20 63 72 61 73 68  ry, but we crash
0bb0: 20 6f 74 68 65 72 77 69 73 65 20 28 6e 65 65 64   otherwise (need
0bc0: 73 20 6d 6f 72 65 20 74 65 73 74 69 6e 67 29 2e  s more testing).
0bd0: 0a 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 20 61 64  ...* tlsIO.c: ad
0be0: 64 65 64 20 73 75 70 70 6f 72 74 20 66 6f 72 20  ded support for 
0bf0: 22 63 6f 72 72 65 63 74 65 64 22 20 73 74 61 63  "corrected" stac
0c00: 6b 65 64 20 63 68 61 6e 6e 65 6c 73 2e 20 20 41  ked channels.  A
0c10: 6c 6c 0a 09 74 68 65 20 61 62 6f 76 65 20 63 68  ll..the above ch
0c20: 61 6e 6e 65 6c 73 20 61 72 65 20 69 6e 20 54 43  annels are in TC
0c30: 4c 5f 43 48 41 4e 4e 45 4c 5f 56 45 52 53 49 4f  L_CHANNEL_VERSIO
0c40: 4e 5f 32 20 23 69 66 64 65 66 73 2e 0a 0a 32 30  N_2 #ifdefs...20
0c50: 30 30 2d 30 36 2d 30 35 20 20 53 63 6f 74 74 20  00-06-05  Scott 
0c60: 53 74 61 6e 74 6f 6e 20 20 3c 73 74 61 6e 74 6f  Stanton  <stanto
0c70: 6e 40 61 6a 75 62 61 73 6f 6c 75 74 69 6f 6e 73  n@ajubasolutions
0c80: 2e 63 6f 6d 3e 0a 0a 09 2a 20 4d 61 6b 65 66 69  .com>...* Makefi
0c90: 6c 65 2e 69 6e 3a 20 46 69 78 65 64 20 62 72 6f  le.in: Fixed bro
0ca0: 6b 65 6e 20 74 65 73 74 20 74 61 72 67 65 74 2e  ken test target.
0cb0: 0a 0a 09 2a 20 74 6c 73 49 6e 74 2e 68 3a 20 0a  ...* tlsInt.h: .
0cc0: 09 2a 20 74 6c 73 2e 63 3a 20 43 6c 65 61 6e 65  .* tls.c: Cleane
0cd0: 64 20 75 70 20 64 65 63 6c 61 72 61 74 69 6f 6e  d up declaration
0ce0: 73 20 6f 66 20 54 6c 73 5f 43 6c 65 61 6e 20 74  s of Tls_Clean t
0cf0: 6f 20 61 76 6f 69 64 20 65 72 72 6f 72 73 20 6f  o avoid errors o
0d00: 6e 0a 09 57 69 6e 64 6f 77 73 20 28 6c 69 6e 74  n..Windows (lint
0d10: 29 2e 0a 0a 32 30 30 30 2d 30 36 2d 30 35 20 20  )...2000-06-05  
0d20: 42 72 65 6e 74 20 57 65 6c 63 68 20 3c 77 65 6c  Brent Welch <wel
0d30: 63 68 40 61 6a 75 62 61 73 6f 6c 75 74 69 6f 6e  ch@ajubasolution
0d40: 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 2e 63  s.com>...* tls.c
0d50: 2c 20 74 6c 73 49 4f 2e 63 3a 20 20 53 70 6c 69  , tlsIO.c:  Spli
0d60: 74 20 54 6c 73 5f 46 72 65 65 20 69 6e 74 6f 20  t Tls_Free into 
0d70: 54 6c 73 5f 43 6c 65 61 6e 2c 20 77 68 69 63 68  Tls_Clean, which
0d80: 20 64 6f 65 73 0a 09 74 68 65 20 53 53 4c 20 63   does..the SSL c
0d90: 6c 65 61 6e 75 70 2c 20 61 6e 64 20 74 68 65 20  leanup, and the 
0da0: 54 63 6c 5f 46 72 65 65 20 63 61 6c 6c 2e 20 20  Tcl_Free call.  
0db0: 49 74 20 69 73 20 69 6d 70 6f 72 74 61 6e 74 20  It is important 
0dc0: 74 6f 20 73 68 75 74 64 6f 77 6e 0a 09 74 68 65  to shutdown..the
0dd0: 20 53 53 4c 20 73 74 61 74 65 20 22 73 79 6e 63   SSL state "sync
0de0: 68 72 6f 6e 6f 75 73 6c 79 22 20 64 75 72 69 6e  hronously" durin
0df0: 67 20 61 20 73 74 61 63 6b 65 64 20 66 6c 75 73  g a stacked flus
0e00: 68 2e 0a 0a 32 30 30 30 2d 30 36 2d 30 31 20 20  h...2000-06-01  
0e10: 53 63 6f 74 74 20 53 74 61 6e 74 6f 6e 20 20 3c  Scott Stanton  <
0e20: 73 74 61 6e 74 6f 6e 40 61 6a 75 62 61 73 6f 6c  stanton@ajubasol
0e30: 75 74 69 6f 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a 20  utions.com>...* 
0e40: 74 6c 73 49 4f 2e 63 3a 20 52 65 73 74 6f 72 65  tlsIO.c: Restore
0e50: 64 20 63 61 6c 6c 20 74 6f 20 54 63 6c 5f 4e 6f  d call to Tcl_No
0e60: 74 69 66 79 43 68 61 6e 6e 65 6c 20 66 72 6f 6d  tifyChannel from
0e70: 20 43 68 61 6e 6e 65 6c 48 61 6e 64 6c 65 72 0a   ChannelHandler.
0e80: 09 74 6f 20 65 6e 73 75 72 65 20 74 68 61 74 20  .to ensure that 
0e90: 65 76 65 6e 74 73 20 70 72 6f 70 61 67 61 74 65  events propagate
0ea0: 20 66 72 6f 6d 20 74 68 65 20 6c 6f 77 65 72 20   from the lower 
0eb0: 64 72 69 76 65 72 2e 20 20 54 68 69 73 20 6d 61  driver.  This ma
0ec0: 79 0a 09 72 65 73 75 6c 74 20 69 6e 20 61 6e 20  y..result in an 
0ed0: 69 6e 66 69 6e 69 74 65 20 6c 6f 6f 70 20 69 6e  infinite loop in
0ee0: 20 73 6f 6d 65 20 63 61 73 65 73 2c 20 73 6f 20   some cases, so 
0ef0: 74 68 69 73 20 69 73 20 6e 6f 74 20 61 20 74 6f  this is not a to
0f00: 74 61 6c 0a 09 66 69 78 2e 20 20 54 68 69 73 20  tal..fix.  This 
0f10: 6d 61 79 20 62 65 20 73 75 66 66 69 63 69 65 6e  may be sufficien
0f20: 74 20 66 6f 72 20 6e 6f 77 2c 20 68 6f 77 65 76  t for now, howev
0f30: 65 72 2e 20 5b 42 75 67 3a 20 35 36 32 33 5d 0a  er. [Bug: 5623].
0f40: 0a 32 30 30 30 2d 30 36 2d 30 31 20 20 53 63 6f  .2000-06-01  Sco
0f50: 74 74 20 53 74 61 6e 74 6f 6e 20 20 3c 73 74 61  tt Stanton  <sta
0f60: 6e 74 6f 6e 40 73 63 72 69 70 74 69 63 73 2e 63  nton@scriptics.c
0f70: 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a  om>...* tlsIO.c:
0f80: 20 52 65 73 74 6f 72 65 20 74 68 65 20 70 72 65   Restore the pre
0f90: 76 69 6f 75 73 20 76 65 72 73 69 6f 6e 2e 20 20  vious version.  
0fa0: 46 69 78 65 64 20 74 68 65 20 43 6c 6f 73 65 50  Fixed the CloseP
0fb0: 72 6f 63 20 73 6f 0a 09 69 74 20 75 6e 72 65 67  roc so..it unreg
0fc0: 69 73 74 65 72 73 20 74 68 65 20 63 68 61 6e 6e  isters the chann
0fd0: 65 6c 20 68 61 6e 64 6c 65 72 20 6f 6e 20 74 68  el handler on th
0fe0: 65 20 73 75 70 65 72 63 65 64 65 64 20 63 68 61  e superceded cha
0ff0: 6e 6e 65 6c 0a 09 69 6e 73 74 65 61 64 20 6f 66  nnel..instead of
1000: 20 74 68 65 20 75 70 70 65 72 20 63 68 61 6e 6e   the upper chann
1010: 65 6c 2e 20 41 6c 73 6f 20 72 65 6d 6f 76 65 64  el. Also removed
1020: 20 74 68 65 20 63 61 6c 6c 20 74 6f 0a 09 54 63   the call to..Tc
1030: 6c 5f 4e 6f 74 69 66 79 43 68 61 6e 6e 65 6c 20  l_NotifyChannel 
1040: 69 6e 20 74 68 65 20 43 68 61 6e 6e 65 6c 48 61  in the ChannelHa
1050: 6e 64 6c 65 72 20 62 65 63 61 75 73 65 20 74 68  ndler because th
1060: 69 73 20 77 69 6c 6c 20 72 65 73 75 6c 74 0a 09  is will result..
1070: 69 6e 20 61 6e 20 69 6e 66 69 6e 69 74 65 20 6c  in an infinite l
1080: 6f 6f 70 20 69 66 20 64 61 74 61 20 69 73 20 65  oop if data is e
1090: 76 65 72 20 62 75 66 66 65 72 65 64 20 69 6e 20  ver buffered in 
10a0: 74 68 65 20 42 49 4f 0a 09 73 74 72 75 63 74 75  the BIO..structu
10b0: 72 65 2e 20 5b 42 75 67 3a 20 35 36 32 33 5d 0a  re. [Bug: 5623].
10c0: 0a 32 30 30 30 2d 30 35 2d 33 31 20 20 42 72 65  .2000-05-31  Bre
10d0: 6e 74 20 57 65 6c 63 68 20 3c 77 65 6c 63 68 40  nt Welch <welch@
10e0: 73 63 72 69 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a  scriptics.com>..
10f0: 09 2a 20 74 6c 73 2e 63 3a 20 43 68 61 6e 67 65  .* tls.c: Change
1100: 20 74 68 65 20 43 68 61 6e 6e 65 6c 48 61 6e 64   the ChannelHand
1110: 6c 65 72 20 74 6f 20 62 65 20 72 65 67 69 73 74  ler to be regist
1120: 65 72 65 64 20 6f 6e 20 74 68 65 20 6d 61 69 6e  ered on the main
1130: 0a 09 63 68 61 6e 6e 65 6c 20 61 73 20 6f 70 70  ..channel as opp
1140: 73 65 64 20 74 6f 20 74 68 65 20 22 70 61 72 65  sed to the "pare
1150: 6e 74 22 2c 20 6f 72 20 73 75 70 65 72 63 65 65  nt", or supercee
1160: 64 65 64 2c 20 63 68 61 6e 6e 65 6c 2e 20 20 54  ded, channel.  T
1170: 68 69 73 0a 09 69 73 20 62 65 63 61 75 73 65 20  his..is because 
1180: 74 68 65 20 73 6f 63 6b 65 74 20 64 72 69 76 65  the socket drive
1190: 72 20 6e 6f 74 69 66 69 65 73 20 74 68 65 20 6d  r notifies the m
11a0: 61 69 6e 20 63 68 61 6e 6e 65 6c 2c 20 61 6e 64  ain channel, and
11b0: 20 74 68 65 72 65 0a 09 61 72 65 20 74 69 6d 65   there..are time
11c0: 73 20 77 69 74 68 20 74 68 65 20 6d 61 69 6e 20  s with the main 
11d0: 63 68 61 6e 6e 65 6c 20 67 65 74 73 20 63 6c 6f  channel gets clo
11e0: 73 65 64 2c 20 62 75 74 20 74 68 65 20 73 75 70  sed, but the sup
11f0: 65 72 63 65 64 65 64 0a 09 6f 6e 65 20 69 73 20  erceded..one is 
1200: 6e 6f 74 20 79 65 74 20 63 6c 6f 73 65 64 2e 20  not yet closed. 
1210: 20 49 66 20 74 68 65 20 63 68 61 6e 6e 65 6c 20   If the channel 
1220: 68 61 6e 64 6c 65 72 20 67 65 74 73 20 74 72 69  handler gets tri
1230: 67 67 65 72 65 64 20 69 6e 0a 09 74 68 69 73 20  ggered in..this 
1240: 68 61 6c 66 2d 6f 70 65 6e 20 73 74 61 74 65 20  half-open state 
1250: 69 74 20 69 73 20 61 73 73 6f 63 69 61 74 65 64  it is associated
1260: 20 77 69 74 68 20 74 68 65 20 73 75 70 65 72 63   with the superc
1270: 65 65 64 65 64 0a 09 63 68 61 6e 6e 65 64 6c 2c  eeded..channedl,
1280: 20 62 75 74 20 75 73 65 73 20 69 74 73 20 70 72   but uses its pr
1290: 69 76 61 74 65 20 70 6f 69 6e 74 65 72 20 74 6f  ivate pointer to
12a0: 20 74 68 65 20 6d 61 69 6e 20 63 68 61 6e 6e 65   the main channe
12b0: 6c 2c 20 77 68 69 63 68 0a 09 69 73 20 6d 6f 73  l, which..is mos
12c0: 74 6c 79 20 64 65 73 74 72 6f 79 65 64 2e 20 20  tly destroyed.  
12d0: 45 6c 69 6d 69 6e 61 74 65 64 20 74 68 65 20 72  Eliminated the r
12e0: 65 64 75 6e 64 61 6e 74 20 63 61 6c 6c 20 74 6f  edundant call to
12f0: 0a 09 54 63 6c 5f 4e 6f 74 69 66 79 43 68 61 6e  ..Tcl_NotifyChan
1300: 6e 65 6c 20 66 72 6f 6d 20 54 6c 73 57 61 74 63  nel from TlsWatc
1310: 68 50 72 6f 63 2e 20 5b 42 75 67 3a 20 35 36 32  hProc. [Bug: 562
1320: 33 5d 0a                                         3].