Hex Artifact Content

Artifact bfc624ff8e2b45b9a6cf892cb99972c74a92edab:


0000: 43 6f 70 79 72 69 67 68 74 20 28 43 29 20 31 39  Copyright (C) 19
0010: 39 37 2d 32 30 30 30 20 4d 61 74 74 20 4e 65 77  97-2000 Matt New
0020: 6d 61 6e 20 3c 6d 61 74 74 40 6e 6f 76 61 64 69  man <matt@novadi
0030: 67 6d 2e 63 6f 6d 3e 0a 54 4c 53 20 31 2e 34 2e  gm.com>.TLS 1.4.
0040: 31 20 43 6f 70 79 72 69 67 68 74 20 28 43 29 20  1 Copyright (C) 
0050: 32 30 30 30 20 41 6a 75 62 61 20 53 6f 6c 75 74  2000 Ajuba Solut
0060: 69 6f 6e 73 0a 0a 24 48 65 61 64 65 72 3a 20 2f  ions..$Header: /
0070: 68 6f 6d 65 2f 72 6b 65 65 6e 65 2f 74 6d 70 2f  home/rkeene/tmp/
0080: 63 76 73 32 66 6f 73 73 69 6c 2f 2e 2e 2f 74 63  cvs2fossil/../tc
0090: 6c 74 6c 73 2f 74 6c 73 2f 74 6c 73 2f 52 45 41  ltls/tls/tls/REA
00a0: 44 4d 45 2e 74 78 74 2c 76 20 31 2e 36 20 32 30  DME.txt,v 1.6 20
00b0: 30 34 2f 30 32 2f 31 37 20 32 31 3a 32 37 3a 32  04/02/17 21:27:2
00c0: 30 20 72 61 7a 7a 65 6c 6c 20 45 78 70 20 24 0a  0 razzell Exp $.
00d0: 0a 54 4c 53 20 28 61 6b 61 20 53 53 4c 29 20 43  .TLS (aka SSL) C
00e0: 68 61 6e 6e 65 6c 20 2d 20 63 61 6e 20 62 65 20  hannel - can be 
00f0: 6c 61 79 65 72 65 64 20 6f 6e 20 61 6e 79 20 62  layered on any b
0100: 69 2d 64 69 72 65 63 74 69 6f 6e 61 6c 20 54 63  i-directional Tc
0110: 6c 5f 43 68 61 6e 6e 65 6c 2e 0a 0a 42 6f 74 68  l_Channel...Both
0120: 20 63 6c 69 65 6e 74 20 61 6e 64 20 73 65 72 76   client and serv
0130: 65 72 2d 73 69 64 65 20 73 6f 63 6b 65 74 73 20  er-side sockets 
0140: 61 72 65 20 70 6f 73 73 69 62 6c 65 2c 20 61 6e  are possible, an
0150: 64 20 74 68 69 73 20 63 6f 64 65 20 73 68 6f 75  d this code shou
0160: 6c 64 20 77 6f 72 6b 0a 6f 6e 20 61 6e 79 20 70  ld work.on any p
0170: 6c 61 74 66 6f 72 6d 20 61 73 20 69 74 20 75 73  latform as it us
0180: 65 73 20 61 20 67 65 6e 65 72 69 63 20 6d 65 63  es a generic mec
0190: 68 61 6e 69 73 6d 20 66 6f 72 20 6c 61 79 65 72  hanism for layer
01a0: 69 6e 67 20 6f 6e 20 53 53 4c 20 61 6e 64 20 54  ing on SSL and T
01b0: 63 6c 2e 0a 0a 46 75 6c 6c 20 66 69 6c 65 76 65  cl...Full fileve
01c0: 6e 74 20 73 65 6d 61 74 69 63 73 20 73 68 6f 75  nt sematics shou
01d0: 6c 64 20 61 6c 73 6f 20 62 65 20 69 6e 74 61 63  ld also be intac
01e0: 74 20 2d 20 73 65 65 20 74 65 73 74 73 20 64 69  t - see tests di
01f0: 72 65 63 74 6f 72 79 20 66 6f 72 0a 62 6c 6f 63  rectory for.bloc
0200: 6b 69 6e 67 20 61 6e 64 20 6e 6f 6e 2d 62 6c 6f  king and non-blo
0210: 63 6b 69 6e 67 20 65 78 61 6d 70 6c 65 73 2e 0a  cking examples..
0220: 0a 54 68 65 20 63 75 72 72 65 6e 74 20 72 65 6c  .The current rel
0230: 65 61 73 65 20 69 73 20 54 4c 53 20 31 2e 35 2e  ease is TLS 1.5.
0240: 30 2c 20 77 69 74 68 20 62 69 6e 61 72 69 65 73  0, with binaries
0250: 20 62 75 69 6c 74 20 61 67 61 69 6e 73 74 20 4f   built against O
0260: 70 65 6e 53 53 4c 20 30 2e 39 2e 37 63 2e 0a 46  penSSL 0.9.7c..F
0270: 6f 72 20 62 65 73 74 20 73 65 63 75 72 69 74 79  or best security
0280: 20 61 6e 64 20 66 75 6e 63 74 69 6f 6e 2c 20 61   and function, a
0290: 6c 77 61 79 73 20 63 6f 6d 70 69 6c 65 20 66 72  lways compile fr
02a0: 6f 6d 20 73 6f 75 72 63 65 20 75 73 65 20 74 68  om source use th
02b0: 65 20 6c 61 74 65 73 74 0a 6f 66 66 69 63 69 61  e latest.officia
02c0: 6c 20 72 65 6c 65 61 73 65 20 6f 66 20 4f 70 65  l release of Ope
02d0: 6e 53 53 4c 2e 0a 0a 54 68 65 20 54 4c 53 20 31  nSSL...The TLS 1
02e0: 2e 34 20 72 65 6c 65 61 73 65 20 72 65 71 75 69  .4 release requi
02f0: 72 65 73 20 54 63 6c 20 38 2e 32 2e 30 2b 2c 20  res Tcl 8.2.0+, 
0300: 77 69 74 68 20 38 2e 33 2e 32 2b 20 70 72 65 66  with 8.3.2+ pref
0310: 65 72 72 65 64 2e 20 20 54 68 65 0a 73 74 61 63  erred.  The.stac
0320: 6b 65 64 20 63 68 61 6e 6e 65 6c 20 69 6d 70 6c  ked channel impl
0330: 65 6d 65 6e 74 61 74 69 6f 6e 20 69 6e 20 54 63  ementation in Tc
0340: 6c 20 77 61 73 20 6f 72 69 67 69 6e 61 6c 6c 79  l was originally
0350: 20 69 6e 74 72 6f 64 75 63 65 64 20 69 6e 20 38   introduced in 8
0360: 2e 32 2e 30 0a 28 70 72 65 76 69 6f 75 73 6c 79  .2.0.(previously
0370: 20 74 68 65 20 54 72 66 20 70 61 74 63 68 29 20   the Trf patch) 
0380: 61 6e 64 20 72 65 77 72 69 74 74 65 6e 20 66 6f  and rewritten fo
0390: 72 20 38 2e 33 2e 32 2b 20 64 75 65 20 74 6f 20  r 8.3.2+ due to 
03a0: 69 6e 68 65 72 65 6e 74 0a 6c 69 6d 69 74 61 74  inherent.limitat
03b0: 69 6f 6e 73 20 69 6e 20 74 68 65 20 65 61 72 6c  ions in the earl
03c0: 69 65 72 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69  ier implementati
03d0: 6f 6e 2e 20 20 54 4c 53 20 31 2e 34 20 73 68 6f  on.  TLS 1.4 sho
03e0: 75 6c 64 20 63 6f 6d 70 69 6c 65 20 77 69 74 68  uld compile with
03f0: 0a 61 6e 79 20 73 74 75 62 73 2d 63 61 70 61 62  .any stubs-capab
0400: 6c 65 20 54 63 6c 20 69 6e 74 65 72 70 72 65 74  le Tcl interpret
0410: 65 72 2c 20 62 75 74 20 77 69 6c 6c 20 72 65 71  er, but will req
0420: 75 69 72 65 20 38 2e 32 2b 20 77 68 65 6e 20 6c  uire 8.2+ when l
0430: 6f 61 64 65 64 2e 0a 54 68 65 72 65 20 61 72 65  oaded..There are
0440: 20 6b 6e 6f 77 6e 20 6c 69 6d 69 74 61 74 69 6f   known limitatio
0450: 6e 73 20 69 6e 20 74 68 65 20 38 2e 32 2e 30 2d  ns in the 8.2.0-
0460: 38 2e 33 2e 31 20 73 74 61 63 6b 65 64 20 63 68  8.3.1 stacked ch
0470: 61 6e 6e 65 6c 0a 69 6d 70 6c 65 6d 65 6e 74 61  annel.implementa
0480: 74 69 6f 6e 2c 20 73 6f 20 69 74 20 69 73 20 65  tion, so it is e
0490: 6e 63 6f 75 72 61 67 65 64 20 74 68 61 74 20 70  ncouraged that p
04a0: 65 6f 70 6c 65 20 75 73 65 20 54 4c 53 20 31 2e  eople use TLS 1.
04b0: 34 2b 20 77 69 74 68 20 61 6e 0a 38 2e 33 2e 32  4+ with an.8.3.2
04c0: 2b 20 54 63 6c 20 69 6e 74 65 72 70 72 65 74 65  + Tcl interprete
04d0: 72 2e 20 20 54 68 65 73 65 20 6d 6f 64 69 66 69  r.  These modifi
04e0: 63 61 74 69 6f 6e 73 20 61 72 65 20 62 79 20 4a  cations are by J
04f0: 65 66 66 20 48 6f 62 62 73 0a 3c 6a 65 66 66 40  eff Hobbs.<jeff@
0500: 68 6f 62 62 73 2e 6f 72 67 3e 2e 0a 0a 41 64 64  hobbs.org>...Add
0510: 69 74 69 6f 6e 20 63 72 65 64 69 74 20 69 73 20  ition credit is 
0520: 64 75 65 20 66 6f 72 20 41 6e 64 72 65 61 73 20  due for Andreas 
0530: 4b 75 70 72 69 65 73 20 28 61 2e 6b 75 70 72 69  Kupries (a.kupri
0540: 65 73 40 77 65 73 74 65 6e 64 2e 63 6f 6d 29 2c  es@westend.com),
0550: 20 66 6f 72 0a 70 72 6f 76 69 64 69 6e 67 20 74   for.providing t
0560: 68 65 20 54 63 6c 5f 52 65 70 6c 61 63 65 43 68  he Tcl_ReplaceCh
0570: 61 6e 6e 65 6c 20 6d 65 63 68 61 6e 69 73 6d 20  annel mechanism 
0580: 61 6e 64 20 77 6f 72 6b 69 6e 67 20 63 6c 6f 73  and working clos
0590: 65 6c 79 20 77 69 74 68 20 6d 65 0a 74 6f 20 65  ely with me.to e
05a0: 6e 68 61 6e 63 65 20 69 74 20 74 6f 20 73 75 70  nhance it to sup
05b0: 70 6f 72 74 20 66 75 6c 6c 20 66 69 6c 65 65 76  port full fileev
05c0: 65 6e 74 20 73 65 6d 61 6e 74 69 63 73 2e 0a 0a  ent semantics...
05d0: 41 6c 73 6f 20 77 6f 72 6b 20 64 6f 6e 65 20 62  Also work done b
05e0: 79 20 74 68 65 20 66 6f 6c 6c 6f 77 20 70 65 6f  y the follow peo
05f0: 70 6c 65 20 70 72 6f 76 69 64 65 64 20 74 68 65  ple provided the
0600: 20 69 6d 70 65 74 75 73 20 74 6f 20 64 6f 20 74   impetus to do t
0610: 68 69 73 20 22 72 69 67 68 74 22 3a 2d 0a 74 63  his "right":-.tc
0620: 6c 53 53 4c 20 28 43 6f 6c 69 6e 20 4d 63 43 6f  lSSL (Colin McCo
0630: 72 6d 61 63 6b 2c 20 53 68 61 72 65 64 20 54 65  rmack, Shared Te
0640: 63 68 6e 6f 6c 6f 67 79 29 0a 53 53 4c 74 63 6c  chnology).SSLtcl
0650: 20 28 50 65 74 65 72 20 41 6e 74 6d 61 6e 29 0a   (Peter Antman).
0660: 0a 54 68 69 73 20 63 6f 64 65 20 69 73 20 6c 69  .This code is li
0670: 63 65 6e 73 65 64 20 75 6e 64 65 72 20 74 68 65  censed under the
0680: 20 73 61 6d 65 20 74 65 72 6d 73 20 61 73 20 74   same terms as t
0690: 68 65 20 54 63 6c 20 43 6f 72 65 2e 0a 0a 49 20  he Tcl Core...I 
06a0: 77 6f 75 6c 64 20 61 6c 73 6f 20 6c 69 6b 65 20  would also like 
06b0: 74 6f 20 61 63 6b 6e 6f 77 6c 65 64 67 65 20 74  to acknowledge t
06c0: 68 65 20 69 6e 70 75 74 20 6f 66 20 4d 61 72 73  he input of Mars
06d0: 68 61 6c 6c 20 52 6f 73 65 2c 20 77 68 6f 20 63  hall Rose, who c
06e0: 6f 6e 76 69 6e 63 65 64 20 0a 6d 65 20 74 68 61  onvinced .me tha
06f0: 74 20 70 65 6f 70 6c 65 20 6e 65 65 64 20 74 6f  t people need to
0700: 20 62 65 20 61 62 6c 65 20 74 6f 20 73 77 69 74   be able to swit
0710: 63 68 2d 74 6f 2d 65 6e 63 72 79 70 74 65 64 20  ch-to-encrypted 
0720: 6d 6f 64 65 20 70 61 72 74 20 77 61 79 0a 74 68  mode part way.th
0730: 72 6f 75 67 68 20 61 20 63 6f 6e 76 65 72 73 61  rough a conversa
0740: 74 69 6f 6e 2e 0a 0a 41 6c 73 6f 20 49 20 77 6f  tion...Also I wo
0750: 75 6c 64 20 6c 69 6b 65 20 74 6f 20 61 63 6b 6e  uld like to ackn
0760: 6f 77 6c 65 64 67 65 20 74 68 65 20 6b 69 6e 64  owledge the kind
0770: 20 73 75 70 70 6f 72 74 20 6f 66 20 4e 6f 76 61   support of Nova
0780: 64 69 67 6d 20 49 6e 63 2c 20 6d 79 0a 63 75 72  digm Inc, my.cur
0790: 72 65 6e 74 20 65 6d 70 6c 6f 79 65 72 2c 20 77  rent employer, w
07a0: 68 69 63 68 20 6d 61 64 65 20 74 68 69 73 20 70  hich made this p
07b0: 6f 73 73 69 62 6c 65 2e 0a 0a 0a 4d 61 74 74 20  ossible....Matt 
07c0: 4e 65 77 6d 61 6e 20 0a                          Newman .