Hex Artifact Content

Artifact 1fdfd0872c754cbc444b93275a3a2aaf9f94420f:


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 6d 65 72 67 65 64 20 61 6c 6c 20 63 68 61  * merged all cha
0040: 6e 67 65 73 20 66 72 6f 6d 20 74 6c 73 2d 31 2d  nges from tls-1-
0050: 33 2d 69 6f 2d 72 65 77 72 69 74 65 20 62 61 63  3-io-rewrite bac
0060: 6b 20 69 6e 74 6f 20 6d 61 69 6e 20 62 72 61 6e  k into main bran
0070: 63 68 0a 0a 09 2a 20 74 65 73 74 73 2f 74 6c 73  ch...* tests/tls
0080: 49 4f 2e 74 65 73 74 3a 20 75 70 64 61 74 65 64  IO.test: updated
0090: 20 63 6f 6d 6d 65 6e 74 73 2c 20 66 69 78 65 64   comments, fixed
00a0: 20 61 20 70 63 43 72 61 73 68 20 63 61 73 65 20   a pcCrash case 
00b0: 74 68 61 74 0a 09 77 61 73 20 64 75 65 20 74 6f  that..was due to
00c0: 20 64 65 62 75 67 20 61 73 73 65 72 74 69 6f 6e   debug assertion
00d0: 20 69 6e 20 57 69 6e 64 6f 77 73 20 53 53 4c 2e   in Windows SSL.
00e0: 0a 0a 09 2a 20 74 6c 73 2e 63 20 28 49 6d 70 6f  ...* tls.c (Impo
00f0: 72 74 4f 62 6a 43 6d 64 29 3a 20 72 65 6d 6f 76  rtObjCmd): remov
0100: 65 64 20 75 6e 6e 65 63 65 73 73 61 72 79 20 75  ed unnecessary u
0110: 73 65 20 6f 66 20 27 62 69 6f 27 20 61 72 67 2e  se of 'bio' arg.
0120: 0a 09 28 54 6c 73 5f 49 6e 69 74 29 3a 20 63 68  ..(Tls_Init): ch
0130: 65 63 6b 20 72 65 74 75 72 6e 20 76 61 6c 75 65  eck return value
0140: 20 6f 66 20 53 53 4c 5f 6c 69 62 72 61 72 79 5f   of SSL_library_
0150: 69 6e 69 74 2e 20 20 41 6c 73 6f 20 6c 6f 74 73  init.  Also lots
0160: 20 6f 66 0a 09 77 68 69 74 65 73 70 61 63 65 20   of..whitespace 
0170: 63 6c 65 61 6e 75 70 20 28 6d 6f 72 65 20 6c 69  cleanup (more li
0180: 6b 65 20 54 63 6c 20 45 6e 67 20 73 74 79 6c 65  ke Tcl Eng style
0190: 20 67 75 69 64 65 29 2c 20 62 75 74 20 6e 6f 74   guide), but not
01a0: 20 61 6c 6c 0a 09 63 6f 64 65 20 77 61 73 20 63   all..code was c
01b0: 6c 65 61 6e 65 64 20 75 70 2e 0a 0a 09 2a 20 74  leaned up....* t
01c0: 6c 73 42 49 4f 2e 63 3a 20 6d 69 6e 6f 72 20 77  lsBIO.c: minor w
01d0: 68 69 74 65 73 70 61 63 65 20 63 6c 65 61 6e 75  hitespace cleanu
01e0: 70 0a 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 20 6d  p...* tlsIO.c: m
01f0: 69 6e 6f 72 20 77 68 69 74 65 73 70 61 63 65 20  inor whitespace 
0200: 63 6c 65 61 6e 75 70 2e 0a 09 28 54 6c 73 49 6e  cleanup...(TlsIn
0210: 70 75 74 50 72 6f 63 2c 20 54 6c 73 4f 75 74 70  putProc, TlsOutp
0220: 75 74 50 72 6f 63 29 3a 20 41 64 64 65 64 20 45  utProc): Added E
0230: 52 52 5f 63 6c 65 61 72 5f 65 72 72 6f 72 20 62  RR_clear_error b
0240: 65 66 6f 72 65 20 63 61 6c 6c 73 0a 09 74 6f 20  efore calls..to 
0250: 42 49 4f 5f 72 65 61 64 20 6f 72 20 42 49 4f 5f  BIO_read or BIO_
0260: 77 72 69 74 65 2c 20 62 65 63 61 75 73 65 20 77  write, because w
0270: 65 20 63 6f 75 6c 64 20 6f 74 68 65 72 77 69 73  e could otherwis
0280: 65 20 65 6e 64 20 75 70 0a 09 70 75 6c 6c 69 6e  e end up..pullin
0290: 67 20 61 6e 20 65 72 72 6f 72 20 6f 66 66 20 74  g an error off t
02a0: 68 65 20 73 74 61 63 6b 20 74 68 61 74 20 64 69  he stack that di
02b0: 64 6e 27 74 20 62 65 6c 6f 6e 67 20 74 6f 20 75  dn't belong to u
02c0: 73 2e 20 20 41 6c 73 6f 0a 09 63 6c 65 61 6e 75  s.  Also..cleanu
02d0: 70 20 75 70 20 65 78 63 65 73 73 69 76 65 20 75  p up excessive u
02e0: 73 65 20 6f 66 20 67 6f 74 6f 73 2e 0a 0a 32 30  se of gotos...20
02f0: 30 30 2d 30 37 2d 32 30 20 20 4a 65 66 66 20 48  00-07-20  Jeff H
0300: 6f 62 62 73 20 20 3c 68 6f 62 62 73 40 73 63 72  obbs  <hobbs@scr
0310: 69 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20  iptics.com>...* 
0320: 74 65 73 74 73 2f 74 6c 73 49 4f 2e 74 65 73 74  tests/tlsIO.test
0330: 3a 20 63 6f 72 72 65 63 74 65 64 20 76 61 72 69  : corrected vari
0340: 6f 75 73 20 74 65 73 74 73 20 74 6f 20 62 65 20  ous tests to be 
0350: 63 6f 72 72 65 63 74 20 66 6f 72 20 54 4c 53 0a  correct for TLS.
0360: 09 73 74 61 63 6b 65 64 20 63 68 61 6e 6e 65 6c  .stacked channel
0370: 73 20 28 61 73 20 6f 70 70 6f 73 65 64 20 74 6f  s (as opposed to
0380: 20 74 68 65 20 73 74 61 6e 64 61 72 64 20 73 6f   the standard so
0390: 63 6b 65 74 73 20 74 68 65 20 74 65 73 74 0a 09  ckets the test..
03a0: 73 75 69 74 65 20 77 61 73 20 61 64 6f 70 74 65  suite was adopte
03b0: 64 20 66 72 6f 6d 29 2e 20 20 4b 65 79 20 64 69  d from).  Key di
03c0: 66 66 65 72 65 6e 63 65 73 20 61 72 65 20 74 68  fferences are th
03d0: 61 74 20 54 4c 53 20 63 61 6e 6e 6f 74 0a 09 6f  at TLS cannot..o
03e0: 70 65 72 61 74 65 20 69 6e 20 6f 6e 65 20 70 72  perate in one pr
03f0: 6f 63 65 73 73 20 77 69 74 68 6f 75 74 20 61 6c  ocess without al
0400: 6c 20 63 68 61 6e 6e 65 6c 73 20 62 65 69 6e 67  l channels being
0410: 20 6e 6f 6e 2d 62 6c 6f 63 6b 69 6e 67 2c 20 6f   non-blocking, o
0420: 72 0a 09 74 68 65 20 68 61 6e 64 73 68 61 6b 65  r..the handshake
0430: 20 77 69 6c 6c 20 62 6c 6f 63 6b 2c 20 61 6e 64   will block, and
0440: 20 68 61 6e 64 73 68 61 6b 69 6e 67 20 6d 75 73   handshaking mus
0450: 74 20 62 65 20 66 6f 72 63 65 64 20 69 6e 20 73  t be forced in s
0460: 6f 6d 65 0a 09 63 61 73 65 73 2e 20 20 41 6c 73  ome..cases.  Als
0470: 6f 2c 20 68 61 6e 64 73 68 61 6b 65 73 20 64 6f  o, handshakes do
0480: 6e 27 74 20 73 65 65 6d 20 74 6f 20 63 6f 6d 70  n't seem to comp
0490: 6c 65 74 65 20 75 6e 6c 65 73 73 20 74 68 65 20  lete unless the 
04a0: 63 6c 69 65 6e 74 0a 09 68 61 73 20 70 6c 61 63  client..has plac
04b0: 65 64 20 61 74 20 6c 65 61 73 74 20 6f 6e 65 20  ed at least one 
04c0: 62 79 74 65 20 66 6f 72 20 74 68 65 20 73 65 72  byte for the ser
04d0: 76 65 72 20 74 6f 20 72 65 61 64 20 69 6e 20 74  ver to read in t
04e0: 68 65 20 63 68 61 6e 6e 65 6c 2e 0a 0a 09 2a 20  he channel....* 
04f0: 74 65 73 74 73 2f 72 65 6d 6f 74 65 2e 74 63 6c  tests/remote.tcl
0500: 3a 20 63 6f 72 72 65 63 74 65 64 20 74 68 65 20  : corrected the 
0510: 66 69 6e 64 69 6e 67 20 6f 66 20 74 65 73 74 73  finding of tests
0520: 20 63 65 72 74 69 66 69 63 61 74 65 73 0a 0a 09   certificates...
0530: 2a 20 74 6c 73 49 4f 2e 63 20 28 54 6c 73 43 6c  * tlsIO.c (TlsCl
0540: 6f 73 65 50 72 6f 63 29 3a 20 72 65 6d 6f 76 65  oseProc): remove
0550: 64 20 64 65 6c 65 74 69 6e 67 20 6f 66 20 74 69  d deleting of ti
0560: 6d 65 72 20 68 61 6e 64 6c 65 72 20 61 73 0a 09  mer handler as..
0570: 74 68 61 74 20 69 73 20 68 61 6e 64 6c 65 64 20  that is handled 
0580: 62 79 20 54 6c 73 5f 43 6c 65 61 6e 2e 0a 0a 09  by Tls_Clean....
0590: 2a 20 74 6c 73 2e 74 63 6c 20 28 74 6c 73 3a 3a  * tls.tcl (tls::
05a0: 5f 61 63 63 65 70 74 29 3a 20 63 6f 72 72 65 63  _accept): correc
05b0: 74 65 64 20 74 68 65 20 69 6e 74 65 72 6e 61 6c  ted the internal
05c0: 20 5f 61 63 63 65 70 74 20 74 6f 0a 09 74 72 69   _accept to..tri
05d0: 63 6b 6c 65 20 63 61 6c 6c 62 61 63 6b 20 65 72  ckle callback er
05e0: 72 6f 72 73 20 74 6f 20 74 68 65 20 75 73 65 72  rors to the user
05f0: 2e 0a 0a 09 2a 20 4d 61 6b 65 66 69 6c 65 2e 69  ....* Makefile.i
0600: 6e 3a 20 6d 61 64 65 20 74 68 65 20 69 6e 73 74  n: made the inst
0610: 61 6c 6c 2d 62 69 6e 61 72 69 65 73 20 74 61 72  all-binaries tar
0620: 67 65 74 20 72 65 67 65 6e 65 72 61 74 65 20 74  get regenerate t
0630: 68 65 0a 09 70 6b 67 49 6e 64 65 78 2e 74 63 6c  he..pkgIndex.tcl
0640: 20 63 6f 72 72 65 63 74 6c 79 2e 20 20 54 68 65   correctly.  The
0650: 20 74 65 73 74 20 74 61 72 67 65 74 20 70 72 6f   test target pro
0660: 62 61 62 6c 79 20 73 68 6f 75 6c 64 6e 27 74 20  bably shouldn't 
0670: 73 63 72 65 77 0a 09 69 74 20 75 70 2c 20 62 75  screw..it up, bu
0680: 74 20 74 68 69 73 20 69 73 20 74 6f 20 62 65 20  t this is to be 
0690: 6f 6e 20 74 68 65 20 73 61 66 65 20 73 69 64 65  on the safe side
06a0: 2e 0a 0a 32 30 30 30 2d 30 37 2d 31 37 20 20 4a  ...2000-07-17  J
06b0: 65 66 66 20 48 6f 62 62 73 20 20 3c 68 6f 62 62  eff Hobbs  <hobb
06c0: 73 40 73 63 72 69 70 74 69 63 73 2e 63 6f 6d 3e  s@scriptics.com>
06d0: 0a 0a 09 2a 20 70 6b 67 49 6e 64 65 78 2e 74 63  ...* pkgIndex.tc
06e0: 6c 2e 69 6e 3a 0a 09 2a 20 63 6f 6e 66 69 67 75  l.in:..* configu
06f0: 72 65 2e 69 6e 3a 20 75 70 64 61 74 65 64 20 76  re.in: updated v
0700: 65 72 73 69 6f 6e 20 74 6f 20 31 2e 34 0a 0a 32  ersion to 1.4..2
0710: 30 30 30 2d 30 37 2d 31 33 20 20 4a 65 66 66 20  000-07-13  Jeff 
0720: 48 6f 62 62 73 20 20 3c 68 6f 62 62 73 40 73 63  Hobbs  <hobbs@sc
0730: 72 69 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a  riptics.com>...*
0740: 20 74 65 73 74 73 2f 74 6c 73 49 4f 2e 74 65 73   tests/tlsIO.tes
0750: 74 3a 20 65 6e 61 62 6c 65 64 20 74 65 73 74 73  t: enabled tests
0760: 20 32 2e 31 30 2c 20 37 2e 5b 31 32 34 35 5d 20   2.10, 7.[1245] 
0770: 28 74 68 65 72 65 20 69 73 20 6e 6f 20 33 29 2c  (there is no 3),
0780: 0a 09 77 68 69 63 68 20 6e 6f 77 20 70 61 73 73  ..which now pass
0790: 2e 20 20 41 64 64 65 64 20 73 6f 6d 65 20 63 6f  .  Added some co
07a0: 6d 6d 65 6e 74 73 20 74 6f 20 6f 74 68 65 72 20  mments to other 
07b0: 66 61 69 6c 69 6e 67 20 74 65 73 74 73 2e 0a 0a  failing tests...
07c0: 32 30 30 30 2d 30 37 2d 31 31 20 20 4a 65 66 66  2000-07-11  Jeff
07d0: 20 48 6f 62 62 73 20 20 3c 68 6f 62 62 73 40 73   Hobbs  <hobbs@s
07e0: 63 72 69 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09  criptics.com>...
07f0: 2a 20 74 6c 73 49 4f 2e 63 3a 20 63 68 61 6e 67  * tlsIO.c: chang
0800: 65 64 20 61 6c 6c 20 74 68 65 20 63 68 61 6e 6e  ed all the chann
0810: 65 6c 20 70 72 6f 63 73 20 74 6f 20 73 74 61 72  el procs to star
0820: 74 20 77 69 74 68 20 54 6c 73 2a 20 66 6f 72 0a  t with Tls* for.
0830: 09 62 65 74 74 65 72 20 70 61 72 69 74 79 20 77  .better parity w
0840: 68 65 6e 20 63 6f 6d 70 61 72 69 6e 67 20 77 69  hen comparing wi
0850: 74 68 20 54 72 61 6e 73 66 6f 72 6d 20 63 68 61  th Transform cha
0860: 6e 6e 65 6c 20 70 72 6f 63 73 2e 0a 09 52 65 77  nnel procs...Rew
0870: 72 6f 74 65 20 54 6c 73 57 61 74 63 68 50 72 6f  rote TlsWatchPro
0880: 63 2c 20 61 64 64 65 64 20 54 6c 73 4e 6f 74 69  c, added TlsNoti
0890: 66 79 50 72 6f 63 20 61 63 63 6f 72 64 69 6e 67  fyProc according
08a0: 20 74 6f 20 74 68 65 20 6e 65 77 0a 09 63 68 61   to the new..cha
08b0: 6e 6e 65 6c 20 64 65 73 69 67 6e 2c 20 77 68 69  nnel design, whi
08c0: 63 68 20 61 6c 73 6f 20 6c 65 61 76 65 73 20 54  ch also leaves T
08d0: 6c 73 43 68 61 6e 6e 65 6c 48 61 6e 64 6c 65 72  lsChannelHandler
08e0: 20 75 6e 75 73 65 64 2e 0a 0a 09 2a 20 74 6c 73   unused....* tls
08f0: 42 49 4f 2e 63 20 28 42 69 6f 43 74 72 6c 29 3a  BIO.c (BioCtrl):
0900: 20 63 68 61 6e 67 65 64 20 42 49 4f 5f 43 54 52   changed BIO_CTR
0910: 4c 5f 46 4c 55 53 48 20 63 61 73 65 20 74 6f 20  L_FLUSH case to 
0920: 75 73 65 0a 09 54 63 6c 5f 57 72 69 74 65 52 61  use..Tcl_WriteRa
0930: 77 20 69 6e 73 74 65 61 64 20 6f 66 20 54 63 6c  w instead of Tcl
0940: 5f 46 6c 75 73 68 20 28 74 6f 20 6f 70 65 72 61  _Flush (to opera
0950: 74 65 20 6f 6e 20 63 6f 72 72 65 63 74 20 63 68  te on correct ch
0960: 61 6e 6e 65 6c 0a 09 69 6e 20 74 68 65 20 73 74  annel..in the st
0970: 61 63 6b 20 69 6e 73 74 65 61 64 20 6f 66 20 73  ack instead of s
0980: 74 61 72 74 69 6e 67 20 61 74 20 74 68 65 20 74  tarting at the t
0990: 6f 70 20 61 67 61 69 6e 29 2e 20 20 57 6f 75 6c  op again).  Woul
09a0: 64 0a 09 6f 74 68 65 72 77 69 73 65 20 63 61 75  d..otherwise cau
09b0: 73 65 20 61 20 72 65 63 75 72 73 69 76 65 20 73  se a recursive s
09c0: 74 61 63 6b 20 62 6f 6d 62 20 77 68 65 6e 20 69  tack bomb when i
09d0: 6d 70 6c 69 63 69 74 20 68 61 6e 64 73 68 61 6b  mplicit handshak
09e0: 69 6e 67 0a 09 74 6f 6f 6b 20 65 66 66 65 63 74  ing..took effect
09f0: 2e 0a 0a 09 2a 20 74 65 73 74 73 2f 74 6c 73 49  ....* tests/tlsI
0a00: 4f 2e 74 65 73 74 3a 20 72 65 6d 6f 76 65 64 20  O.test: removed 
0a10: 63 68 61 6e 67 65 73 20 6d 61 64 65 20 74 6f 20  changes made to 
0a20: 74 65 73 74 20 73 75 69 74 65 20 28 61 6c 6c 20  test suite (all 
0a30: 74 65 73 74 73 0a 09 74 68 61 74 20 72 61 6e 20  tests..that ran 
0a40: 62 65 66 6f 72 65 20 6e 6f 77 20 70 61 73 73 20  before now pass 
0a50: 63 6f 72 72 65 63 74 6c 79 29 2c 20 61 6e 64 20  correctly), and 
0a60: 63 68 61 6e 67 65 64 20 73 6f 6d 65 20 61 63 63  changed some acc
0a70: 65 70 74 20 70 72 6f 63 0a 09 61 72 67 73 20 74  ept proc..args t
0a80: 6f 20 72 65 66 6c 65 63 74 20 74 68 61 74 20 61  o reflect that a
0a90: 20 73 6f 63 6b 20 69 73 20 61 6e 20 61 72 67 2c   sock is an arg,
0aa0: 20 6e 6f 74 20 61 20 66 69 6c 65 2e 0a 0a 32 30   not a file...20
0ab0: 30 30 2d 30 37 2d 31 30 20 20 4a 65 66 66 20 48  00-07-10  Jeff H
0ac0: 6f 62 62 73 20 20 3c 68 6f 62 62 73 40 73 63 72  obbs  <hobbs@scr
0ad0: 69 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20  iptics.com>...* 
0ae0: 74 6c 73 42 49 4f 2e 63 20 28 42 69 6f 57 72 69  tlsBIO.c (BioWri
0af0: 74 65 2c 20 42 69 6f 52 65 61 64 29 3a 20 63 68  te, BioRead): ch
0b00: 61 6e 67 65 64 20 54 63 6c 5f 52 65 61 64 2f 57  anged Tcl_Read/W
0b10: 72 69 74 65 20 74 6f 0a 09 54 63 6c 5f 52 65 61  rite to..Tcl_Rea
0b20: 64 52 61 77 2f 54 63 6c 57 72 69 74 65 52 61 77  dRaw/TclWriteRaw
0b30: 2e 0a 0a 09 2a 20 74 6c 73 2e 63 3a 20 61 64 64  ....* tls.c: add
0b40: 65 64 20 75 73 65 20 6f 66 20 54 63 6c 5f 47 65  ed use of Tcl_Ge
0b50: 74 54 6f 70 43 68 61 6e 6e 65 6c 20 61 66 74 65  tTopChannel afte
0b60: 72 20 54 63 6c 5f 47 65 74 43 68 61 6e 6e 65 6c  r Tcl_GetChannel
0b70: 20 61 6e 64 0a 09 67 6f 74 20 72 65 74 75 72 6e   and..got return
0b80: 20 76 61 6c 75 65 20 66 72 6f 6d 20 54 63 6c 5f   value from Tcl_
0b90: 53 74 61 63 6b 43 68 61 6e 6e 65 6c 2e 0a 0a 09  StackChannel....
0ba0: 2a 20 74 65 73 74 73 2f 74 6c 73 49 4f 2e 74 65  * tests/tlsIO.te
0bb0: 73 74 3a 20 61 64 64 65 64 20 73 6f 6d 65 20 68  st: added some h
0bc0: 61 6e 64 73 68 61 6b 69 6e 67 20 74 68 61 74 20  andshaking that 
0bd0: 73 68 6f 75 6c 64 6e 27 74 20 62 65 0a 09 6e 65  shouldn't be..ne
0be0: 63 65 73 73 61 72 79 2c 20 62 75 74 20 77 65 20  cessary, but we 
0bf0: 63 72 61 73 68 20 6f 74 68 65 72 77 69 73 65 20  crash otherwise 
0c00: 28 6e 65 65 64 73 20 6d 6f 72 65 20 74 65 73 74  (needs more test
0c10: 69 6e 67 29 2e 0a 0a 09 2a 20 74 6c 73 49 4f 2e  ing)....* tlsIO.
0c20: 63 3a 20 61 64 64 65 64 20 73 75 70 70 6f 72 74  c: added support
0c30: 20 66 6f 72 20 22 63 6f 72 72 65 63 74 65 64 22   for "corrected"
0c40: 20 73 74 61 63 6b 65 64 20 63 68 61 6e 6e 65 6c   stacked channel
0c50: 73 2e 20 20 41 6c 6c 0a 09 74 68 65 20 61 62 6f  s.  All..the abo
0c60: 76 65 20 63 68 61 6e 6e 65 6c 73 20 61 72 65 20  ve channels are 
0c70: 69 6e 20 54 43 4c 5f 43 48 41 4e 4e 45 4c 5f 56  in TCL_CHANNEL_V
0c80: 45 52 53 49 4f 4e 5f 32 20 23 69 66 64 65 66 73  ERSION_2 #ifdefs
0c90: 2e 0a 0a 32 30 30 30 2d 30 36 2d 30 35 20 20 53  ...2000-06-05  S
0ca0: 63 6f 74 74 20 53 74 61 6e 74 6f 6e 20 20 3c 73  cott Stanton  <s
0cb0: 74 61 6e 74 6f 6e 40 61 6a 75 62 61 73 6f 6c 75  tanton@ajubasolu
0cc0: 74 69 6f 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 4d  tions.com>...* M
0cd0: 61 6b 65 66 69 6c 65 2e 69 6e 3a 20 46 69 78 65  akefile.in: Fixe
0ce0: 64 20 62 72 6f 6b 65 6e 20 74 65 73 74 20 74 61  d broken test ta
0cf0: 72 67 65 74 2e 0a 0a 09 2a 20 74 6c 73 49 6e 74  rget....* tlsInt
0d00: 2e 68 3a 20 0a 09 2a 20 74 6c 73 2e 63 3a 20 43  .h: ..* tls.c: C
0d10: 6c 65 61 6e 65 64 20 75 70 20 64 65 63 6c 61 72  leaned up declar
0d20: 61 74 69 6f 6e 73 20 6f 66 20 54 6c 73 5f 43 6c  ations of Tls_Cl
0d30: 65 61 6e 20 74 6f 20 61 76 6f 69 64 20 65 72 72  ean to avoid err
0d40: 6f 72 73 20 6f 6e 0a 09 57 69 6e 64 6f 77 73 20  ors on..Windows 
0d50: 28 6c 69 6e 74 29 2e 0a 0a 32 30 30 30 2d 30 36  (lint)...2000-06
0d60: 2d 30 35 20 20 42 72 65 6e 74 20 57 65 6c 63 68  -05  Brent Welch
0d70: 20 3c 77 65 6c 63 68 40 61 6a 75 62 61 73 6f 6c   <welch@ajubasol
0d80: 75 74 69 6f 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a 20  utions.com>...* 
0d90: 74 6c 73 2e 63 2c 20 74 6c 73 49 4f 2e 63 3a 20  tls.c, tlsIO.c: 
0da0: 20 53 70 6c 69 74 20 54 6c 73 5f 46 72 65 65 20   Split Tls_Free 
0db0: 69 6e 74 6f 20 54 6c 73 5f 43 6c 65 61 6e 2c 20  into Tls_Clean, 
0dc0: 77 68 69 63 68 20 64 6f 65 73 0a 09 74 68 65 20  which does..the 
0dd0: 53 53 4c 20 63 6c 65 61 6e 75 70 2c 20 61 6e 64  SSL cleanup, and
0de0: 20 74 68 65 20 54 63 6c 5f 46 72 65 65 20 63 61   the Tcl_Free ca
0df0: 6c 6c 2e 20 20 49 74 20 69 73 20 69 6d 70 6f 72  ll.  It is impor
0e00: 74 61 6e 74 20 74 6f 20 73 68 75 74 64 6f 77 6e  tant to shutdown
0e10: 0a 09 74 68 65 20 53 53 4c 20 73 74 61 74 65 20  ..the SSL state 
0e20: 22 73 79 6e 63 68 72 6f 6e 6f 75 73 6c 79 22 20  "synchronously" 
0e30: 64 75 72 69 6e 67 20 61 20 73 74 61 63 6b 65 64  during a stacked
0e40: 20 66 6c 75 73 68 2e 0a 0a 32 30 30 30 2d 30 36   flush...2000-06
0e50: 2d 30 31 20 20 53 63 6f 74 74 20 53 74 61 6e 74  -01  Scott Stant
0e60: 6f 6e 20 20 3c 73 74 61 6e 74 6f 6e 40 61 6a 75  on  <stanton@aju
0e70: 62 61 73 6f 6c 75 74 69 6f 6e 73 2e 63 6f 6d 3e  basolutions.com>
0e80: 0a 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 20 52 65  ...* tlsIO.c: Re
0e90: 73 74 6f 72 65 64 20 63 61 6c 6c 20 74 6f 20 54  stored call to T
0ea0: 63 6c 5f 4e 6f 74 69 66 79 43 68 61 6e 6e 65 6c  cl_NotifyChannel
0eb0: 20 66 72 6f 6d 20 43 68 61 6e 6e 65 6c 48 61 6e   from ChannelHan
0ec0: 64 6c 65 72 0a 09 74 6f 20 65 6e 73 75 72 65 20  dler..to ensure 
0ed0: 74 68 61 74 20 65 76 65 6e 74 73 20 70 72 6f 70  that events prop
0ee0: 61 67 61 74 65 20 66 72 6f 6d 20 74 68 65 20 6c  agate from the l
0ef0: 6f 77 65 72 20 64 72 69 76 65 72 2e 20 20 54 68  ower driver.  Th
0f00: 69 73 20 6d 61 79 0a 09 72 65 73 75 6c 74 20 69  is may..result i
0f10: 6e 20 61 6e 20 69 6e 66 69 6e 69 74 65 20 6c 6f  n an infinite lo
0f20: 6f 70 20 69 6e 20 73 6f 6d 65 20 63 61 73 65 73  op in some cases
0f30: 2c 20 73 6f 20 74 68 69 73 20 69 73 20 6e 6f 74  , so this is not
0f40: 20 61 20 74 6f 74 61 6c 0a 09 66 69 78 2e 20 20   a total..fix.  
0f50: 54 68 69 73 20 6d 61 79 20 62 65 20 73 75 66 66  This may be suff
0f60: 69 63 69 65 6e 74 20 66 6f 72 20 6e 6f 77 2c 20  icient for now, 
0f70: 68 6f 77 65 76 65 72 2e 20 5b 42 75 67 3a 20 35  however. [Bug: 5
0f80: 36 32 33 5d 0a 0a 32 30 30 30 2d 30 36 2d 30 31  623]..2000-06-01
0f90: 20 20 53 63 6f 74 74 20 53 74 61 6e 74 6f 6e 20    Scott Stanton 
0fa0: 20 3c 73 74 61 6e 74 6f 6e 40 73 63 72 69 70 74   <stanton@script
0fb0: 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73  ics.com>...* tls
0fc0: 49 4f 2e 63 3a 20 52 65 73 74 6f 72 65 20 74 68  IO.c: Restore th
0fd0: 65 20 70 72 65 76 69 6f 75 73 20 76 65 72 73 69  e previous versi
0fe0: 6f 6e 2e 20 20 46 69 78 65 64 20 74 68 65 20 43  on.  Fixed the C
0ff0: 6c 6f 73 65 50 72 6f 63 20 73 6f 0a 09 69 74 20  loseProc so..it 
1000: 75 6e 72 65 67 69 73 74 65 72 73 20 74 68 65 20  unregisters the 
1010: 63 68 61 6e 6e 65 6c 20 68 61 6e 64 6c 65 72 20  channel handler 
1020: 6f 6e 20 74 68 65 20 73 75 70 65 72 63 65 64 65  on the supercede
1030: 64 20 63 68 61 6e 6e 65 6c 0a 09 69 6e 73 74 65  d channel..inste
1040: 61 64 20 6f 66 20 74 68 65 20 75 70 70 65 72 20  ad of the upper 
1050: 63 68 61 6e 6e 65 6c 2e 20 41 6c 73 6f 20 72 65  channel. Also re
1060: 6d 6f 76 65 64 20 74 68 65 20 63 61 6c 6c 20 74  moved the call t
1070: 6f 0a 09 54 63 6c 5f 4e 6f 74 69 66 79 43 68 61  o..Tcl_NotifyCha
1080: 6e 6e 65 6c 20 69 6e 20 74 68 65 20 43 68 61 6e  nnel in the Chan
1090: 6e 65 6c 48 61 6e 64 6c 65 72 20 62 65 63 61 75  nelHandler becau
10a0: 73 65 20 74 68 69 73 20 77 69 6c 6c 20 72 65 73  se this will res
10b0: 75 6c 74 0a 09 69 6e 20 61 6e 20 69 6e 66 69 6e  ult..in an infin
10c0: 69 74 65 20 6c 6f 6f 70 20 69 66 20 64 61 74 61  ite loop if data
10d0: 20 69 73 20 65 76 65 72 20 62 75 66 66 65 72 65   is ever buffere
10e0: 64 20 69 6e 20 74 68 65 20 42 49 4f 0a 09 73 74  d in the BIO..st
10f0: 72 75 63 74 75 72 65 2e 20 5b 42 75 67 3a 20 35  ructure. [Bug: 5
1100: 36 32 33 5d 0a 0a 32 30 30 30 2d 30 35 2d 33 31  623]..2000-05-31
1110: 20 20 42 72 65 6e 74 20 57 65 6c 63 68 20 3c 77    Brent Welch <w
1120: 65 6c 63 68 40 73 63 72 69 70 74 69 63 73 2e 63  elch@scriptics.c
1130: 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 2e 63 3a 20 43  om>...* tls.c: C
1140: 68 61 6e 67 65 20 74 68 65 20 43 68 61 6e 6e 65  hange the Channe
1150: 6c 48 61 6e 64 6c 65 72 20 74 6f 20 62 65 20 72  lHandler to be r
1160: 65 67 69 73 74 65 72 65 64 20 6f 6e 20 74 68 65  egistered on the
1170: 20 6d 61 69 6e 0a 09 63 68 61 6e 6e 65 6c 20 61   main..channel a
1180: 73 20 6f 70 70 73 65 64 20 74 6f 20 74 68 65 20  s oppsed to the 
1190: 22 70 61 72 65 6e 74 22 2c 20 6f 72 20 73 75 70  "parent", or sup
11a0: 65 72 63 65 65 64 65 64 2c 20 63 68 61 6e 6e 65  erceeded, channe
11b0: 6c 2e 20 20 54 68 69 73 0a 09 69 73 20 62 65 63  l.  This..is bec
11c0: 61 75 73 65 20 74 68 65 20 73 6f 63 6b 65 74 20  ause the socket 
11d0: 64 72 69 76 65 72 20 6e 6f 74 69 66 69 65 73 20  driver notifies 
11e0: 74 68 65 20 6d 61 69 6e 20 63 68 61 6e 6e 65 6c  the main channel
11f0: 2c 20 61 6e 64 20 74 68 65 72 65 0a 09 61 72 65  , and there..are
1200: 20 74 69 6d 65 73 20 77 69 74 68 20 74 68 65 20   times with the 
1210: 6d 61 69 6e 20 63 68 61 6e 6e 65 6c 20 67 65 74  main channel get
1220: 73 20 63 6c 6f 73 65 64 2c 20 62 75 74 20 74 68  s closed, but th
1230: 65 20 73 75 70 65 72 63 65 64 65 64 0a 09 6f 6e  e superceded..on
1240: 65 20 69 73 20 6e 6f 74 20 79 65 74 20 63 6c 6f  e is not yet clo
1250: 73 65 64 2e 20 20 49 66 20 74 68 65 20 63 68 61  sed.  If the cha
1260: 6e 6e 65 6c 20 68 61 6e 64 6c 65 72 20 67 65 74  nnel handler get
1270: 73 20 74 72 69 67 67 65 72 65 64 20 69 6e 0a 09  s triggered in..
1280: 74 68 69 73 20 68 61 6c 66 2d 6f 70 65 6e 20 73  this half-open s
1290: 74 61 74 65 20 69 74 20 69 73 20 61 73 73 6f 63  tate it is assoc
12a0: 69 61 74 65 64 20 77 69 74 68 20 74 68 65 20 73  iated with the s
12b0: 75 70 65 72 63 65 65 64 65 64 0a 09 63 68 61 6e  uperceeded..chan
12c0: 6e 65 64 6c 2c 20 62 75 74 20 75 73 65 73 20 69  nedl, but uses i
12d0: 74 73 20 70 72 69 76 61 74 65 20 70 6f 69 6e 74  ts private point
12e0: 65 72 20 74 6f 20 74 68 65 20 6d 61 69 6e 20 63  er to the main c
12f0: 68 61 6e 6e 65 6c 2c 20 77 68 69 63 68 0a 09 69  hannel, which..i
1300: 73 20 6d 6f 73 74 6c 79 20 64 65 73 74 72 6f 79  s mostly destroy
1310: 65 64 2e 20 20 45 6c 69 6d 69 6e 61 74 65 64 20  ed.  Eliminated 
1320: 74 68 65 20 72 65 64 75 6e 64 61 6e 74 20 63 61  the redundant ca
1330: 6c 6c 20 74 6f 0a 09 54 63 6c 5f 4e 6f 74 69 66  ll to..Tcl_Notif
1340: 79 43 68 61 6e 6e 65 6c 20 66 72 6f 6d 20 54 6c  yChannel from Tl
1350: 73 57 61 74 63 68 50 72 6f 63 2e 20 5b 42 75 67  sWatchProc. [Bug
1360: 3a 20 35 36 32 33 5d 0a                          : 5623].