Artifact
98035f2af2aed1324212b3748cc7efeb012532a2:
0000: 4f 72 69 67 69 6e 61 6c 20 54 4c 53 20 43 6f 70 Original TLS Cop
0010: 79 72 69 67 68 74 20 28 43 29 20 31 39 39 37 2d yright (C) 1997-
0020: 32 30 30 30 20 4d 61 74 74 20 4e 65 77 6d 61 6e 2000 Matt Newman
0030: 20 3c 6d 61 74 74 40 6e 6f 76 61 64 69 67 6d 2e <matt@novadigm.
0040: 63 6f 6d 3e 0a 54 4c 53 20 31 2e 34 2e 31 20 20 com>.TLS 1.4.1
0050: 20 20 43 6f 70 79 72 69 67 68 74 20 28 43 29 20 Copyright (C)
0060: 32 30 30 30 20 41 6a 75 62 61 20 53 6f 6c 75 74 2000 Ajuba Solut
0070: 69 6f 6e 73 0a 54 4c 53 20 31 2e 36 20 20 20 20 ions.TLS 1.6
0080: 20 20 43 6f 70 79 72 69 67 68 74 20 28 43 29 20 Copyright (C)
0090: 32 30 30 38 20 41 63 74 69 76 65 53 74 61 74 65 2008 ActiveState
00a0: 20 53 6f 66 74 77 61 72 65 20 49 6e 63 2e 0a 0a Software Inc...
00b0: 54 4c 53 20 28 61 6b 61 20 53 53 4c 29 20 43 68 TLS (aka SSL) Ch
00c0: 61 6e 6e 65 6c 20 2d 20 63 61 6e 20 62 65 20 6c annel - can be l
00d0: 61 79 65 72 65 64 20 6f 6e 20 61 6e 79 20 62 69 ayered on any bi
00e0: 2d 64 69 72 65 63 74 69 6f 6e 61 6c 20 54 63 6c -directional Tcl
00f0: 5f 43 68 61 6e 6e 65 6c 2e 0a 0a 42 6f 74 68 20 _Channel...Both
0100: 63 6c 69 65 6e 74 20 61 6e 64 20 73 65 72 76 65 client and serve
0110: 72 2d 73 69 64 65 20 73 6f 63 6b 65 74 73 20 61 r-side sockets a
0120: 72 65 20 70 6f 73 73 69 62 6c 65 2c 20 61 6e 64 re possible, and
0130: 20 74 68 69 73 20 63 6f 64 65 20 73 68 6f 75 6c this code shoul
0140: 64 20 77 6f 72 6b 0a 6f 6e 20 61 6e 79 20 70 6c d work.on any pl
0150: 61 74 66 6f 72 6d 20 61 73 20 69 74 20 75 73 65 atform as it use
0160: 73 20 61 20 67 65 6e 65 72 69 63 20 6d 65 63 68 s a generic mech
0170: 61 6e 69 73 6d 20 66 6f 72 20 6c 61 79 65 72 69 anism for layeri
0180: 6e 67 20 6f 6e 20 53 53 4c 20 61 6e 64 20 54 63 ng on SSL and Tc
0190: 6c 2e 0a 0a 46 75 6c 6c 20 66 69 6c 65 76 65 6e l...Full fileven
01a0: 74 20 73 65 6d 61 74 69 63 73 20 73 68 6f 75 6c t sematics shoul
01b0: 64 20 61 6c 73 6f 20 62 65 20 69 6e 74 61 63 74 d also be intact
01c0: 20 2d 20 73 65 65 20 74 65 73 74 73 20 64 69 72 - see tests dir
01d0: 65 63 74 6f 72 79 20 66 6f 72 0a 62 6c 6f 63 6b ectory for.block
01e0: 69 6e 67 20 61 6e 64 20 6e 6f 6e 2d 62 6c 6f 63 ing and non-bloc
01f0: 6b 69 6e 67 20 65 78 61 6d 70 6c 65 73 2e 0a 0a king examples...
0200: 54 68 65 20 63 75 72 72 65 6e 74 20 72 65 6c 65 The current rele
0210: 61 73 65 20 69 73 20 54 4c 53 20 31 2e 36 2c 20 ase is TLS 1.6,
0220: 77 69 74 68 20 62 69 6e 61 72 69 65 73 20 62 75 with binaries bu
0230: 69 6c 74 20 61 67 61 69 6e 73 74 20 4f 70 65 6e ilt against Open
0240: 53 53 4c 20 30 2e 39 2e 38 67 2e 0a 46 6f 72 20 SSL 0.9.8g..For
0250: 62 65 73 74 20 73 65 63 75 72 69 74 79 20 61 6e best security an
0260: 64 20 66 75 6e 63 74 69 6f 6e 2c 20 61 6c 77 61 d function, alwa
0270: 79 73 20 63 6f 6d 70 69 6c 65 20 66 72 6f 6d 20 ys compile from
0280: 73 6f 75 72 63 65 20 77 69 74 68 20 74 68 65 20 source with the
0290: 6c 61 74 65 73 74 0a 6f 66 66 69 63 69 61 6c 20 latest.official
02a0: 72 65 6c 65 61 73 65 20 6f 66 20 4f 70 65 6e 53 release of OpenS
02b0: 53 4c 20 28 68 74 74 70 3a 2f 2f 77 77 77 2e 6f SL (http://www.o
02c0: 70 65 6e 73 73 6c 2e 6f 72 67 2f 29 2e 0a 0a 54 penssl.org/)...T
02d0: 4c 53 20 72 65 71 75 69 72 65 73 20 54 63 6c 20 LS requires Tcl
02e0: 38 2e 32 2e 30 2b 2c 20 77 69 74 68 20 38 2e 33 8.2.0+, with 8.3
02f0: 2e 32 2b 20 70 72 65 66 65 72 72 65 64 2e 20 20 .2+ preferred.
0300: 54 68 65 20 73 74 61 63 6b 65 64 20 63 68 61 6e The stacked chan
0310: 6e 65 6c 0a 69 6d 70 6c 65 6d 65 6e 74 61 74 69 nel.implementati
0320: 6f 6e 20 69 6e 20 54 63 6c 20 77 61 73 20 6f 72 on in Tcl was or
0330: 69 67 69 6e 61 6c 6c 79 20 69 6e 74 72 6f 64 75 iginally introdu
0340: 63 65 64 20 69 6e 20 38 2e 32 2e 30 20 28 70 72 ced in 8.2.0 (pr
0350: 65 76 69 6f 75 73 6c 79 20 74 68 65 0a 54 72 66 eviously the.Trf
0360: 20 70 61 74 63 68 29 20 61 6e 64 20 72 65 77 72 patch) and rewr
0370: 69 74 74 65 6e 20 66 6f 72 20 38 2e 33 2e 32 2b itten for 8.3.2+
0380: 20 64 75 65 20 74 6f 20 69 6e 68 65 72 65 6e 74 due to inherent
0390: 20 6c 69 6d 69 74 61 74 69 6f 6e 73 20 69 6e 20 limitations in
03a0: 74 68 65 0a 65 61 72 6c 69 65 72 20 69 6d 70 6c the.earlier impl
03b0: 65 6d 65 6e 74 61 74 69 6f 6e 2e 20 20 54 4c 53 ementation. TLS
03c0: 20 73 68 6f 75 6c 64 20 63 6f 6d 70 69 6c 65 20 should compile
03d0: 77 69 74 68 20 61 6e 79 20 73 74 75 62 73 2d 63 with any stubs-c
03e0: 61 70 61 62 6c 65 20 54 63 6c 0a 69 6e 74 65 72 apable Tcl.inter
03f0: 70 72 65 74 65 72 2c 20 62 75 74 20 77 69 6c 6c preter, but will
0400: 20 72 65 71 75 69 72 65 20 38 2e 32 2b 20 77 68 require 8.2+ wh
0410: 65 6e 20 6c 6f 61 64 65 64 2e 20 20 54 68 65 72 en loaded. Ther
0420: 65 20 61 72 65 20 6b 6e 6f 77 6e 0a 6c 69 6d 69 e are known.limi
0430: 74 61 74 69 6f 6e 73 20 69 6e 20 74 68 65 20 38 tations in the 8
0440: 2e 32 2e 30 2d 38 2e 33 2e 31 20 73 74 61 63 6b .2.0-8.3.1 stack
0450: 65 64 20 63 68 61 6e 6e 65 6c 20 69 6d 70 6c 65 ed channel imple
0460: 6d 65 6e 74 61 74 69 6f 6e 2c 20 73 6f 20 69 74 mentation, so it
0470: 20 69 73 0a 65 6e 63 6f 75 72 61 67 65 64 20 74 is.encouraged t
0480: 68 61 74 20 70 65 6f 70 6c 65 20 75 73 65 20 54 hat people use T
0490: 4c 53 20 77 69 74 68 20 61 6e 20 38 2e 33 2e 32 LS with an 8.3.2
04a0: 2b 20 54 63 6c 20 69 6e 74 65 72 70 72 65 74 65 + Tcl interprete
04b0: 72 2e 20 20 54 68 65 73 65 0a 6d 6f 64 69 66 69 r. These.modifi
04c0: 63 61 74 69 6f 6e 73 20 61 72 65 20 62 79 20 4a cations are by J
04d0: 65 66 66 20 48 6f 62 62 73 2e 0a 0a 4e 6f 6e 2d eff Hobbs...Non-
04e0: 65 78 63 6c 75 73 69 76 65 20 63 72 65 64 69 74 exclusive credit
04f0: 73 20 66 6f 72 20 54 4c 53 20 61 72 65 3a 0a 20 s for TLS are:.
0500: 20 20 4f 72 69 67 69 6e 61 6c 20 77 6f 72 6b 3a Original work:
0510: 20 4d 61 74 74 20 4e 65 77 6d 61 6e 20 40 20 4e Matt Newman @ N
0520: 6f 76 61 64 69 67 6d 0a 20 20 20 55 70 64 61 74 ovadigm. Updat
0530: 65 73 3a 20 4a 65 66 66 20 48 6f 62 62 73 20 40 es: Jeff Hobbs @
0540: 20 41 63 74 69 76 65 53 74 61 74 65 0a 20 20 20 ActiveState.
0550: 54 63 6c 20 43 68 61 6e 6e 65 6c 20 6d 65 63 68 Tcl Channel mech
0560: 61 6e 69 73 6d 3a 20 41 6e 64 72 65 61 73 20 4b anism: Andreas K
0570: 75 70 72 69 65 73 0a 20 20 20 49 6d 70 65 74 75 upries. Impetu
0580: 73 2f 52 65 6c 61 74 65 64 20 77 6f 72 6b 3a 20 s/Related work:
0590: 74 63 6c 53 53 4c 20 28 43 6f 6c 69 6e 20 4d 63 tclSSL (Colin Mc
05a0: 43 6f 72 6d 61 63 6b 2c 20 53 68 61 72 65 64 20 Cormack, Shared
05b0: 54 65 63 68 6e 6f 6c 6f 67 79 29 0a 20 20 20 20 Technology).
05c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
05d0: 20 20 20 20 20 53 53 4c 74 63 6c 20 28 50 65 74 SSLtcl (Pet
05e0: 65 72 20 41 6e 74 6d 61 6e 29 0a 0a 54 68 69 73 er Antman)..This
05f0: 20 63 6f 64 65 20 69 73 20 6c 69 63 65 6e 73 65 code is license
0600: 64 20 75 6e 64 65 72 20 74 68 65 20 73 61 6d 65 d under the same
0610: 20 74 65 72 6d 73 20 61 73 20 74 68 65 20 54 63 terms as the Tc
0620: 6c 20 43 6f 72 65 2e 0a l Core..