Hex Artifact Content

Artifact d63d0daba378eb82b5f2517bc8293483b5f0776d:


0000: 32 30 30 30 2d 30 38 2d 31 34 20 20 4a 65 66 66  2000-08-14  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 6c 73 2e 63 20 28 54 6c 73 5f 49 6e 69  * tls.c (Tls_Ini
0040: 74 29 3a 20 63 68 61 6e 67 65 64 20 69 74 20 74  t): changed it t
0050: 6f 20 72 65 71 75 69 72 65 20 38 2e 33 2e 32 20  o require 8.3.2 
0060: 77 68 65 6e 20 54 63 6c 5f 49 6e 69 74 53 74 75  when Tcl_InitStu
0070: 62 73 0a 09 77 61 73 20 63 61 6c 6c 65 64 20 62  bs..was called b
0080: 65 63 61 75 73 65 20 77 65 20 64 6f 6e 27 74 20  ecause we don't 
0090: 77 61 6e 74 20 70 65 6f 70 6c 65 20 75 73 69 6e  want people usin
00a0: 67 20 54 4c 53 20 77 69 74 68 20 74 68 65 0a 09  g TLS with the..
00b0: 6f 72 69 67 69 6e 61 6c 20 73 74 61 63 6b 65 64  original stacked
00c0: 20 63 68 61 6e 6e 65 6c 20 69 6d 70 6c 65 6d 65   channel impleme
00d0: 6e 74 61 74 69 6f 6e 2e 0a 0a 32 30 30 30 2d 30  ntation...2000-0
00e0: 37 2d 32 36 20 20 4a 65 66 66 20 48 6f 62 62 73  7-26  Jeff Hobbs
00f0: 20 20 3c 68 6f 62 62 73 40 73 63 72 69 70 74 69    <hobbs@scripti
0100: 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 6d 65 72 67  cs.com>...* merg
0110: 65 64 20 61 6c 6c 20 63 68 61 6e 67 65 73 20 66  ed all changes f
0120: 72 6f 6d 20 74 6c 73 2d 31 2d 33 2d 69 6f 2d 72  rom tls-1-3-io-r
0130: 65 77 72 69 74 65 20 62 61 63 6b 20 69 6e 74 6f  ewrite back into
0140: 20 6d 61 69 6e 20 62 72 61 6e 63 68 0a 0a 09 2a   main branch...*
0150: 20 74 65 73 74 73 2f 74 6c 73 49 4f 2e 74 65 73   tests/tlsIO.tes
0160: 74 3a 20 75 70 64 61 74 65 64 20 63 6f 6d 6d 65  t: updated comme
0170: 6e 74 73 2c 20 66 69 78 65 64 20 61 20 70 63 43  nts, fixed a pcC
0180: 72 61 73 68 20 63 61 73 65 20 74 68 61 74 0a 09  rash case that..
0190: 77 61 73 20 64 75 65 20 74 6f 20 64 65 62 75 67  was due to debug
01a0: 20 61 73 73 65 72 74 69 6f 6e 20 69 6e 20 57 69   assertion in Wi
01b0: 6e 64 6f 77 73 20 53 53 4c 2e 0a 0a 09 2a 20 74  ndows SSL....* t
01c0: 6c 73 2e 63 20 28 49 6d 70 6f 72 74 4f 62 6a 43  ls.c (ImportObjC
01d0: 6d 64 29 3a 20 72 65 6d 6f 76 65 64 20 75 6e 6e  md): removed unn
01e0: 65 63 65 73 73 61 72 79 20 75 73 65 20 6f 66 20  ecessary use of 
01f0: 27 62 69 6f 27 20 61 72 67 2e 0a 09 28 54 6c 73  'bio' arg...(Tls
0200: 5f 49 6e 69 74 29 3a 20 63 68 65 63 6b 20 72 65  _Init): check re
0210: 74 75 72 6e 20 76 61 6c 75 65 20 6f 66 20 53 53  turn value of SS
0220: 4c 5f 6c 69 62 72 61 72 79 5f 69 6e 69 74 2e 20  L_library_init. 
0230: 20 41 6c 73 6f 20 6c 6f 74 73 20 6f 66 0a 09 77   Also lots of..w
0240: 68 69 74 65 73 70 61 63 65 20 63 6c 65 61 6e 75  hitespace cleanu
0250: 70 20 28 6d 6f 72 65 20 6c 69 6b 65 20 54 63 6c  p (more like Tcl
0260: 20 45 6e 67 20 73 74 79 6c 65 20 67 75 69 64 65   Eng style guide
0270: 29 2c 20 62 75 74 20 6e 6f 74 20 61 6c 6c 0a 09  ), but not all..
0280: 63 6f 64 65 20 77 61 73 20 63 6c 65 61 6e 65 64  code was cleaned
0290: 20 75 70 2e 0a 0a 09 2a 20 74 6c 73 42 49 4f 2e   up....* tlsBIO.
02a0: 63 3a 20 6d 69 6e 6f 72 20 77 68 69 74 65 73 70  c: minor whitesp
02b0: 61 63 65 20 63 6c 65 61 6e 75 70 0a 0a 09 2a 20  ace cleanup...* 
02c0: 74 6c 73 49 4f 2e 63 3a 20 6d 69 6e 6f 72 20 77  tlsIO.c: minor w
02d0: 68 69 74 65 73 70 61 63 65 20 63 6c 65 61 6e 75  hitespace cleanu
02e0: 70 2e 0a 09 28 54 6c 73 49 6e 70 75 74 50 72 6f  p...(TlsInputPro
02f0: 63 2c 20 54 6c 73 4f 75 74 70 75 74 50 72 6f 63  c, TlsOutputProc
0300: 29 3a 20 41 64 64 65 64 20 45 52 52 5f 63 6c 65  ): Added ERR_cle
0310: 61 72 5f 65 72 72 6f 72 20 62 65 66 6f 72 65 20  ar_error before 
0320: 63 61 6c 6c 73 0a 09 74 6f 20 42 49 4f 5f 72 65  calls..to BIO_re
0330: 61 64 20 6f 72 20 42 49 4f 5f 77 72 69 74 65 2c  ad or BIO_write,
0340: 20 62 65 63 61 75 73 65 20 77 65 20 63 6f 75 6c   because we coul
0350: 64 20 6f 74 68 65 72 77 69 73 65 20 65 6e 64 20  d otherwise end 
0360: 75 70 0a 09 70 75 6c 6c 69 6e 67 20 61 6e 20 65  up..pulling an e
0370: 72 72 6f 72 20 6f 66 66 20 74 68 65 20 73 74 61  rror off the sta
0380: 63 6b 20 74 68 61 74 20 64 69 64 6e 27 74 20 62  ck that didn't b
0390: 65 6c 6f 6e 67 20 74 6f 20 75 73 2e 20 20 41 6c  elong to us.  Al
03a0: 73 6f 0a 09 63 6c 65 61 6e 75 70 20 75 70 20 65  so..cleanup up e
03b0: 78 63 65 73 73 69 76 65 20 75 73 65 20 6f 66 20  xcessive use of 
03c0: 67 6f 74 6f 73 2e 0a 0a 32 30 30 30 2d 30 37 2d  gotos...2000-07-
03d0: 32 30 20 20 4a 65 66 66 20 48 6f 62 62 73 20 20  20  Jeff Hobbs  
03e0: 3c 68 6f 62 62 73 40 73 63 72 69 70 74 69 63 73  <hobbs@scriptics
03f0: 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 65 73 74 73 2f  .com>...* tests/
0400: 74 6c 73 49 4f 2e 74 65 73 74 3a 20 63 6f 72 72  tlsIO.test: corr
0410: 65 63 74 65 64 20 76 61 72 69 6f 75 73 20 74 65  ected various te
0420: 73 74 73 20 74 6f 20 62 65 20 63 6f 72 72 65 63  sts to be correc
0430: 74 20 66 6f 72 20 54 4c 53 0a 09 73 74 61 63 6b  t for TLS..stack
0440: 65 64 20 63 68 61 6e 6e 65 6c 73 20 28 61 73 20  ed channels (as 
0450: 6f 70 70 6f 73 65 64 20 74 6f 20 74 68 65 20 73  opposed to the s
0460: 74 61 6e 64 61 72 64 20 73 6f 63 6b 65 74 73 20  tandard sockets 
0470: 74 68 65 20 74 65 73 74 0a 09 73 75 69 74 65 20  the test..suite 
0480: 77 61 73 20 61 64 6f 70 74 65 64 20 66 72 6f 6d  was adopted from
0490: 29 2e 20 20 4b 65 79 20 64 69 66 66 65 72 65 6e  ).  Key differen
04a0: 63 65 73 20 61 72 65 20 74 68 61 74 20 54 4c 53  ces are that TLS
04b0: 20 63 61 6e 6e 6f 74 0a 09 6f 70 65 72 61 74 65   cannot..operate
04c0: 20 69 6e 20 6f 6e 65 20 70 72 6f 63 65 73 73 20   in one process 
04d0: 77 69 74 68 6f 75 74 20 61 6c 6c 20 63 68 61 6e  without all chan
04e0: 6e 65 6c 73 20 62 65 69 6e 67 20 6e 6f 6e 2d 62  nels being non-b
04f0: 6c 6f 63 6b 69 6e 67 2c 20 6f 72 0a 09 74 68 65  locking, or..the
0500: 20 68 61 6e 64 73 68 61 6b 65 20 77 69 6c 6c 20   handshake will 
0510: 62 6c 6f 63 6b 2c 20 61 6e 64 20 68 61 6e 64 73  block, and hands
0520: 68 61 6b 69 6e 67 20 6d 75 73 74 20 62 65 20 66  haking must be f
0530: 6f 72 63 65 64 20 69 6e 20 73 6f 6d 65 0a 09 63  orced in some..c
0540: 61 73 65 73 2e 20 20 41 6c 73 6f 2c 20 68 61 6e  ases.  Also, han
0550: 64 73 68 61 6b 65 73 20 64 6f 6e 27 74 20 73 65  dshakes don't se
0560: 65 6d 20 74 6f 20 63 6f 6d 70 6c 65 74 65 20 75  em to complete u
0570: 6e 6c 65 73 73 20 74 68 65 20 63 6c 69 65 6e 74  nless the client
0580: 0a 09 68 61 73 20 70 6c 61 63 65 64 20 61 74 20  ..has placed at 
0590: 6c 65 61 73 74 20 6f 6e 65 20 62 79 74 65 20 66  least one byte f
05a0: 6f 72 20 74 68 65 20 73 65 72 76 65 72 20 74 6f  or the server to
05b0: 20 72 65 61 64 20 69 6e 20 74 68 65 20 63 68 61   read in the cha
05c0: 6e 6e 65 6c 2e 0a 0a 09 2a 20 74 65 73 74 73 2f  nnel....* tests/
05d0: 72 65 6d 6f 74 65 2e 74 63 6c 3a 20 63 6f 72 72  remote.tcl: corr
05e0: 65 63 74 65 64 20 74 68 65 20 66 69 6e 64 69 6e  ected the findin
05f0: 67 20 6f 66 20 74 65 73 74 73 20 63 65 72 74 69  g of tests certi
0600: 66 69 63 61 74 65 73 0a 0a 09 2a 20 74 6c 73 49  ficates...* tlsI
0610: 4f 2e 63 20 28 54 6c 73 43 6c 6f 73 65 50 72 6f  O.c (TlsClosePro
0620: 63 29 3a 20 72 65 6d 6f 76 65 64 20 64 65 6c 65  c): removed dele
0630: 74 69 6e 67 20 6f 66 20 74 69 6d 65 72 20 68 61  ting of timer ha
0640: 6e 64 6c 65 72 20 61 73 0a 09 74 68 61 74 20 69  ndler as..that i
0650: 73 20 68 61 6e 64 6c 65 64 20 62 79 20 54 6c 73  s handled by Tls
0660: 5f 43 6c 65 61 6e 2e 0a 0a 09 2a 20 74 6c 73 2e  _Clean....* tls.
0670: 74 63 6c 20 28 74 6c 73 3a 3a 5f 61 63 63 65 70  tcl (tls::_accep
0680: 74 29 3a 20 63 6f 72 72 65 63 74 65 64 20 74 68  t): corrected th
0690: 65 20 69 6e 74 65 72 6e 61 6c 20 5f 61 63 63 65  e internal _acce
06a0: 70 74 20 74 6f 0a 09 74 72 69 63 6b 6c 65 20 63  pt to..trickle c
06b0: 61 6c 6c 62 61 63 6b 20 65 72 72 6f 72 73 20 74  allback errors t
06c0: 6f 20 74 68 65 20 75 73 65 72 2e 0a 0a 09 2a 20  o the user....* 
06d0: 4d 61 6b 65 66 69 6c 65 2e 69 6e 3a 20 6d 61 64  Makefile.in: mad
06e0: 65 20 74 68 65 20 69 6e 73 74 61 6c 6c 2d 62 69  e the install-bi
06f0: 6e 61 72 69 65 73 20 74 61 72 67 65 74 20 72 65  naries target re
0700: 67 65 6e 65 72 61 74 65 20 74 68 65 0a 09 70 6b  generate the..pk
0710: 67 49 6e 64 65 78 2e 74 63 6c 20 63 6f 72 72 65  gIndex.tcl corre
0720: 63 74 6c 79 2e 20 20 54 68 65 20 74 65 73 74 20  ctly.  The test 
0730: 74 61 72 67 65 74 20 70 72 6f 62 61 62 6c 79 20  target probably 
0740: 73 68 6f 75 6c 64 6e 27 74 20 73 63 72 65 77 0a  shouldn't screw.
0750: 09 69 74 20 75 70 2c 20 62 75 74 20 74 68 69 73  .it up, but this
0760: 20 69 73 20 74 6f 20 62 65 20 6f 6e 20 74 68 65   is to be on the
0770: 20 73 61 66 65 20 73 69 64 65 2e 0a 0a 32 30 30   safe side...200
0780: 30 2d 30 37 2d 31 37 20 20 4a 65 66 66 20 48 6f  0-07-17  Jeff Ho
0790: 62 62 73 20 20 3c 68 6f 62 62 73 40 73 63 72 69  bbs  <hobbs@scri
07a0: 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 70  ptics.com>...* p
07b0: 6b 67 49 6e 64 65 78 2e 74 63 6c 2e 69 6e 3a 0a  kgIndex.tcl.in:.
07c0: 09 2a 20 63 6f 6e 66 69 67 75 72 65 2e 69 6e 3a  .* configure.in:
07d0: 20 75 70 64 61 74 65 64 20 76 65 72 73 69 6f 6e   updated version
07e0: 20 74 6f 20 31 2e 34 0a 0a 32 30 30 30 2d 30 37   to 1.4..2000-07
07f0: 2d 31 33 20 20 4a 65 66 66 20 48 6f 62 62 73 20  -13  Jeff Hobbs 
0800: 20 3c 68 6f 62 62 73 40 73 63 72 69 70 74 69 63   <hobbs@scriptic
0810: 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 65 73 74 73  s.com>...* tests
0820: 2f 74 6c 73 49 4f 2e 74 65 73 74 3a 20 65 6e 61  /tlsIO.test: ena
0830: 62 6c 65 64 20 74 65 73 74 73 20 32 2e 31 30 2c  bled tests 2.10,
0840: 20 37 2e 5b 31 32 34 35 5d 20 28 74 68 65 72 65   7.[1245] (there
0850: 20 69 73 20 6e 6f 20 33 29 2c 0a 09 77 68 69 63   is no 3),..whic
0860: 68 20 6e 6f 77 20 70 61 73 73 2e 20 20 41 64 64  h now pass.  Add
0870: 65 64 20 73 6f 6d 65 20 63 6f 6d 6d 65 6e 74 73  ed some comments
0880: 20 74 6f 20 6f 74 68 65 72 20 66 61 69 6c 69 6e   to other failin
0890: 67 20 74 65 73 74 73 2e 0a 0a 32 30 30 30 2d 30  g tests...2000-0
08a0: 37 2d 31 31 20 20 4a 65 66 66 20 48 6f 62 62 73  7-11  Jeff Hobbs
08b0: 20 20 3c 68 6f 62 62 73 40 73 63 72 69 70 74 69    <hobbs@scripti
08c0: 63 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 49  cs.com>...* tlsI
08d0: 4f 2e 63 3a 20 63 68 61 6e 67 65 64 20 61 6c 6c  O.c: changed all
08e0: 20 74 68 65 20 63 68 61 6e 6e 65 6c 20 70 72 6f   the channel pro
08f0: 63 73 20 74 6f 20 73 74 61 72 74 20 77 69 74 68  cs to start with
0900: 20 54 6c 73 2a 20 66 6f 72 0a 09 62 65 74 74 65   Tls* for..bette
0910: 72 20 70 61 72 69 74 79 20 77 68 65 6e 20 63 6f  r parity when co
0920: 6d 70 61 72 69 6e 67 20 77 69 74 68 20 54 72 61  mparing with Tra
0930: 6e 73 66 6f 72 6d 20 63 68 61 6e 6e 65 6c 20 70  nsform channel p
0940: 72 6f 63 73 2e 0a 09 52 65 77 72 6f 74 65 20 54  rocs...Rewrote T
0950: 6c 73 57 61 74 63 68 50 72 6f 63 2c 20 61 64 64  lsWatchProc, add
0960: 65 64 20 54 6c 73 4e 6f 74 69 66 79 50 72 6f 63  ed TlsNotifyProc
0970: 20 61 63 63 6f 72 64 69 6e 67 20 74 6f 20 74 68   according to th
0980: 65 20 6e 65 77 0a 09 63 68 61 6e 6e 65 6c 20 64  e new..channel d
0990: 65 73 69 67 6e 2c 20 77 68 69 63 68 20 61 6c 73  esign, which als
09a0: 6f 20 6c 65 61 76 65 73 20 54 6c 73 43 68 61 6e  o leaves TlsChan
09b0: 6e 65 6c 48 61 6e 64 6c 65 72 20 75 6e 75 73 65  nelHandler unuse
09c0: 64 2e 0a 0a 09 2a 20 74 6c 73 42 49 4f 2e 63 20  d....* tlsBIO.c 
09d0: 28 42 69 6f 43 74 72 6c 29 3a 20 63 68 61 6e 67  (BioCtrl): chang
09e0: 65 64 20 42 49 4f 5f 43 54 52 4c 5f 46 4c 55 53  ed BIO_CTRL_FLUS
09f0: 48 20 63 61 73 65 20 74 6f 20 75 73 65 0a 09 54  H case to use..T
0a00: 63 6c 5f 57 72 69 74 65 52 61 77 20 69 6e 73 74  cl_WriteRaw inst
0a10: 65 61 64 20 6f 66 20 54 63 6c 5f 46 6c 75 73 68  ead of Tcl_Flush
0a20: 20 28 74 6f 20 6f 70 65 72 61 74 65 20 6f 6e 20   (to operate on 
0a30: 63 6f 72 72 65 63 74 20 63 68 61 6e 6e 65 6c 0a  correct channel.
0a40: 09 69 6e 20 74 68 65 20 73 74 61 63 6b 20 69 6e  .in the stack in
0a50: 73 74 65 61 64 20 6f 66 20 73 74 61 72 74 69 6e  stead of startin
0a60: 67 20 61 74 20 74 68 65 20 74 6f 70 20 61 67 61  g at the top aga
0a70: 69 6e 29 2e 20 20 57 6f 75 6c 64 0a 09 6f 74 68  in).  Would..oth
0a80: 65 72 77 69 73 65 20 63 61 75 73 65 20 61 20 72  erwise cause a r
0a90: 65 63 75 72 73 69 76 65 20 73 74 61 63 6b 20 62  ecursive stack b
0aa0: 6f 6d 62 20 77 68 65 6e 20 69 6d 70 6c 69 63 69  omb when implici
0ab0: 74 20 68 61 6e 64 73 68 61 6b 69 6e 67 0a 09 74  t handshaking..t
0ac0: 6f 6f 6b 20 65 66 66 65 63 74 2e 0a 0a 09 2a 20  ook effect....* 
0ad0: 74 65 73 74 73 2f 74 6c 73 49 4f 2e 74 65 73 74  tests/tlsIO.test
0ae0: 3a 20 72 65 6d 6f 76 65 64 20 63 68 61 6e 67 65  : removed change
0af0: 73 20 6d 61 64 65 20 74 6f 20 74 65 73 74 20 73  s made to test s
0b00: 75 69 74 65 20 28 61 6c 6c 20 74 65 73 74 73 0a  uite (all tests.
0b10: 09 74 68 61 74 20 72 61 6e 20 62 65 66 6f 72 65  .that ran before
0b20: 20 6e 6f 77 20 70 61 73 73 20 63 6f 72 72 65 63   now pass correc
0b30: 74 6c 79 29 2c 20 61 6e 64 20 63 68 61 6e 67 65  tly), and change
0b40: 64 20 73 6f 6d 65 20 61 63 63 65 70 74 20 70 72  d some accept pr
0b50: 6f 63 0a 09 61 72 67 73 20 74 6f 20 72 65 66 6c  oc..args to refl
0b60: 65 63 74 20 74 68 61 74 20 61 20 73 6f 63 6b 20  ect that a sock 
0b70: 69 73 20 61 6e 20 61 72 67 2c 20 6e 6f 74 20 61  is an arg, not a
0b80: 20 66 69 6c 65 2e 0a 0a 32 30 30 30 2d 30 37 2d   file...2000-07-
0b90: 31 30 20 20 4a 65 66 66 20 48 6f 62 62 73 20 20  10  Jeff Hobbs  
0ba0: 3c 68 6f 62 62 73 40 73 63 72 69 70 74 69 63 73  <hobbs@scriptics
0bb0: 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 42 49 4f  .com>...* tlsBIO
0bc0: 2e 63 20 28 42 69 6f 57 72 69 74 65 2c 20 42 69  .c (BioWrite, Bi
0bd0: 6f 52 65 61 64 29 3a 20 63 68 61 6e 67 65 64 20  oRead): changed 
0be0: 54 63 6c 5f 52 65 61 64 2f 57 72 69 74 65 20 74  Tcl_Read/Write t
0bf0: 6f 0a 09 54 63 6c 5f 52 65 61 64 52 61 77 2f 54  o..Tcl_ReadRaw/T
0c00: 63 6c 57 72 69 74 65 52 61 77 2e 0a 0a 09 2a 20  clWriteRaw....* 
0c10: 74 6c 73 2e 63 3a 20 61 64 64 65 64 20 75 73 65  tls.c: added use
0c20: 20 6f 66 20 54 63 6c 5f 47 65 74 54 6f 70 43 68   of Tcl_GetTopCh
0c30: 61 6e 6e 65 6c 20 61 66 74 65 72 20 54 63 6c 5f  annel after Tcl_
0c40: 47 65 74 43 68 61 6e 6e 65 6c 20 61 6e 64 0a 09  GetChannel and..
0c50: 67 6f 74 20 72 65 74 75 72 6e 20 76 61 6c 75 65  got return value
0c60: 20 66 72 6f 6d 20 54 63 6c 5f 53 74 61 63 6b 43   from Tcl_StackC
0c70: 68 61 6e 6e 65 6c 2e 0a 0a 09 2a 20 74 65 73 74  hannel....* test
0c80: 73 2f 74 6c 73 49 4f 2e 74 65 73 74 3a 20 61 64  s/tlsIO.test: ad
0c90: 64 65 64 20 73 6f 6d 65 20 68 61 6e 64 73 68 61  ded some handsha
0ca0: 6b 69 6e 67 20 74 68 61 74 20 73 68 6f 75 6c 64  king that should
0cb0: 6e 27 74 20 62 65 0a 09 6e 65 63 65 73 73 61 72  n't be..necessar
0cc0: 79 2c 20 62 75 74 20 77 65 20 63 72 61 73 68 20  y, but we crash 
0cd0: 6f 74 68 65 72 77 69 73 65 20 28 6e 65 65 64 73  otherwise (needs
0ce0: 20 6d 6f 72 65 20 74 65 73 74 69 6e 67 29 2e 0a   more testing)..
0cf0: 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 20 61 64 64  ..* tlsIO.c: add
0d00: 65 64 20 73 75 70 70 6f 72 74 20 66 6f 72 20 22  ed support for "
0d10: 63 6f 72 72 65 63 74 65 64 22 20 73 74 61 63 6b  corrected" stack
0d20: 65 64 20 63 68 61 6e 6e 65 6c 73 2e 20 20 41 6c  ed channels.  Al
0d30: 6c 0a 09 74 68 65 20 61 62 6f 76 65 20 63 68 61  l..the above cha
0d40: 6e 6e 65 6c 73 20 61 72 65 20 69 6e 20 54 43 4c  nnels are in TCL
0d50: 5f 43 48 41 4e 4e 45 4c 5f 56 45 52 53 49 4f 4e  _CHANNEL_VERSION
0d60: 5f 32 20 23 69 66 64 65 66 73 2e 0a 0a 32 30 30  _2 #ifdefs...200
0d70: 30 2d 30 36 2d 30 35 20 20 53 63 6f 74 74 20 53  0-06-05  Scott S
0d80: 74 61 6e 74 6f 6e 20 20 3c 73 74 61 6e 74 6f 6e  tanton  <stanton
0d90: 40 61 6a 75 62 61 73 6f 6c 75 74 69 6f 6e 73 2e  @ajubasolutions.
0da0: 63 6f 6d 3e 0a 0a 09 2a 20 4d 61 6b 65 66 69 6c  com>...* Makefil
0db0: 65 2e 69 6e 3a 20 46 69 78 65 64 20 62 72 6f 6b  e.in: Fixed brok
0dc0: 65 6e 20 74 65 73 74 20 74 61 72 67 65 74 2e 0a  en test target..
0dd0: 0a 09 2a 20 74 6c 73 49 6e 74 2e 68 3a 20 0a 09  ..* tlsInt.h: ..
0de0: 2a 20 74 6c 73 2e 63 3a 20 43 6c 65 61 6e 65 64  * tls.c: Cleaned
0df0: 20 75 70 20 64 65 63 6c 61 72 61 74 69 6f 6e 73   up declarations
0e00: 20 6f 66 20 54 6c 73 5f 43 6c 65 61 6e 20 74 6f   of Tls_Clean to
0e10: 20 61 76 6f 69 64 20 65 72 72 6f 72 73 20 6f 6e   avoid errors on
0e20: 0a 09 57 69 6e 64 6f 77 73 20 28 6c 69 6e 74 29  ..Windows (lint)
0e30: 2e 0a 0a 32 30 30 30 2d 30 36 2d 30 35 20 20 42  ...2000-06-05  B
0e40: 72 65 6e 74 20 57 65 6c 63 68 20 3c 77 65 6c 63  rent Welch <welc
0e50: 68 40 61 6a 75 62 61 73 6f 6c 75 74 69 6f 6e 73  h@ajubasolutions
0e60: 2e 63 6f 6d 3e 0a 0a 09 2a 20 74 6c 73 2e 63 2c  .com>...* tls.c,
0e70: 20 74 6c 73 49 4f 2e 63 3a 20 20 53 70 6c 69 74   tlsIO.c:  Split
0e80: 20 54 6c 73 5f 46 72 65 65 20 69 6e 74 6f 20 54   Tls_Free into T
0e90: 6c 73 5f 43 6c 65 61 6e 2c 20 77 68 69 63 68 20  ls_Clean, which 
0ea0: 64 6f 65 73 0a 09 74 68 65 20 53 53 4c 20 63 6c  does..the SSL cl
0eb0: 65 61 6e 75 70 2c 20 61 6e 64 20 74 68 65 20 54  eanup, and the T
0ec0: 63 6c 5f 46 72 65 65 20 63 61 6c 6c 2e 20 20 49  cl_Free call.  I
0ed0: 74 20 69 73 20 69 6d 70 6f 72 74 61 6e 74 20 74  t is important t
0ee0: 6f 20 73 68 75 74 64 6f 77 6e 0a 09 74 68 65 20  o shutdown..the 
0ef0: 53 53 4c 20 73 74 61 74 65 20 22 73 79 6e 63 68  SSL state "synch
0f00: 72 6f 6e 6f 75 73 6c 79 22 20 64 75 72 69 6e 67  ronously" during
0f10: 20 61 20 73 74 61 63 6b 65 64 20 66 6c 75 73 68   a stacked flush
0f20: 2e 0a 0a 32 30 30 30 2d 30 36 2d 30 31 20 20 53  ...2000-06-01  S
0f30: 63 6f 74 74 20 53 74 61 6e 74 6f 6e 20 20 3c 73  cott Stanton  <s
0f40: 74 61 6e 74 6f 6e 40 61 6a 75 62 61 73 6f 6c 75  tanton@ajubasolu
0f50: 74 69 6f 6e 73 2e 63 6f 6d 3e 0a 0a 09 2a 20 74  tions.com>...* t
0f60: 6c 73 49 4f 2e 63 3a 20 52 65 73 74 6f 72 65 64  lsIO.c: Restored
0f70: 20 63 61 6c 6c 20 74 6f 20 54 63 6c 5f 4e 6f 74   call to Tcl_Not
0f80: 69 66 79 43 68 61 6e 6e 65 6c 20 66 72 6f 6d 20  ifyChannel from 
0f90: 43 68 61 6e 6e 65 6c 48 61 6e 64 6c 65 72 0a 09  ChannelHandler..
0fa0: 74 6f 20 65 6e 73 75 72 65 20 74 68 61 74 20 65  to ensure that e
0fb0: 76 65 6e 74 73 20 70 72 6f 70 61 67 61 74 65 20  vents propagate 
0fc0: 66 72 6f 6d 20 74 68 65 20 6c 6f 77 65 72 20 64  from the lower d
0fd0: 72 69 76 65 72 2e 20 20 54 68 69 73 20 6d 61 79  river.  This may
0fe0: 0a 09 72 65 73 75 6c 74 20 69 6e 20 61 6e 20 69  ..result in an i
0ff0: 6e 66 69 6e 69 74 65 20 6c 6f 6f 70 20 69 6e 20  nfinite loop in 
1000: 73 6f 6d 65 20 63 61 73 65 73 2c 20 73 6f 20 74  some cases, so t
1010: 68 69 73 20 69 73 20 6e 6f 74 20 61 20 74 6f 74  his is not a tot
1020: 61 6c 0a 09 66 69 78 2e 20 20 54 68 69 73 20 6d  al..fix.  This m
1030: 61 79 20 62 65 20 73 75 66 66 69 63 69 65 6e 74  ay be sufficient
1040: 20 66 6f 72 20 6e 6f 77 2c 20 68 6f 77 65 76 65   for now, howeve
1050: 72 2e 20 5b 42 75 67 3a 20 35 36 32 33 5d 0a 0a  r. [Bug: 5623]..
1060: 32 30 30 30 2d 30 36 2d 30 31 20 20 53 63 6f 74  2000-06-01  Scot
1070: 74 20 53 74 61 6e 74 6f 6e 20 20 3c 73 74 61 6e  t Stanton  <stan
1080: 74 6f 6e 40 73 63 72 69 70 74 69 63 73 2e 63 6f  ton@scriptics.co
1090: 6d 3e 0a 0a 09 2a 20 74 6c 73 49 4f 2e 63 3a 20  m>...* tlsIO.c: 
10a0: 52 65 73 74 6f 72 65 20 74 68 65 20 70 72 65 76  Restore the prev
10b0: 69 6f 75 73 20 76 65 72 73 69 6f 6e 2e 20 20 46  ious version.  F
10c0: 69 78 65 64 20 74 68 65 20 43 6c 6f 73 65 50 72  ixed the ClosePr
10d0: 6f 63 20 73 6f 0a 09 69 74 20 75 6e 72 65 67 69  oc so..it unregi
10e0: 73 74 65 72 73 20 74 68 65 20 63 68 61 6e 6e 65  sters the channe
10f0: 6c 20 68 61 6e 64 6c 65 72 20 6f 6e 20 74 68 65  l handler on the
1100: 20 73 75 70 65 72 63 65 64 65 64 20 63 68 61 6e   superceded chan
1110: 6e 65 6c 0a 09 69 6e 73 74 65 61 64 20 6f 66 20  nel..instead of 
1120: 74 68 65 20 75 70 70 65 72 20 63 68 61 6e 6e 65  the upper channe
1130: 6c 2e 20 41 6c 73 6f 20 72 65 6d 6f 76 65 64 20  l. Also removed 
1140: 74 68 65 20 63 61 6c 6c 20 74 6f 0a 09 54 63 6c  the call to..Tcl
1150: 5f 4e 6f 74 69 66 79 43 68 61 6e 6e 65 6c 20 69  _NotifyChannel i
1160: 6e 20 74 68 65 20 43 68 61 6e 6e 65 6c 48 61 6e  n the ChannelHan
1170: 64 6c 65 72 20 62 65 63 61 75 73 65 20 74 68 69  dler because thi
1180: 73 20 77 69 6c 6c 20 72 65 73 75 6c 74 0a 09 69  s will result..i
1190: 6e 20 61 6e 20 69 6e 66 69 6e 69 74 65 20 6c 6f  n an infinite lo
11a0: 6f 70 20 69 66 20 64 61 74 61 20 69 73 20 65 76  op if data is ev
11b0: 65 72 20 62 75 66 66 65 72 65 64 20 69 6e 20 74  er buffered in t
11c0: 68 65 20 42 49 4f 0a 09 73 74 72 75 63 74 75 72  he BIO..structur
11d0: 65 2e 20 5b 42 75 67 3a 20 35 36 32 33 5d 0a 0a  e. [Bug: 5623]..
11e0: 32 30 30 30 2d 30 35 2d 33 31 20 20 42 72 65 6e  2000-05-31  Bren
11f0: 74 20 57 65 6c 63 68 20 3c 77 65 6c 63 68 40 73  t Welch <welch@s
1200: 63 72 69 70 74 69 63 73 2e 63 6f 6d 3e 0a 0a 09  criptics.com>...
1210: 2a 20 74 6c 73 2e 63 3a 20 43 68 61 6e 67 65 20  * tls.c: Change 
1220: 74 68 65 20 43 68 61 6e 6e 65 6c 48 61 6e 64 6c  the ChannelHandl
1230: 65 72 20 74 6f 20 62 65 20 72 65 67 69 73 74 65  er to be registe
1240: 72 65 64 20 6f 6e 20 74 68 65 20 6d 61 69 6e 0a  red on the main.
1250: 09 63 68 61 6e 6e 65 6c 20 61 73 20 6f 70 70 73  .channel as opps
1260: 65 64 20 74 6f 20 74 68 65 20 22 70 61 72 65 6e  ed to the "paren
1270: 74 22 2c 20 6f 72 20 73 75 70 65 72 63 65 65 64  t", or superceed
1280: 65 64 2c 20 63 68 61 6e 6e 65 6c 2e 20 20 54 68  ed, channel.  Th
1290: 69 73 0a 09 69 73 20 62 65 63 61 75 73 65 20 74  is..is because t
12a0: 68 65 20 73 6f 63 6b 65 74 20 64 72 69 76 65 72  he socket driver
12b0: 20 6e 6f 74 69 66 69 65 73 20 74 68 65 20 6d 61   notifies the ma
12c0: 69 6e 20 63 68 61 6e 6e 65 6c 2c 20 61 6e 64 20  in channel, and 
12d0: 74 68 65 72 65 0a 09 61 72 65 20 74 69 6d 65 73  there..are times
12e0: 20 77 69 74 68 20 74 68 65 20 6d 61 69 6e 20 63   with the main c
12f0: 68 61 6e 6e 65 6c 20 67 65 74 73 20 63 6c 6f 73  hannel gets clos
1300: 65 64 2c 20 62 75 74 20 74 68 65 20 73 75 70 65  ed, but the supe
1310: 72 63 65 64 65 64 0a 09 6f 6e 65 20 69 73 20 6e  rceded..one is n
1320: 6f 74 20 79 65 74 20 63 6c 6f 73 65 64 2e 20 20  ot yet closed.  
1330: 49 66 20 74 68 65 20 63 68 61 6e 6e 65 6c 20 68  If the channel h
1340: 61 6e 64 6c 65 72 20 67 65 74 73 20 74 72 69 67  andler gets trig
1350: 67 65 72 65 64 20 69 6e 0a 09 74 68 69 73 20 68  gered in..this h
1360: 61 6c 66 2d 6f 70 65 6e 20 73 74 61 74 65 20 69  alf-open state i
1370: 74 20 69 73 20 61 73 73 6f 63 69 61 74 65 64 20  t is associated 
1380: 77 69 74 68 20 74 68 65 20 73 75 70 65 72 63 65  with the superce
1390: 65 64 65 64 0a 09 63 68 61 6e 6e 65 64 6c 2c 20  eded..channedl, 
13a0: 62 75 74 20 75 73 65 73 20 69 74 73 20 70 72 69  but uses its pri
13b0: 76 61 74 65 20 70 6f 69 6e 74 65 72 20 74 6f 20  vate pointer to 
13c0: 74 68 65 20 6d 61 69 6e 20 63 68 61 6e 6e 65 6c  the main channel
13d0: 2c 20 77 68 69 63 68 0a 09 69 73 20 6d 6f 73 74  , which..is most
13e0: 6c 79 20 64 65 73 74 72 6f 79 65 64 2e 20 20 45  ly destroyed.  E
13f0: 6c 69 6d 69 6e 61 74 65 64 20 74 68 65 20 72 65  liminated the re
1400: 64 75 6e 64 61 6e 74 20 63 61 6c 6c 20 74 6f 0a  dundant call to.
1410: 09 54 63 6c 5f 4e 6f 74 69 66 79 43 68 61 6e 6e  .Tcl_NotifyChann
1420: 65 6c 20 66 72 6f 6d 20 54 6c 73 57 61 74 63 68  el from TlsWatch
1430: 50 72 6f 63 2e 20 5b 42 75 67 3a 20 35 36 32 33  Proc. [Bug: 5623
1440: 5d 0a                                            ].