Hex Artifact Content

Artifact 9d7c1d4605ba2be5975b6fd1a7de723e25cea30d:


0000: 32 30 30 31 2d 30 33 2d 31 34 20 20 4a 65 66 66  2001-03-14  Jeff
0010: 20 48 6f 62 62 73 20 20 3c 6a 65 66 66 68 40 67   Hobbs  <jeffh@g
0020: 69 6d 6c 65 74 2e 61 63 74 69 76 65 73 74 61 74  imlet.activestat
0030: 65 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 2e 63  e.com>...* tls.c
0040: 20 28 54 6c 73 5f 49 6e 69 74 29 3a 20 61 64 64   (Tls_Init): add
0050: 20 64 6f 2f 77 68 69 6c 65 20 66 6f 72 20 72 61   do/while for ra
0060: 6e 64 6f 6d 20 6e 75 6d 62 65 72 20 69 6e 69 74  ndom number init
0070: 69 61 6c 69 7a 61 74 69 6f 6e 0a 09 74 6f 20 77  ialization..to w
0080: 6f 72 6b 20 61 72 6f 75 6e 64 20 73 6f 6d 65 20  ork around some 
0090: 4f 53 65 73 20 71 75 69 72 6b 73 2e 20 20 28 52  OSes quirks.  (R
00a0: 61 6c 70 68 2e 42 69 6c 6c 65 73 40 74 65 6c 74  alph.Billes@telt
00b0: 65 63 68 2e 63 6f 6d 2e 61 75 29 0a 0a 32 30 30  ech.com.au)..200
00c0: 30 2d 30 39 2d 30 37 20 20 4a 65 66 66 20 48 6f  0-09-07  Jeff Ho
00d0: 62 62 73 20 20 3c 68 6f 62 62 73 40 73 63 72 69  bbs  <hobbs@scri
00e0: 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74  ptics.com>...* t
00f0: 6c 73 49 4f 2e 63 20 28 54 6c 73 5f 43 68 61 6e  lsIO.c (Tls_Chan
0100: 6e 65 6c 54 79 70 65 29 3a 20 73 65 74 20 74 79  nelType): set ty
0110: 70 65 4e 61 6d 65 20 66 69 65 6c 64 20 6f 66 20  peName field of 
0120: 63 68 61 6e 6e 65 6c 20 74 79 70 65 20 74 6f 0a  channel type to.
0130: 09 22 74 6c 73 22 20 28 74 68 69 73 20 67 6f 74  ."tls" (this got
0140: 20 6c 6f 73 74 20 69 6e 20 6d 6f 76 65 20 74 6f   lost in move to
0150: 20 64 79 6e 61 6d 69 63 20 76 65 72 73 69 6f 6e   dynamic version
0160: 20 63 6f 6d 70 61 74 61 62 69 6c 69 74 79 0a 09   compatability..
0170: 63 68 65 63 6b 69 6e 67 29 2e 0a 0a 32 30 30 30  checking)...2000
0180: 2d 30 38 2d 32 33 20 20 4a 65 66 66 20 48 6f 62  -08-23  Jeff Hob
0190: 62 73 20 20 3c 68 6f 62 62 73 40 73 63 72 69 70  bs  <hobbs@scrip
01a0: 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 54 4c 53 20  tics.com>...TLS 
01b0: 31 2e 34 20 52 45 4c 45 41 53 45 44 0a 0a 09 2a  1.4 RELEASED...*
01c0: 20 4d 61 6b 65 66 69 6c 65 2e 69 6e 20 28 64 69   Makefile.in (di
01d0: 73 74 29 3a 20 63 72 65 61 74 65 20 64 69 73 74  st): create dist
01e0: 20 74 61 72 67 65 74 20 66 6f 72 20 61 72 63 68   target for arch
01f0: 69 76 65 20 64 69 73 74 72 69 62 75 74 69 6f 6e  ive distribution
0200: 73 0a 0a 09 2a 20 74 65 73 74 73 2f 74 6c 73 49  s...* tests/tlsI
0210: 4f 2e 74 65 73 74 20 28 74 6c 73 49 4f 2d 38 2e  O.test (tlsIO-8.
0220: 31 29 3a 20 61 64 64 65 64 20 61 20 64 65 6c 61  1): added a dela
0230: 79 20 6f 6e 20 74 68 65 20 61 63 63 65 70 74 20  y on the accept 
0240: 63 6c 6f 73 65 0a 09 74 6f 20 6d 61 6b 65 20 74  close..to make t
0250: 68 65 20 74 65 73 74 20 77 6f 72 6b 20 77 69 74  he test work wit
0260: 68 20 4f 70 65 6e 53 53 4c 20 6f 6e 20 57 69 6e  h OpenSSL on Win
0270: 64 6f 77 73 20 28 64 6f 65 73 6e 27 74 20 61 66  dows (doesn't af
0280: 66 65 63 74 0a 09 6f 74 68 65 72 20 62 75 69 6c  fect..other buil
0290: 64 73 29 2e 0a 0a 09 2a 20 74 6c 73 2e 68 74 6d  ds)....* tls.htm
02a0: 3a 20 75 70 64 61 74 65 64 20 77 69 74 68 20 6e  : updated with n
02b0: 6f 74 65 73 20 66 6f 72 20 31 2e 34 2e 0a 0a 32  otes for 1.4...2
02c0: 30 30 30 2d 30 38 2d 32 31 20 20 4a 65 66 66 20  000-08-21  Jeff 
02d0: 48 6f 62 62 73 20 20 3c 68 6f 62 62 73 40 73 63  Hobbs  <hobbs@sc
02e0: 72 69 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a  riptics.com>...*
02f0: 20 74 65 73 74 73 2f 74 6c 73 49 4f 2e 74 65 73   tests/tlsIO.tes
0300: 74 3a 20 72 65 71 75 69 72 65 20 61 74 20 6c 65  t: require at le
0310: 61 73 74 20 74 6c 73 31 2e 34 20 69 6e 20 74 65  ast tls1.4 in te
0320: 73 74 20 73 75 69 74 65 2e 0a 0a 32 30 30 30 2d  st suite...2000-
0330: 30 38 2d 31 38 20 20 4a 65 66 66 20 48 6f 62 62  08-18  Jeff Hobb
0340: 73 20 20 3c 68 6f 62 62 73 40 73 63 72 69 70 74  s  <hobbs@script
0350: 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73  ics.com>...* tls
0360: 2e 63 20 28 54 6c 73 5f 49 6e 69 74 29 3a 20 61  .c (Tls_Init): a
0370: 64 64 65 64 20 63 61 6c 6c 20 74 6f 20 52 41 4e  dded call to RAN
0380: 44 5f 73 65 65 64 20 74 6f 20 73 65 65 64 20 74  D_seed to seed t
0390: 68 65 20 53 53 4c 20 72 61 6e 64 6f 6d 0a 09 6e  he SSL random..n
03a0: 75 6d 62 65 72 20 67 65 6e 65 72 61 74 6f 72 2e  umber generator.
03b0: 20 20 57 69 74 68 6f 75 74 20 74 68 69 73 2c 20    Without this, 
03c0: 4f 70 65 6e 53 53 4c 20 30 2e 39 2e 35 20 63 68  OpenSSL 0.9.5 ch
03d0: 6f 6b 65 73 2c 20 61 6e 64 20 69 6e 20 61 6e 79  okes, and in any
03e0: 0a 09 63 61 73 65 20 69 74 20 69 73 20 61 20 62  ..case it is a b
03f0: 69 67 20 73 65 63 75 72 69 74 79 20 68 6f 6c 65  ig security hole
0400: 20 74 6f 20 64 6f 20 77 69 74 68 6f 75 74 20 69   to do without i
0410: 74 2e 0a 0a 09 2a 20 63 6f 6e 66 69 67 75 72 65  t....* configure
0420: 2e 69 6e 20 28 4f 50 45 4e 53 53 4c 29 3a 20 61  .in (OPENSSL): a
0430: 64 64 65 64 20 4e 4f 5f 49 44 45 41 20 61 6e 64  dded NO_IDEA and
0440: 20 4e 4f 5f 52 43 35 20 64 65 66 69 6e 65 73 20   NO_RC5 defines 
0450: 62 79 0a 09 64 65 66 61 75 6c 74 20 77 68 65 6e  by..default when
0460: 20 63 6f 6d 70 69 6c 69 6e 67 20 77 69 74 68 20   compiling with 
0470: 4f 70 65 6e 53 53 4c 2e 0a 0a 09 2a 20 74 6c 73  OpenSSL....* tls
0480: 49 6e 74 2e 68 3a 20 61 64 64 65 64 20 65 72 72  Int.h: added err
0490: 2e 68 20 69 6e 63 6c 75 64 65 0a 0a 09 2a 20 74  .h include...* t
04a0: 6c 73 42 49 4f 2e 63 3a 0a 09 2a 20 74 6c 73 49  lsBIO.c:..* tlsI
04b0: 4f 2e 63 3a 20 63 6f 72 72 65 63 74 65 64 20 70  O.c: corrected p
04c0: 65 64 61 6e 74 69 63 20 63 61 73 74 20 65 72 72  edantic cast err
04d0: 6f 72 73 2e 0a 0a 32 30 30 30 2d 30 38 2d 31 36  ors...2000-08-16
04e0: 20 20 4a 65 66 66 20 48 6f 62 62 73 20 20 3c 68    Jeff Hobbs  <h
04f0: 6f 62 62 73 40 73 63 72 69 70 74 69 63 73 2e 63  obbs@scriptics.c
0500: 6f 6d 3e 0a 0a 09 2a 20 74 65 73 74 73 2f 63 69  om>...* tests/ci
0510: 70 68 65 72 73 2e 74 65 73 74 3a 20 69 6d 70 72  phers.test: impr
0520: 6f 76 65 64 20 61 62 69 6c 69 74 79 20 74 6f 20  oved ability to 
0530: 63 68 61 6e 67 65 20 63 6f 6e 73 74 72 61 69 6e  change constrain
0540: 74 0a 09 73 65 74 74 69 6e 67 20 66 6f 72 20 77  t..setting for w
0550: 68 65 74 68 65 72 20 75 73 65 72 20 63 6f 6d 70  hether user comp
0560: 69 6c 65 64 20 61 67 61 69 6e 73 74 20 52 53 41  iled against RSA
0570: 20 6f 72 20 4f 70 65 6e 53 53 4c 20 6c 69 62 73   or OpenSSL libs
0580: 2e 0a 0a 09 2a 20 74 6c 73 2e 63 20 28 54 6c 73  ....* tls.c (Tls
0590: 5f 49 6e 69 74 29 3a 20 63 6f 72 72 65 63 74 65  _Init): correcte
05a0: 64 20 69 6e 74 65 72 70 72 65 74 61 74 69 6f 6e  d interpretation
05b0: 20 6f 66 20 76 65 72 73 69 6f 6e 20 6e 75 6d 62   of version numb
05c0: 65 72 0a 09 28 70 61 74 63 68 6c 65 76 65 6c 20  er..(patchlevel 
05d0: 61 6e 64 20 72 65 6c 65 61 73 65 2f 73 65 72 69  and release/seri
05e0: 61 6c 20 77 65 72 65 20 73 77 61 70 70 65 64 29  al were swapped)
05f0: 2e 0a 0a 32 30 30 30 2d 30 38 2d 31 35 20 20 4a  ...2000-08-15  J
0600: 65 66 66 20 48 6f 62 62 73 20 20 3c 68 6f 62 62  eff Hobbs  <hobb
0610: 73 40 73 63 72 69 70 74 69 63 73 2e 63 6f 6d 3e  s@scriptics.com>
0620: 0a 0a 09 2a 20 52 45 41 44 4d 45 2e 74 78 74 3a  ...* README.txt:
0630: 20 61 64 64 65 64 20 6e 6f 74 65 73 20 61 62 6f   added notes abo
0640: 75 74 20 6e 65 65 64 20 74 6f 20 75 73 65 20 38  ut need to use 8
0650: 2e 32 2e 30 2b 2e 0a 0a 09 2a 20 74 6c 73 49 6e  .2.0+....* tlsIn
0660: 74 2e 68 3a 0a 09 2a 20 74 6c 73 2e 63 3a 0a 09  t.h:..* tls.c:..
0670: 2a 20 74 6c 73 49 4f 2e 63 3a 20 63 6f 72 72 65  * tlsIO.c: corre
0680: 63 74 65 64 20 73 74 72 75 63 74 75 72 65 20 69  cted structure i
0690: 6e 69 74 69 61 6c 69 7a 61 74 69 6f 6e 20 74 6f  nitialization to
06a0: 20 77 6f 72 6b 20 77 68 65 6e 0a 09 63 6f 6d 70   work when..comp
06b0: 69 6c 69 6e 67 20 77 69 74 68 20 38 2e 32 2e 20  iling with 8.2. 
06c0: 20 4e 6f 77 20 63 6f 6d 70 69 6c 65 73 20 77 69   Now compiles wi
06d0: 74 68 20 38 2e 32 2b 20 61 6e 64 20 74 65 73 74  th 8.2+ and test
06e0: 65 64 20 74 6f 20 77 6f 72 6b 0a 09 77 69 74 68  ed to work..with
06f0: 20 38 2e 32 2b 20 61 6e 64 20 64 79 6e 61 6d 69   8.2+ and dynami
0700: 63 61 6c 6c 79 20 61 64 6a 75 73 74 20 74 6f 20  cally adjust to 
0710: 74 68 65 20 76 65 72 73 69 6f 6e 20 6f 66 20 54  the version of T
0720: 63 6c 20 69 74 20 77 61 73 0a 09 6c 6f 61 64 65  cl it was..loade
0730: 64 20 69 6e 74 6f 2e 20 20 54 4c 53 20 77 69 6c  d into.  TLS wil
0740: 6c 20 66 61 69 6c 20 74 68 65 20 74 65 73 74 20  l fail the test 
0750: 73 75 69 74 65 20 77 69 74 68 20 54 63 6c 20 38  suite with Tcl 8
0760: 2e 32 2d 38 2e 33 2e 31 2e 0a 0a 09 2a 20 74 65  .2-8.3.1....* te
0770: 73 74 73 2f 61 6c 6c 2e 74 63 6c 3a 20 61 64 64  sts/all.tcl: add
0780: 65 64 20 63 61 74 63 68 20 61 72 6f 75 6e 64 20  ed catch around 
0790: 3a 3a 74 63 6c 74 65 73 74 3a 3a 6e 6f 72 6d 61  ::tcltest::norma
07a0: 6c 69 7a 65 50 61 74 68 0a 09 62 65 63 61 75 73  lizePath..becaus
07b0: 65 20 69 74 20 64 6f 65 73 6e 27 74 20 65 78 69  e it doesn't exi
07c0: 73 74 20 69 6e 20 70 72 65 2d 38 2e 33 20 74 63  st in pre-8.3 tc
07d0: 6c 74 65 73 74 2e 0a 0a 09 2a 20 74 65 73 74 73  ltest....* tests
07e0: 2f 73 69 6d 70 6c 65 43 6c 69 65 6e 74 2e 74 63  /simpleClient.tc
07f0: 6c 3a 20 0a 09 2a 20 74 65 73 74 73 2f 73 69 6d  l: ..* tests/sim
0800: 70 6c 65 53 65 72 76 65 72 2e 74 63 6c 3a 20 61  pleServer.tcl: a
0810: 64 64 65 64 20 73 69 6d 70 6c 65 20 63 6c 69 65  dded simple clie
0820: 6e 74 2f 73 65 72 76 65 72 20 74 65 73 74 20 73  nt/server test s
0830: 63 72 69 70 74 73 0a 09 74 68 61 74 20 75 73 65  cripts..that use
0840: 20 74 65 73 74 20 63 65 72 74 73 20 61 6e 64 20   test certs and 
0850: 63 61 6e 20 64 6f 20 73 69 6d 70 6c 65 20 73 74  can do simple st
0860: 72 65 73 73 20 74 65 73 74 73 2e 0a 0a 32 30 30  ress tests...200
0870: 30 2d 30 38 2d 31 34 20 20 4a 65 66 66 20 48 6f  0-08-14  Jeff Ho
0880: 62 62 73 20 20 3c 68 6f 62 62 73 40 73 63 72 69  bbs  <hobbs@scri
0890: 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74  ptics.com>...* t
08a0: 6c 73 49 6e 74 2e 68 3a 0a 09 2a 20 74 6c 73 49  lsInt.h:..* tlsI
08b0: 4f 2e 63 3a 0a 09 2a 20 74 6c 73 42 49 4f 2e 63  O.c:..* tlsBIO.c
08c0: 3a 0a 09 2a 20 74 6c 73 2e 63 3a 20 63 68 61 6e  :..* tls.c: chan
08d0: 67 65 64 20 61 72 6f 75 6e 64 20 74 6f 20 6f 6e  ged around to on
08e0: 6c 79 20 77 6f 72 6b 69 6e 67 20 77 69 74 68 20  ly working with 
08f0: 38 2e 32 2e 30 2b 20 28 38 2e 33 2e 32 2b 0a 09  8.2.0+ (8.3.2+..
0900: 70 72 65 66 65 72 72 65 64 29 2c 20 77 69 74 68  preferred), with
0910: 20 72 75 6e 74 69 6d 65 20 63 68 65 63 6b 73 20   runtime checks 
0920: 66 6f 72 20 70 72 65 2d 20 61 6e 64 20 70 6f 73  for pre- and pos
0930: 74 2d 69 6f 2d 72 65 77 72 69 74 65 2e 0a 0a 09  t-io-rewrite....
0940: 2a 20 74 6c 73 2e 63 20 28 54 6c 73 5f 49 6e 69  * tls.c (Tls_Ini
0950: 74 29 3a 20 63 68 61 6e 67 65 64 20 69 74 20 74  t): changed it t
0960: 6f 20 72 65 71 75 69 72 65 20 38 2e 33 2e 32 20  o require 8.3.2 
0970: 77 68 65 6e 20 54 63 6c 5f 49 6e 69 74 53 74 75  when Tcl_InitStu
0980: 62 73 0a 09 77 61 73 20 63 61 6c 6c 65 64 20 62  bs..was called b
0990: 65 63 61 75 73 65 20 77 65 20 64 6f 6e 27 74 20  ecause we don't 
09a0: 77 61 6e 74 20 70 65 6f 70 6c 65 20 75 73 69 6e  want people usin
09b0: 67 20 54 4c 53 20 77 69 74 68 20 74 68 65 0a 09  g TLS with the..
09c0: 6f 72 69 67 69 6e 61 6c 20 73 74 61 63 6b 65 64  original stacked
09d0: 20 63 68 61 6e 6e 65 6c 20 69 6d 70 6c 65 6d 65   channel impleme
09e0: 6e 74 61 74 69 6f 6e 2e 0a 0a 32 30 30 30 2d 30  ntation...2000-0
09f0: 37 2d 32 36 20 20 4a 65 66 66 20 48 6f 62 62 73  7-26  Jeff Hobbs
0a00: 20 20 3c 68 6f 62 62 73 40 73 63 72 69 70 74 69    <hobbs@scripti
0a10: 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 6d 65 72 67  cs.com>...* merg
0a20: 65 64 20 61 6c 6c 20 63 68 61 6e 67 65 73 20 66  ed all changes f
0a30: 72 6f 6d 20 74 6c 73 2d 31 2d 33 2d 69 6f 2d 72  rom tls-1-3-io-r
0a40: 65 77 72 69 74 65 20 62 61 63 6b 20 69 6e 74 6f  ewrite back into
0a50: 20 6d 61 69 6e 20 62 72 61 6e 63 68 0a 0a 09 2a   main branch...*
0a60: 20 74 65 73 74 73 2f 74 6c 73 49 4f 2e 74 65 73   tests/tlsIO.tes
0a70: 74 3a 20 75 70 64 61 74 65 64 20 63 6f 6d 6d 65  t: updated comme
0a80: 6e 74 73 2c 20 66 69 78 65 64 20 61 20 70 63 43  nts, fixed a pcC
0a90: 72 61 73 68 20 63 61 73 65 20 74 68 61 74 0a 09  rash case that..
0aa0: 77 61 73 20 64 75 65 20 74 6f 20 64 65 62 75 67  was due to debug
0ab0: 20 61 73 73 65 72 74 69 6f 6e 20 69 6e 20 57 69   assertion in Wi
0ac0: 6e 64 6f 77 73 20 53 53 4c 2e 0a 0a 09 2a 20 74  ndows SSL....* t
0ad0: 6c 73 2e 63 20 28 49 6d 70 6f 72 74 4f 62 6a 43  ls.c (ImportObjC
0ae0: 6d 64 29 3a 20 72 65 6d 6f 76 65 64 20 75 6e 6e  md): removed unn
0af0: 65 63 65 73 73 61 72 79 20 75 73 65 20 6f 66 20  ecessary use of 
0b00: 27 62 69 6f 27 20 61 72 67 2e 0a 09 28 54 6c 73  'bio' arg...(Tls
0b10: 5f 49 6e 69 74 29 3a 20 63 68 65 63 6b 20 72 65  _Init): check re
0b20: 74 75 72 6e 20 76 61 6c 75 65 20 6f 66 20 53 53  turn value of SS
0b30: 4c 5f 6c 69 62 72 61 72 79 5f 69 6e 69 74 2e 20  L_library_init. 
0b40: 20 41 6c 73 6f 20 6c 6f 74 73 20 6f 66 0a 09 77   Also lots of..w
0b50: 68 69 74 65 73 70 61 63 65 20 63 6c 65 61 6e 75  hitespace cleanu
0b60: 70 20 28 6d 6f 72 65 20 6c 69 6b 65 20 54 63 6c  p (more like Tcl
0b70: 20 45 6e 67 20 73 74 79 6c 65 20 67 75 69 64 65   Eng style guide
0b80: 29 2c 20 62 75 74 20 6e 6f 74 20 61 6c 6c 0a 09  ), but not all..
0b90: 63 6f 64 65 20 77 61 73 20 63 6c 65 61 6e 65 64  code was cleaned
0ba0: 20 75 70 2e 0a 0a 09 2a 20 74 6c 73 42 49 4f 2e   up....* tlsBIO.
0bb0: 63 3a 20 6d 69 6e 6f 72 20 77 68 69 74 65 73 70  c: minor whitesp
0bc0: 61 63 65 20 63 6c 65 61 6e 75 70 0a 0a 09 2a 20  ace cleanup...* 
0bd0: 74 6c 73 49 4f 2e 63 3a 20 6d 69 6e 6f 72 20 77  tlsIO.c: minor w
0be0: 68 69 74 65 73 70 61 63 65 20 63 6c 65 61 6e 75  hitespace cleanu
0bf0: 70 2e 0a 09 28 54 6c 73 49 6e 70 75 74 50 72 6f  p...(TlsInputPro
0c00: 63 2c 20 54 6c 73 4f 75 74 70 75 74 50 72 6f 63  c, TlsOutputProc
0c10: 29 3a 20 41 64 64 65 64 20 45 52 52 5f 63 6c 65  ): Added ERR_cle
0c20: 61 72 5f 65 72 72 6f 72 20 62 65 66 6f 72 65 20  ar_error before 
0c30: 63 61 6c 6c 73 0a 09 74 6f 20 42 49 4f 5f 72 65  calls..to BIO_re
0c40: 61 64 20 6f 72 20 42 49 4f 5f 77 72 69 74 65 2c  ad or BIO_write,
0c50: 20 62 65 63 61 75 73 65 20 77 65 20 63 6f 75 6c   because we coul
0c60: 64 20 6f 74 68 65 72 77 69 73 65 20 65 6e 64 20  d otherwise end 
0c70: 75 70 0a 09 70 75 6c 6c 69 6e 67 20 61 6e 20 65  up..pulling an e
0c80: 72 72 6f 72 20 6f 66 66 20 74 68 65 20 73 74 61  rror off the sta
0c90: 63 6b 20 74 68 61 74 20 64 69 64 6e 27 74 20 62  ck that didn't b
0ca0: 65 6c 6f 6e 67 20 74 6f 20 75 73 2e 20 20 41 6c  elong to us.  Al
0cb0: 73 6f 0a 09 63 6c 65 61 6e 75 70 20 75 70 20 65  so..cleanup up e
0cc0: 78 63 65 73 73 69 76 65 20 75 73 65 20 6f 66 20  xcessive use of 
0cd0: 67 6f 74 6f 73 2e 0a 0a 32 30 30 30 2d 30 37 2d  gotos...2000-07-
0ce0: 32 30 20 20 4a 65 66 66 20 48 6f 62 62 73 20 20  20  Jeff Hobbs  
0cf0: 3c 68 6f 62 62 73 40 73 63 72 69 70 74 69 63 73  <hobbs@scriptics
0d00: 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 65 73 74 73 2f  .com>...* tests/
0d10: 74 6c 73 49 4f 2e 74 65 73 74 3a 20 63 6f 72 72  tlsIO.test: corr
0d20: 65 63 74 65 64 20 76 61 72 69 6f 75 73 20 74 65  ected various te
0d30: 73 74 73 20 74 6f 20 62 65 20 63 6f 72 72 65 63  sts to be correc
0d40: 74 20 66 6f 72 20 54 4c 53 0a 09 73 74 61 63 6b  t for TLS..stack
0d50: 65 64 20 63 68 61 6e 6e 65 6c 73 20 28 61 73 20  ed channels (as 
0d60: 6f 70 70 6f 73 65 64 20 74 6f 20 74 68 65 20 73  opposed to the s
0d70: 74 61 6e 64 61 72 64 20 73 6f 63 6b 65 74 73 20  tandard sockets 
0d80: 74 68 65 20 74 65 73 74 0a 09 73 75 69 74 65 20  the test..suite 
0d90: 77 61 73 20 61 64 6f 70 74 65 64 20 66 72 6f 6d  was adopted from
0da0: 29 2e 20 20 4b 65 79 20 64 69 66 66 65 72 65 6e  ).  Key differen
0db0: 63 65 73 20 61 72 65 20 74 68 61 74 20 54 4c 53  ces are that TLS
0dc0: 20 63 61 6e 6e 6f 74 0a 09 6f 70 65 72 61 74 65   cannot..operate
0dd0: 20 69 6e 20 6f 6e 65 20 70 72 6f 63 65 73 73 20   in one process 
0de0: 77 69 74 68 6f 75 74 20 61 6c 6c 20 63 68 61 6e  without all chan
0df0: 6e 65 6c 73 20 62 65 69 6e 67 20 6e 6f 6e 2d 62  nels being non-b
0e00: 6c 6f 63 6b 69 6e 67 2c 20 6f 72 0a 09 74 68 65  locking, or..the
0e10: 20 68 61 6e 64 73 68 61 6b 65 20 77 69 6c 6c 20   handshake will 
0e20: 62 6c 6f 63 6b 2c 20 61 6e 64 20 68 61 6e 64 73  block, and hands
0e30: 68 61 6b 69 6e 67 20 6d 75 73 74 20 62 65 20 66  haking must be f
0e40: 6f 72 63 65 64 20 69 6e 20 73 6f 6d 65 0a 09 63  orced in some..c
0e50: 61 73 65 73 2e 20 20 41 6c 73 6f 2c 20 68 61 6e  ases.  Also, han
0e60: 64 73 68 61 6b 65 73 20 64 6f 6e 27 74 20 73 65  dshakes don't se
0e70: 65 6d 20 74 6f 20 63 6f 6d 70 6c 65 74 65 20 75  em to complete u
0e80: 6e 6c 65 73 73 20 74 68 65 20 63 6c 69 65 6e 74  nless the client
0e90: 0a 09 68 61 73 20 70 6c 61 63 65 64 20 61 74 20  ..has placed at 
0ea0: 6c 65 61 73 74 20 6f 6e 65 20 62 79 74 65 20 66  least one byte f
0eb0: 6f 72 20 74 68 65 20 73 65 72 76 65 72 20 74 6f  or the server to
0ec0: 20 72 65 61 64 20 69 6e 20 74 68 65 20 63 68 61   read in the cha
0ed0: 6e 6e 65 6c 2e 0a 0a 09 2a 20 74 65 73 74 73 2f  nnel....* tests/
0ee0: 72 65 6d 6f 74 65 2e 74 63 6c 3a 20 63 6f 72 72  remote.tcl: corr
0ef0: 65 63 74 65 64 20 74 68 65 20 66 69 6e 64 69 6e  ected the findin
0f00: 67 20 6f 66 20 74 65 73 74 73 20 63 65 72 74 69  g of tests certi
0f10: 66 69 63 61 74 65 73 0a 0a 09 2a 20 74 6c 73 49  ficates...* tlsI
0f20: 4f 2e 63 20 28 54 6c 73 43 6c 6f 73 65 50 72 6f  O.c (TlsClosePro
0f30: 63 29 3a 20 72 65 6d 6f 76 65 64 20 64 65 6c 65  c): removed dele
0f40: 74 69 6e 67 20 6f 66 20 74 69 6d 65 72 20 68 61  ting of timer ha
0f50: 6e 64 6c 65 72 20 61 73 0a 09 74 68 61 74 20 69  ndler as..that i
0f60: 73 20 68 61 6e 64 6c 65 64 20 62 79 20 54 6c 73  s handled by Tls
0f70: 5f 43 6c 65 61 6e 2e 0a 0a 09 2a 20 74 6c 73 2e  _Clean....* tls.
0f80: 74 63 6c 20 28 74 6c 73 3a 3a 5f 61 63 63 65 70  tcl (tls::_accep
0f90: 74 29 3a 20 63 6f 72 72 65 63 74 65 64 20 74 68  t): corrected th
0fa0: 65 20 69 6e 74 65 72 6e 61 6c 20 5f 61 63 63 65  e internal _acce
0fb0: 70 74 20 74 6f 0a 09 74 72 69 63 6b 6c 65 20 63  pt to..trickle c
0fc0: 61 6c 6c 62 61 63 6b 20 65 72 72 6f 72 73 20 74  allback errors t
0fd0: 6f 20 74 68 65 20 75 73 65 72 2e 0a 0a 09 2a 20  o the user....* 
0fe0: 4d 61 6b 65 66 69 6c 65 2e 69 6e 3a 20 6d 61 64  Makefile.in: mad
0ff0: 65 20 74 68 65 20 69 6e 73 74 61 6c 6c 2d 62 69  e the install-bi
1000: 6e 61 72 69 65 73 20 74 61 72 67 65 74 20 72 65  naries target re
1010: 67 65 6e 65 72 61 74 65 20 74 68 65 0a 09 70 6b  generate the..pk
1020: 67 49 6e 64 65 78 2e 74 63 6c 20 63 6f 72 72 65  gIndex.tcl corre
1030: 63 74 6c 79 2e 20 20 54 68 65 20 74 65 73 74 20  ctly.  The test 
1040: 74 61 72 67 65 74 20 70 72 6f 62 61 62 6c 79 20  target probably 
1050: 73 68 6f 75 6c 64 6e 27 74 20 73 63 72 65 77 0a  shouldn't screw.
1060: 09 69 74 20 75 70 2c 20 62 75 74 20 74 68 69 73  .it up, but this
1070: 20 69 73 20 74 6f 20 62 65 20 6f 6e 20 74 68 65   is to be on the
1080: 20 73 61 66 65 20 73 69 64 65 2e 0a 0a 32 30 30   safe side...200
1090: 30 2d 30 37 2d 31 37 20 20 4a 65 66 66 20 48 6f  0-07-17  Jeff Ho
10a0: 62 62 73 20 20 3c 68 6f 62 62 73 40 73 63 72 69  bbs  <hobbs@scri
10b0: 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 70  ptics.com>...* p
10c0: 6b 67 49 6e 64 65 78 2e 74 63 6c 2e 69 6e 3a 0a  kgIndex.tcl.in:.
10d0: 09 2a 20 63 6f 6e 66 69 67 75 72 65 2e 69 6e 3a  .* configure.in:
10e0: 20 75 70 64 61 74 65 64 20 76 65 72 73 69 6f 6e   updated version
10f0: 20 74 6f 20 31 2e 34 0a 0a 32 30 30 30 2d 30 37   to 1.4..2000-07
1100: 2d 31 33 20 20 4a 65 66 66 20 48 6f 62 62 73 20  -13  Jeff Hobbs 
1110: 20 3c 68 6f 62 62 73 40 73 63 72 69 70 74 69 63   <hobbs@scriptic
1120: 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 65 73 74 73  s.com>...* tests
1130: 2f 74 6c 73 49 4f 2e 74 65 73 74 3a 20 65 6e 61  /tlsIO.test: ena
1140: 62 6c 65 64 20 74 65 73 74 73 20 32 2e 31 30 2c  bled tests 2.10,
1150: 20 37 2e 5b 31 32 34 35 5d 20 28 74 68 65 72 65   7.[1245] (there
1160: 20 69 73 20 6e 6f 20 33 29 2c 0a 09 77 68 69 63   is no 3),..whic
1170: 68 20 6e 6f 77 20 70 61 73 73 2e 20 20 41 64 64  h now pass.  Add
1180: 65 64 20 73 6f 6d 65 20 63 6f 6d 6d 65 6e 74 73  ed some comments
1190: 20 74 6f 20 6f 74 68 65 72 20 66 61 69 6c 69 6e   to other failin
11a0: 67 20 74 65 73 74 73 2e 0a 0a 32 30 30 30 2d 30  g tests...2000-0
11b0: 37 2d 31 31 20 20 4a 65 66 66 20 48 6f 62 62 73  7-11  Jeff Hobbs
11c0: 20 20 3c 68 6f 62 62 73 40 73 63 72 69 70 74 69    <hobbs@scripti
11d0: 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 49  cs.com>...* tlsI
11e0: 4f 2e 63 3a 20 63 68 61 6e 67 65 64 20 61 6c 6c  O.c: changed all
11f0: 20 74 68 65 20 63 68 61 6e 6e 65 6c 20 70 72 6f   the channel pro
1200: 63 73 20 74 6f 20 73 74 61 72 74 20 77 69 74 68  cs to start with
1210: 20 54 6c 73 2a 20 66 6f 72 0a 09 62 65 74 74 65   Tls* for..bette
1220: 72 20 70 61 72 69 74 79 20 77 68 65 6e 20 63 6f  r parity when co
1230: 6d 70 61 72 69 6e 67 20 77 69 74 68 20 54 72 61  mparing with Tra
1240: 6e 73 66 6f 72 6d 20 63 68 61 6e 6e 65 6c 20 70  nsform channel p
1250: 72 6f 63 73 2e 0a 09 52 65 77 72 6f 74 65 20 54  rocs...Rewrote T
1260: 6c 73 57 61 74 63 68 50 72 6f 63 2c 20 61 64 64  lsWatchProc, add
1270: 65 64 20 54 6c 73 4e 6f 74 69 66 79 50 72 6f 63  ed TlsNotifyProc
1280: 20 61 63 63 6f 72 64 69 6e 67 20 74 6f 20 74 68   according to th
1290: 65 20 6e 65 77 0a 09 63 68 61 6e 6e 65 6c 20 64  e new..channel d
12a0: 65 73 69 67 6e 2c 20 77 68 69 63 68 20 61 6c 73  esign, which als
12b0: 6f 20 6c 65 61 76 65 73 20 54 6c 73 43 68 61 6e  o leaves TlsChan
12c0: 6e 65 6c 48 61 6e 64 6c 65 72 20 75 6e 75 73 65  nelHandler unuse
12d0: 64 2e 0a 0a 09 2a 20 74 6c 73 42 49 4f 2e 63 20  d....* tlsBIO.c 
12e0: 28 42 69 6f 43 74 72 6c 29 3a 20 63 68 61 6e 67  (BioCtrl): chang
12f0: 65 64 20 42 49 4f 5f 43 54 52 4c 5f 46 4c 55 53  ed BIO_CTRL_FLUS
1300: 48 20 63 61 73 65 20 74 6f 20 75 73 65 0a 09 54  H case to use..T
1310: 63 6c 5f 57 72 69 74 65 52 61 77 20 69 6e 73 74  cl_WriteRaw inst
1320: 65 61 64 20 6f 66 20 54 63 6c 5f 46 6c 75 73 68  ead of Tcl_Flush
1330: 20 28 74 6f 20 6f 70 65 72 61 74 65 20 6f 6e 20   (to operate on 
1340: 63 6f 72 72 65 63 74 20 63 68 61 6e 6e 65 6c 0a  correct channel.
1350: 09 69 6e 20 74 68 65 20 73 74 61 63 6b 20 69 6e  .in the stack in
1360: 73 74 65 61 64 20 6f 66 20 73 74 61 72 74 69 6e  stead of startin
1370: 67 20 61 74 20 74 68 65 20 74 6f 70 20 61 67 61  g at the top aga
1380: 69 6e 29 2e 20 20 57 6f 75 6c 64 0a 09 6f 74 68  in).  Would..oth
1390: 65 72 77 69 73 65 20 63 61 75 73 65 20 61 20 72  erwise cause a r
13a0: 65 63 75 72 73 69 76 65 20 73 74 61 63 6b 20 62  ecursive stack b
13b0: 6f 6d 62 20 77 68 65 6e 20 69 6d 70 6c 69 63 69  omb when implici
13c0: 74 20 68 61 6e 64 73 68 61 6b 69 6e 67 0a 09 74  t handshaking..t
13d0: 6f 6f 6b 20 65 66 66 65 63 74 2e 0a 0a 09 2a 20  ook effect....* 
13e0: 74 65 73 74 73 2f 74 6c 73 49 4f 2e 74 65 73 74  tests/tlsIO.test
13f0: 3a 20 72 65 6d 6f 76 65 64 20 63 68 61 6e 67 65  : removed change
1400: 73 20 6d 61 64 65 20 74 6f 20 74 65 73 74 20 73  s made to test s
1410: 75 69 74 65 20 28 61 6c 6c 20 74 65 73 74 73 0a  uite (all tests.
1420: 09 74 68 61 74 20 72 61 6e 20 62 65 66 6f 72 65  .that ran before
1430: 20 6e 6f 77 20 70 61 73 73 20 63 6f 72 72 65 63   now pass correc
1440: 74 6c 79 29 2c 20 61 6e 64 20 63 68 61 6e 67 65  tly), and change
1450: 64 20 73 6f 6d 65 20 61 63 63 65 70 74 20 70 72  d some accept pr
1460: 6f 63 0a 09 61 72 67 73 20 74 6f 20 72 65 66 6c  oc..args to refl
1470: 65 63 74 20 74 68 61 74 20 61 20 73 6f 63 6b 20  ect that a sock 
1480: 69 73 20 61 6e 20 61 72 67 2c 20 6e 6f 74 20 61  is an arg, not a
1490: 20 66 69 6c 65 2e 0a 0a 32 30 30 30 2d 30 37 2d   file...2000-07-
14a0: 31 30 20 20 4a 65 66 66 20 48 6f 62 62 73 20 20  10  Jeff Hobbs  
14b0: 3c 68 6f 62 62 73 40 73 63 72 69 70 74 69 63 73  <hobbs@scriptics
14c0: 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 42 49 4f  .com>...* tlsBIO
14d0: 2e 63 20 28 42 69 6f 57 72 69 74 65 2c 20 42 69  .c (BioWrite, Bi
14e0: 6f 52 65 61 64 29 3a 20 63 68 61 6e 67 65 64 20  oRead): changed 
14f0: 54 63 6c 5f 52 65 61 64 2f 57 72 69 74 65 20 74  Tcl_Read/Write t
1500: 6f 0a 09 54 63 6c 5f 52 65 61 64 52 61 77 2f 54  o..Tcl_ReadRaw/T
1510: 63 6c 57 72 69 74 65 52 61 77 2e 0a 0a 09 2a 20  clWriteRaw....* 
1520: 74 6c 73 2e 63 3a 20 61 64 64 65 64 20 75 73 65  tls.c: added use
1530: 20 6f 66 20 54 63 6c 5f 47 65 74 54 6f 70 43 68   of Tcl_GetTopCh
1540: 61 6e 6e 65 6c 20 61 66 74 65 72 20 54 63 6c 5f  annel after Tcl_
1550: 47 65 74 43 68 61 6e 6e 65 6c 20 61 6e 64 0a 09  GetChannel and..
1560: 67 6f 74 20 72 65 74 75 72 6e 20 76 61 6c 75 65  got return value
1570: 20 66 72 6f 6d 20 54 63 6c 5f 53 74 61 63 6b 43   from Tcl_StackC
1580: 68 61 6e 6e 65 6c 2e 0a 0a 09 2a 20 74 65 73 74  hannel....* test
1590: 73 2f 74 6c 73 49 4f 2e 74 65 73 74 3a 20 61 64  s/tlsIO.test: ad
15a0: 64 65 64 20 73 6f 6d 65 20 68 61 6e 64 73 68 61  ded some handsha
15b0: 6b 69 6e 67 20 74 68 61 74 20 73 68 6f 75 6c 64  king that should
15c0: 6e 27 74 20 62 65 0a 09 6e 65 63 65 73 73 61 72  n't be..necessar
15d0: 79 2c 20 62 75 74 20 77 65 20 63 72 61 73 68 20  y, but we crash 
15e0: 6f 74 68 65 72 77 69 73 65 20 28 6e 65 65 64 73  otherwise (needs
15f0: 20 6d 6f 72 65 20 74 65 73 74 69 6e 67 29 2e 0a   more testing)..
1600: 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 20 61 64 64  ..* tlsIO.c: add
1610: 65 64 20 73 75 70 70 6f 72 74 20 66 6f 72 20 22  ed support for "
1620: 63 6f 72 72 65 63 74 65 64 22 20 73 74 61 63 6b  corrected" stack
1630: 65 64 20 63 68 61 6e 6e 65 6c 73 2e 20 20 41 6c  ed channels.  Al
1640: 6c 0a 09 74 68 65 20 61 62 6f 76 65 20 63 68 61  l..the above cha
1650: 6e 6e 65 6c 73 20 61 72 65 20 69 6e 20 54 43 4c  nnels are in TCL
1660: 5f 43 48 41 4e 4e 45 4c 5f 56 45 52 53 49 4f 4e  _CHANNEL_VERSION
1670: 5f 32 20 23 69 66 64 65 66 73 2e 0a 0a 32 30 30  _2 #ifdefs...200
1680: 30 2d 30 36 2d 30 35 20 20 53 63 6f 74 74 20 53  0-06-05  Scott S
1690: 74 61 6e 74 6f 6e 20 20 3c 73 74 61 6e 74 6f 6e  tanton  <stanton
16a0: 40 61 6a 75 62 61 73 6f 6c 75 74 69 6f 6e 73 2e  @ajubasolutions.
16b0: 63 6f 6d 3e 0a 0a 09 2a 20 4d 61 6b 65 66 69 6c  com>...* Makefil
16c0: 65 2e 69 6e 3a 20 46 69 78 65 64 20 62 72 6f 6b  e.in: Fixed brok
16d0: 65 6e 20 74 65 73 74 20 74 61 72 67 65 74 2e 0a  en test target..
16e0: 0a 09 2a 20 74 6c 73 49 6e 74 2e 68 3a 20 0a 09  ..* tlsInt.h: ..
16f0: 2a 20 74 6c 73 2e 63 3a 20 43 6c 65 61 6e 65 64  * tls.c: Cleaned
1700: 20 75 70 20 64 65 63 6c 61 72 61 74 69 6f 6e 73   up declarations
1710: 20 6f 66 20 54 6c 73 5f 43 6c 65 61 6e 20 74 6f   of Tls_Clean to
1720: 20 61 76 6f 69 64 20 65 72 72 6f 72 73 20 6f 6e   avoid errors on
1730: 0a 09 57 69 6e 64 6f 77 73 20 28 6c 69 6e 74 29  ..Windows (lint)
1740: 2e 0a 0a 32 30 30 30 2d 30 36 2d 30 35 20 20 42  ...2000-06-05  B
1750: 72 65 6e 74 20 57 65 6c 63 68 20 3c 77 65 6c 63  rent Welch <welc
1760: 68 40 61 6a 75 62 61 73 6f 6c 75 74 69 6f 6e 73  h@ajubasolutions
1770: 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 2e 63 2c  .com>...* tls.c,
1780: 20 74 6c 73 49 4f 2e 63 3a 20 20 53 70 6c 69 74   tlsIO.c:  Split
1790: 20 54 6c 73 5f 46 72 65 65 20 69 6e 74 6f 20 54   Tls_Free into T
17a0: 6c 73 5f 43 6c 65 61 6e 2c 20 77 68 69 63 68 20  ls_Clean, which 
17b0: 64 6f 65 73 0a 09 74 68 65 20 53 53 4c 20 63 6c  does..the SSL cl
17c0: 65 61 6e 75 70 2c 20 61 6e 64 20 74 68 65 20 54  eanup, and the T
17d0: 63 6c 5f 46 72 65 65 20 63 61 6c 6c 2e 20 20 49  cl_Free call.  I
17e0: 74 20 69 73 20 69 6d 70 6f 72 74 61 6e 74 20 74  t is important t
17f0: 6f 20 73 68 75 74 64 6f 77 6e 0a 09 74 68 65 20  o shutdown..the 
1800: 53 53 4c 20 73 74 61 74 65 20 22 73 79 6e 63 68  SSL state "synch
1810: 72 6f 6e 6f 75 73 6c 79 22 20 64 75 72 69 6e 67  ronously" during
1820: 20 61 20 73 74 61 63 6b 65 64 20 66 6c 75 73 68   a stacked flush
1830: 2e 0a 0a 32 30 30 30 2d 30 36 2d 30 31 20 20 53  ...2000-06-01  S
1840: 63 6f 74 74 20 53 74 61 6e 74 6f 6e 20 20 3c 73  cott Stanton  <s
1850: 74 61 6e 74 6f 6e 40 61 6a 75 62 61 73 6f 6c 75  tanton@ajubasolu
1860: 74 69 6f 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74  tions.com>...* t
1870: 6c 73 49 4f 2e 63 3a 20 52 65 73 74 6f 72 65 64  lsIO.c: Restored
1880: 20 63 61 6c 6c 20 74 6f 20 54 63 6c 5f 4e 6f 74   call to Tcl_Not
1890: 69 66 79 43 68 61 6e 6e 65 6c 20 66 72 6f 6d 20  ifyChannel from 
18a0: 43 68 61 6e 6e 65 6c 48 61 6e 64 6c 65 72 0a 09  ChannelHandler..
18b0: 74 6f 20 65 6e 73 75 72 65 20 74 68 61 74 20 65  to ensure that e
18c0: 76 65 6e 74 73 20 70 72 6f 70 61 67 61 74 65 20  vents propagate 
18d0: 66 72 6f 6d 20 74 68 65 20 6c 6f 77 65 72 20 64  from the lower d
18e0: 72 69 76 65 72 2e 20 20 54 68 69 73 20 6d 61 79  river.  This may
18f0: 0a 09 72 65 73 75 6c 74 20 69 6e 20 61 6e 20 69  ..result in an i
1900: 6e 66 69 6e 69 74 65 20 6c 6f 6f 70 20 69 6e 20  nfinite loop in 
1910: 73 6f 6d 65 20 63 61 73 65 73 2c 20 73 6f 20 74  some cases, so t
1920: 68 69 73 20 69 73 20 6e 6f 74 20 61 20 74 6f 74  his is not a tot
1930: 61 6c 0a 09 66 69 78 2e 20 20 54 68 69 73 20 6d  al..fix.  This m
1940: 61 79 20 62 65 20 73 75 66 66 69 63 69 65 6e 74  ay be sufficient
1950: 20 66 6f 72 20 6e 6f 77 2c 20 68 6f 77 65 76 65   for now, howeve
1960: 72 2e 20 5b 42 75 67 3a 20 35 36 32 33 5d 0a 0a  r. [Bug: 5623]..
1970: 32 30 30 30 2d 30 36 2d 30 31 20 20 53 63 6f 74  2000-06-01  Scot
1980: 74 20 53 74 61 6e 74 6f 6e 20 20 3c 73 74 61 6e  t Stanton  <stan
1990: 74 6f 6e 40 73 63 72 69 70 74 69 63 73 2e 63 6f  ton@scriptics.co
19a0: 6d 3e 0a 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 20  m>...* tlsIO.c: 
19b0: 52 65 73 74 6f 72 65 20 74 68 65 20 70 72 65 76  Restore the prev
19c0: 69 6f 75 73 20 76 65 72 73 69 6f 6e 2e 20 20 46  ious version.  F
19d0: 69 78 65 64 20 74 68 65 20 43 6c 6f 73 65 50 72  ixed the ClosePr
19e0: 6f 63 20 73 6f 0a 09 69 74 20 75 6e 72 65 67 69  oc so..it unregi
19f0: 73 74 65 72 73 20 74 68 65 20 63 68 61 6e 6e 65  sters the channe
1a00: 6c 20 68 61 6e 64 6c 65 72 20 6f 6e 20 74 68 65  l handler on the
1a10: 20 73 75 70 65 72 63 65 64 65 64 20 63 68 61 6e   superceded chan
1a20: 6e 65 6c 0a 09 69 6e 73 74 65 61 64 20 6f 66 20  nel..instead of 
1a30: 74 68 65 20 75 70 70 65 72 20 63 68 61 6e 6e 65  the upper channe
1a40: 6c 2e 20 41 6c 73 6f 20 72 65 6d 6f 76 65 64 20  l. Also removed 
1a50: 74 68 65 20 63 61 6c 6c 20 74 6f 0a 09 54 63 6c  the call to..Tcl
1a60: 5f 4e 6f 74 69 66 79 43 68 61 6e 6e 65 6c 20 69  _NotifyChannel i
1a70: 6e 20 74 68 65 20 43 68 61 6e 6e 65 6c 48 61 6e  n the ChannelHan
1a80: 64 6c 65 72 20 62 65 63 61 75 73 65 20 74 68 69  dler because thi
1a90: 73 20 77 69 6c 6c 20 72 65 73 75 6c 74 0a 09 69  s will result..i
1aa0: 6e 20 61 6e 20 69 6e 66 69 6e 69 74 65 20 6c 6f  n an infinite lo
1ab0: 6f 70 20 69 66 20 64 61 74 61 20 69 73 20 65 76  op if data is ev
1ac0: 65 72 20 62 75 66 66 65 72 65 64 20 69 6e 20 74  er buffered in t
1ad0: 68 65 20 42 49 4f 0a 09 73 74 72 75 63 74 75 72  he BIO..structur
1ae0: 65 2e 20 5b 42 75 67 3a 20 35 36 32 33 5d 0a 0a  e. [Bug: 5623]..
1af0: 32 30 30 30 2d 30 35 2d 33 31 20 20 42 72 65 6e  2000-05-31  Bren
1b00: 74 20 57 65 6c 63 68 20 3c 77 65 6c 63 68 40 73  t Welch <welch@s
1b10: 63 72 69 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09  criptics.com>...
1b20: 2a 20 74 6c 73 2e 63 3a 20 43 68 61 6e 67 65 20  * tls.c: Change 
1b30: 74 68 65 20 43 68 61 6e 6e 65 6c 48 61 6e 64 6c  the ChannelHandl
1b40: 65 72 20 74 6f 20 62 65 20 72 65 67 69 73 74 65  er to be registe
1b50: 72 65 64 20 6f 6e 20 74 68 65 20 6d 61 69 6e 0a  red on the main.
1b60: 09 63 68 61 6e 6e 65 6c 20 61 73 20 6f 70 70 73  .channel as opps
1b70: 65 64 20 74 6f 20 74 68 65 20 22 70 61 72 65 6e  ed to the "paren
1b80: 74 22 2c 20 6f 72 20 73 75 70 65 72 63 65 65 64  t", or superceed
1b90: 65 64 2c 20 63 68 61 6e 6e 65 6c 2e 20 20 54 68  ed, channel.  Th
1ba0: 69 73 0a 09 69 73 20 62 65 63 61 75 73 65 20 74  is..is because t
1bb0: 68 65 20 73 6f 63 6b 65 74 20 64 72 69 76 65 72  he socket driver
1bc0: 20 6e 6f 74 69 66 69 65 73 20 74 68 65 20 6d 61   notifies the ma
1bd0: 69 6e 20 63 68 61 6e 6e 65 6c 2c 20 61 6e 64 20  in channel, and 
1be0: 74 68 65 72 65 0a 09 61 72 65 20 74 69 6d 65 73  there..are times
1bf0: 20 77 69 74 68 20 74 68 65 20 6d 61 69 6e 20 63   with the main c
1c00: 68 61 6e 6e 65 6c 20 67 65 74 73 20 63 6c 6f 73  hannel gets clos
1c10: 65 64 2c 20 62 75 74 20 74 68 65 20 73 75 70 65  ed, but the supe
1c20: 72 63 65 64 65 64 0a 09 6f 6e 65 20 69 73 20 6e  rceded..one is n
1c30: 6f 74 20 79 65 74 20 63 6c 6f 73 65 64 2e 20 20  ot yet closed.  
1c40: 49 66 20 74 68 65 20 63 68 61 6e 6e 65 6c 20 68  If the channel h
1c50: 61 6e 64 6c 65 72 20 67 65 74 73 20 74 72 69 67  andler gets trig
1c60: 67 65 72 65 64 20 69 6e 0a 09 74 68 69 73 20 68  gered in..this h
1c70: 61 6c 66 2d 6f 70 65 6e 20 73 74 61 74 65 20 69  alf-open state i
1c80: 74 20 69 73 20 61 73 73 6f 63 69 61 74 65 64 20  t is associated 
1c90: 77 69 74 68 20 74 68 65 20 73 75 70 65 72 63 65  with the superce
1ca0: 65 64 65 64 0a 09 63 68 61 6e 6e 65 64 6c 2c 20  eded..channedl, 
1cb0: 62 75 74 20 75 73 65 73 20 69 74 73 20 70 72 69  but uses its pri
1cc0: 76 61 74 65 20 70 6f 69 6e 74 65 72 20 74 6f 20  vate pointer to 
1cd0: 74 68 65 20 6d 61 69 6e 20 63 68 61 6e 6e 65 6c  the main channel
1ce0: 2c 20 77 68 69 63 68 0a 09 69 73 20 6d 6f 73 74  , which..is most
1cf0: 6c 79 20 64 65 73 74 72 6f 79 65 64 2e 20 20 45  ly destroyed.  E
1d00: 6c 69 6d 69 6e 61 74 65 64 20 74 68 65 20 72 65  liminated the re
1d10: 64 75 6e 64 61 6e 74 20 63 61 6c 6c 20 74 6f 0a  dundant call to.
1d20: 09 54 63 6c 5f 4e 6f 74 69 66 79 43 68 61 6e 6e  .Tcl_NotifyChann
1d30: 65 6c 20 66 72 6f 6d 20 54 6c 73 57 61 74 63 68  el from TlsWatch
1d40: 50 72 6f 63 2e 20 5b 42 75 67 3a 20 35 36 32 33  Proc. [Bug: 5623
1d50: 5d 0a                                            ].