Artifact
820e5e601e1d4a010bbcea0247f0ad73a678615c:
0000: 23 20 43 6f 6d 6d 61 6e 64 73 20 63 6f 76 65 72 # Commands cover
0010: 65 64 3a 20 20 74 6c 73 3a 3a 63 69 70 68 65 72 ed: tls::cipher
0020: 73 0a 23 0a 23 20 54 68 69 73 20 66 69 6c 65 20 s.#.# This file
0030: 63 6f 6e 74 61 69 6e 73 20 61 20 63 6f 6c 6c 65 contains a colle
0040: 63 74 69 6f 6e 20 6f 66 20 74 65 73 74 73 20 66 ction of tests f
0050: 6f 72 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 6f or one or more o
0060: 66 20 74 68 65 20 54 63 6c 0a 23 20 62 75 69 6c f the Tcl.# buil
0070: 74 2d 69 6e 20 63 6f 6d 6d 61 6e 64 73 2e 20 20 t-in commands.
0080: 53 6f 75 72 63 69 6e 67 20 74 68 69 73 20 66 69 Sourcing this fi
0090: 6c 65 20 69 6e 74 6f 20 54 63 6c 20 72 75 6e 73 le into Tcl runs
00a0: 20 74 68 65 20 74 65 73 74 73 20 61 6e 64 0a 23 the tests and.#
00b0: 20 67 65 6e 65 72 61 74 65 73 20 6f 75 74 70 75 generates outpu
00c0: 74 20 66 6f 72 20 65 72 72 6f 72 73 2e 20 20 4e t for errors. N
00d0: 6f 20 6f 75 74 70 75 74 20 6d 65 61 6e 73 20 6e o output means n
00e0: 6f 20 65 72 72 6f 72 73 20 77 65 72 65 20 66 6f o errors were fo
00f0: 75 6e 64 2e 0a 23 0a 0a 23 20 41 6c 6c 20 72 69 und..#..# All ri
0100: 67 68 74 73 20 72 65 73 65 72 76 65 64 2e 0a 23 ghts reserved..#
0110: 0a 23 20 53 65 65 20 74 68 65 20 66 69 6c 65 20 .# See the file
0120: 22 6c 69 63 65 6e 73 65 2e 74 65 72 6d 73 22 20 "license.terms"
0130: 66 6f 72 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 for information
0140: 6f 6e 20 75 73 61 67 65 20 61 6e 64 20 72 65 64 on usage and red
0150: 69 73 74 72 69 62 75 74 69 6f 6e 0a 23 20 6f 66 istribution.# of
0160: 20 74 68 69 73 20 66 69 6c 65 2c 20 61 6e 64 20 this file, and
0170: 66 6f 72 20 61 20 44 49 53 43 4c 41 49 4d 45 52 for a DISCLAIMER
0180: 20 4f 46 20 41 4c 4c 20 57 41 52 52 41 4e 54 49 OF ALL WARRANTI
0190: 45 53 2e 0a 23 0a 0a 69 66 20 7b 5b 6c 73 65 61 ES..#..if {[lsea
01a0: 72 63 68 20 5b 6e 61 6d 65 73 70 61 63 65 20 63 rch [namespace c
01b0: 68 69 6c 64 72 65 6e 5d 20 3a 3a 74 63 6c 74 65 hildren] ::tclte
01c0: 73 74 5d 20 3d 3d 20 2d 31 7d 20 7b 0a 20 20 20 st] == -1} {.
01d0: 20 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 package require
01e0: 20 74 63 6c 74 65 73 74 0a 20 20 20 20 6e 61 6d tcltest. nam
01f0: 65 73 70 61 63 65 20 69 6d 70 6f 72 74 20 3a 3a espace import ::
0200: 74 63 6c 74 65 73 74 3a 3a 2a 0a 7d 0a 0a 70 61 tcltest::*.}..pa
0210: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 74 6c ckage require tl
0220: 73 0a 0a 23 20 54 68 69 73 20 76 65 72 73 69 6f s..# This versio
0230: 6e 20 6f 66 20 74 68 65 20 74 65 73 74 20 69 73 n of the test is
0240: 20 63 6f 72 72 65 63 74 20 66 6f 72 20 52 53 41 correct for RSA
0250: 20 42 53 41 46 45 20 53 53 4c 2d 43 20 6f 6e 6c BSAFE SSL-C onl
0260: 79 2e 0a 23 20 41 6e 20 65 71 75 69 76 61 6c 65 y..# An equivale
0270: 6e 74 20 74 65 73 74 20 66 6f 72 20 74 68 65 20 nt test for the
0280: 4f 70 65 6e 53 53 4c 20 76 65 72 73 69 6f 6e 20 OpenSSL version
0290: 69 73 20 6c 61 74 65 72 20 69 6e 20 74 68 69 73 is later in this
02a0: 20 66 69 6c 65 2e 0a 0a 74 65 73 74 20 63 69 70 file...test cip
02b0: 68 65 72 73 2d 31 2e 31 20 7b 54 6c 73 3a 3a 63 hers-1.1 {Tls::c
02c0: 69 70 68 65 72 73 20 66 6f 72 20 73 73 6c 33 2e iphers for ssl3.
02d0: 7d 20 7b 7d 20 7b 0a 20 20 20 20 73 65 74 20 72 } {} {. set r
02e0: 65 73 75 6c 74 20 5b 6a 6f 69 6e 20 5b 65 76 61 esult [join [eva
02f0: 6c 20 74 6c 73 3a 3a 63 69 70 68 65 72 73 20 73 l tls::ciphers s
0300: 73 6c 33 5d 20 5c 6e 20 5d 0a 7d 20 7b 45 44 48 sl3] \n ].} {EDH
0310: 2d 44 53 53 2d 52 43 34 2d 53 48 41 0a 45 44 48 -DSS-RC4-SHA.EDH
0320: 2d 52 53 41 2d 44 45 53 2d 43 42 43 33 2d 53 48 -RSA-DES-CBC3-SH
0330: 41 0a 45 44 48 2d 44 53 53 2d 44 45 53 2d 43 42 A.EDH-DSS-DES-CB
0340: 43 33 2d 53 48 41 0a 44 45 53 2d 43 42 43 33 2d C3-SHA.DES-CBC3-
0350: 53 48 41 0a 52 43 34 2d 53 48 41 0a 52 43 34 2d SHA.RC4-SHA.RC4-
0360: 4d 44 35 0a 45 44 48 2d 52 53 41 2d 44 45 53 2d MD5.EDH-RSA-DES-
0370: 43 42 43 2d 53 48 41 0a 45 44 48 2d 44 53 53 2d CBC-SHA.EDH-DSS-
0380: 44 45 53 2d 43 42 43 2d 53 48 41 0a 44 45 53 2d DES-CBC-SHA.DES-
0390: 43 42 43 2d 53 48 41 0a 45 58 50 2d 45 44 48 2d CBC-SHA.EXP-EDH-
03a0: 44 53 53 2d 44 45 53 2d 35 36 2d 53 48 41 0a 45 DSS-DES-56-SHA.E
03b0: 58 50 2d 45 44 48 2d 44 53 53 2d 52 43 34 2d 35 XP-EDH-DSS-RC4-5
03c0: 36 2d 53 48 41 0a 45 58 50 2d 44 45 53 2d 35 36 6-SHA.EXP-DES-56
03d0: 2d 53 48 41 0a 45 58 50 2d 52 43 34 2d 35 36 2d -SHA.EXP-RC4-56-
03e0: 53 48 41 0a 45 58 50 2d 45 44 48 2d 52 53 41 2d SHA.EXP-EDH-RSA-
03f0: 44 45 53 2d 43 42 43 2d 53 48 41 0a 45 58 50 2d DES-CBC-SHA.EXP-
0400: 45 44 48 2d 44 53 53 2d 44 45 53 2d 43 42 43 2d EDH-DSS-DES-CBC-
0410: 53 48 41 0a 45 58 50 2d 44 45 53 2d 43 42 43 2d SHA.EXP-DES-CBC-
0420: 53 48 41 0a 45 58 50 2d 52 43 32 2d 43 42 43 2d SHA.EXP-RC2-CBC-
0430: 4d 44 35 0a 45 58 50 2d 52 43 34 2d 4d 44 35 7d MD5.EXP-RC4-MD5}
0440: 0a 0a 23 20 54 68 69 73 20 76 65 72 73 69 6f 6e ..# This version
0450: 20 6f 66 20 74 68 65 20 74 65 73 74 20 69 73 20 of the test is
0460: 63 6f 72 72 65 63 74 20 66 6f 72 20 52 53 41 20 correct for RSA
0470: 42 53 41 46 45 20 53 53 4c 2d 43 20 6f 6e 6c 79 BSAFE SSL-C only
0480: 2e 0a 23 20 41 6e 20 65 71 75 69 76 61 6c 65 6e ..# An equivalen
0490: 74 20 74 65 73 74 20 66 6f 72 20 74 68 65 20 4f t test for the O
04a0: 70 65 6e 53 53 4c 20 76 65 72 73 69 6f 6e 20 69 penSSL version i
04b0: 73 20 6c 61 74 65 72 20 69 6e 20 74 68 69 73 20 s later in this
04c0: 66 69 6c 65 2e 0a 0a 74 65 73 74 20 63 69 70 68 file...test ciph
04d0: 65 72 73 2d 31 2e 32 20 7b 54 6c 73 3a 3a 63 69 ers-1.2 {Tls::ci
04e0: 70 68 65 72 73 20 66 6f 72 20 74 6c 73 31 2e 7d phers for tls1.}
04f0: 20 7b 0a 20 20 20 20 73 65 74 20 72 65 73 75 6c {. set resul
0500: 74 20 5b 6a 6f 69 6e 20 5b 65 76 61 6c 20 74 6c t [join [eval tl
0510: 73 3a 3a 63 69 70 68 65 72 73 20 74 6c 73 31 5d s::ciphers tls1]
0520: 20 5c 6e 20 5d 0a 7d 20 7b 45 44 48 2d 44 53 53 \n ].} {EDH-DSS
0530: 2d 52 43 34 2d 53 48 41 0a 45 44 48 2d 52 53 41 -RC4-SHA.EDH-RSA
0540: 2d 44 45 53 2d 43 42 43 33 2d 53 48 41 0a 45 44 -DES-CBC3-SHA.ED
0550: 48 2d 44 53 53 2d 44 45 53 2d 43 42 43 33 2d 53 H-DSS-DES-CBC3-S
0560: 48 41 0a 44 45 53 2d 43 42 43 33 2d 53 48 41 0a HA.DES-CBC3-SHA.
0570: 52 43 34 2d 53 48 41 0a 52 43 34 2d 4d 44 35 0a RC4-SHA.RC4-MD5.
0580: 45 44 48 2d 52 53 41 2d 44 45 53 2d 43 42 43 2d EDH-RSA-DES-CBC-
0590: 53 48 41 0a 45 44 48 2d 44 53 53 2d 44 45 53 2d SHA.EDH-DSS-DES-
05a0: 43 42 43 2d 53 48 41 0a 44 45 53 2d 43 42 43 2d CBC-SHA.DES-CBC-
05b0: 53 48 41 0a 45 58 50 2d 45 44 48 2d 44 53 53 2d SHA.EXP-EDH-DSS-
05c0: 44 45 53 2d 35 36 2d 53 48 41 0a 45 58 50 2d 45 DES-56-SHA.EXP-E
05d0: 44 48 2d 44 53 53 2d 52 43 34 2d 35 36 2d 53 48 DH-DSS-RC4-56-SH
05e0: 41 0a 45 58 50 2d 44 45 53 2d 35 36 2d 53 48 41 A.EXP-DES-56-SHA
05f0: 0a 45 58 50 2d 52 43 34 2d 35 36 2d 53 48 41 0a .EXP-RC4-56-SHA.
0600: 45 58 50 2d 45 44 48 2d 52 53 41 2d 44 45 53 2d EXP-EDH-RSA-DES-
0610: 43 42 43 2d 53 48 41 0a 45 58 50 2d 45 44 48 2d CBC-SHA.EXP-EDH-
0620: 44 53 53 2d 44 45 53 2d 43 42 43 2d 53 48 41 0a DSS-DES-CBC-SHA.
0630: 45 58 50 2d 44 45 53 2d 43 42 43 2d 53 48 41 0a EXP-DES-CBC-SHA.
0640: 45 58 50 2d 52 43 32 2d 43 42 43 2d 4d 44 35 0a EXP-RC2-CBC-MD5.
0650: 45 58 50 2d 52 43 34 2d 4d 44 35 7d 0a 0a 23 20 EXP-RC4-MD5}..#
0660: 54 68 69 73 20 76 65 72 73 69 6f 6e 20 6f 66 20 This version of
0670: 74 68 65 20 74 65 73 74 20 69 73 20 63 6f 72 72 the test is corr
0680: 65 63 74 20 66 6f 72 20 4f 70 65 6e 53 53 4c 20 ect for OpenSSL
0690: 6f 6e 6c 79 2e 0a 23 20 41 6e 20 65 71 75 69 76 only..# An equiv
06a0: 61 6c 65 6e 74 20 74 65 73 74 20 66 6f 72 20 74 alent test for t
06b0: 68 65 20 52 53 41 20 42 53 41 46 45 20 53 53 4c he RSA BSAFE SSL
06c0: 2d 43 20 69 73 20 65 61 72 6c 69 65 72 20 69 6e -C is earlier in
06d0: 20 74 68 69 73 20 66 69 6c 65 2e 0a 0a 74 65 73 this file...tes
06e0: 74 20 63 69 70 68 65 72 73 2d 31 2e 33 20 7b 54 t ciphers-1.3 {T
06f0: 6c 73 3a 3a 63 69 70 68 65 72 73 20 66 6f 72 20 ls::ciphers for
0700: 73 73 6c 33 2e 7d 20 7b 4f 70 65 6e 53 53 4c 7d ssl3.} {OpenSSL}
0710: 20 7b 0a 20 20 20 20 73 65 74 20 72 65 73 75 6c {. set resul
0720: 74 20 5b 6a 6f 69 6e 20 5b 65 76 61 6c 20 74 6c t [join [eval tl
0730: 73 3a 3a 63 69 70 68 65 72 73 20 73 73 6c 33 5d s::ciphers ssl3]
0740: 20 5c 6e 20 5d 0a 7d 20 7b 45 44 48 2d 52 53 41 \n ].} {EDH-RSA
0750: 2d 44 45 53 2d 43 42 43 33 2d 53 48 41 0a 45 44 -DES-CBC3-SHA.ED
0760: 48 2d 44 53 53 2d 44 45 53 2d 43 42 43 33 2d 53 H-DSS-DES-CBC3-S
0770: 48 41 0a 44 45 53 2d 43 42 43 33 2d 53 48 41 0a HA.DES-CBC3-SHA.
0780: 52 43 34 2d 53 48 41 0a 52 43 34 2d 4d 44 35 0a RC4-SHA.RC4-MD5.
0790: 45 44 48 2d 52 53 41 2d 44 45 53 2d 43 42 43 2d EDH-RSA-DES-CBC-
07a0: 53 48 41 0a 45 44 48 2d 44 53 53 2d 44 45 53 2d SHA.EDH-DSS-DES-
07b0: 43 42 43 2d 53 48 41 0a 44 45 53 2d 43 42 43 2d CBC-SHA.DES-CBC-
07c0: 53 48 41 0a 45 58 50 2d 45 44 48 2d 52 53 41 2d SHA.EXP-EDH-RSA-
07d0: 44 45 53 2d 43 42 43 2d 53 48 41 0a 45 58 50 2d DES-CBC-SHA.EXP-
07e0: 45 44 48 2d 44 53 53 2d 44 45 53 2d 43 42 43 2d EDH-DSS-DES-CBC-
07f0: 53 48 41 0a 45 58 50 2d 44 45 53 2d 43 42 43 2d SHA.EXP-DES-CBC-
0800: 53 48 41 0a 45 58 50 2d 52 43 32 2d 43 42 43 2d SHA.EXP-RC2-CBC-
0810: 4d 44 35 0a 45 58 50 2d 52 43 34 2d 4d 44 35 7d MD5.EXP-RC4-MD5}
0820: 0a 0a 23 20 54 68 69 73 20 76 65 72 73 69 6f 6e ..# This version
0830: 20 6f 66 20 74 68 65 20 74 65 73 74 20 69 73 20 of the test is
0840: 63 6f 72 72 65 63 74 20 66 6f 72 20 4f 70 65 6e correct for Open
0850: 53 53 4c 20 6f 6e 6c 79 2e 0a 23 20 41 6e 20 65 SSL only..# An e
0860: 71 75 69 76 61 6c 65 6e 74 20 74 65 73 74 20 66 quivalent test f
0870: 6f 72 20 74 68 65 20 52 53 41 20 42 53 41 46 45 or the RSA BSAFE
0880: 20 53 53 4c 2d 43 20 69 73 20 65 61 72 6c 69 65 SSL-C is earlie
0890: 72 20 69 6e 20 74 68 69 73 20 66 69 6c 65 2e 0a r in this file..
08a0: 0a 74 65 73 74 20 63 69 70 68 65 72 73 2d 31 2e .test ciphers-1.
08b0: 34 20 7b 54 6c 73 3a 3a 63 69 70 68 65 72 73 20 4 {Tls::ciphers
08c0: 66 6f 72 20 74 6c 73 31 2e 7d 20 7b 4f 70 65 6e for tls1.} {Open
08d0: 53 53 4c 7d 20 7b 0a 20 20 20 20 73 65 74 20 72 SSL} {. set r
08e0: 65 73 75 6c 74 20 5b 6a 6f 69 6e 20 5b 65 76 61 esult [join [eva
08f0: 6c 20 74 6c 73 3a 3a 63 69 70 68 65 72 73 20 74 l tls::ciphers t
0900: 6c 73 31 5d 20 5c 6e 20 5d 0a 7d 20 7b 45 44 48 ls1] \n ].} {EDH
0910: 2d 52 53 41 2d 44 45 53 2d 43 42 43 33 2d 53 48 -RSA-DES-CBC3-SH
0920: 41 0a 45 44 48 2d 44 53 53 2d 44 45 53 2d 43 42 A.EDH-DSS-DES-CB
0930: 43 33 2d 53 48 41 0a 44 45 53 2d 43 42 43 33 2d C3-SHA.DES-CBC3-
0940: 53 48 41 0a 52 43 34 2d 53 48 41 0a 52 43 34 2d SHA.RC4-SHA.RC4-
0950: 4d 44 35 0a 45 44 48 2d 52 53 41 2d 44 45 53 2d MD5.EDH-RSA-DES-
0960: 43 42 43 2d 53 48 41 0a 45 44 48 2d 44 53 53 2d CBC-SHA.EDH-DSS-
0970: 44 45 53 2d 43 42 43 2d 53 48 41 0a 44 45 53 2d DES-CBC-SHA.DES-
0980: 43 42 43 2d 53 48 41 0a 45 58 50 2d 45 44 48 2d CBC-SHA.EXP-EDH-
0990: 52 53 41 2d 44 45 53 2d 43 42 43 2d 53 48 41 0a RSA-DES-CBC-SHA.
09a0: 45 58 50 2d 45 44 48 2d 44 53 53 2d 44 45 53 2d EXP-EDH-DSS-DES-
09b0: 43 42 43 2d 53 48 41 0a 45 58 50 2d 44 45 53 2d CBC-SHA.EXP-DES-
09c0: 43 42 43 2d 53 48 41 0a 45 58 50 2d 52 43 32 2d CBC-SHA.EXP-RC2-
09d0: 43 42 43 2d 4d 44 35 0a 45 58 50 2d 52 43 34 2d CBC-MD5.EXP-RC4-
09e0: 4d 44 35 7d 0a 0a 0a 0a 23 20 63 6c 65 61 6e 75 MD5}....# cleanu
09f0: 70 0a 3a 3a 74 63 6c 74 65 73 74 3a 3a 63 6c 65 p.::tcltest::cle
0a00: 61 6e 75 70 54 65 73 74 73 0a 72 65 74 75 72 6e anupTests.return
0a10: 0a .