Diff

Differences From Artifact [203c5a421e]:

To Artifact [855ee5e7e2]:


35
36
37
38
39
40
41


42
43
44
45
46
47
48
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50







+
+








proc exec_get {delim args} {return [split [exec openssl {*}$args] $delim]}
proc exec_get_ciphers {} {
    set list [list]
    set data [exec openssl list -cipher-algorithms]
    foreach line [split $data "\n"] {
        set line [string trim $line]
        if {$line eq "Legacy:"} continue
        if {$line eq "Provided:"} break
        foreach {cipher ptr alias} [split [string trim $line]] {
            lappend list [string tolower $cipher]
        }
    }
    return [lsort -unique $list]
}

59
60
61
62
63
64
65
66


67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87

88
89
90
91
92
93
94
61
62
63
64
65
66
67

68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

90
91
92
93
94
95
96
97







-
+
+




















-
+







}

proc exec_get_pkeys {} {
    set list [list]
    set data [exec openssl list -public-key-methods]
    foreach line [split $data "\n"] {
        set line [string trim $line]
        if {[string match "Type:*" $line]} continue
        if {$line eq "Legacy:" || [string match "Type:*" $line]} continue
        if {$line eq "Provided:"} break
        lappend list [string trim $line]
    }
    return $list
}

proc exec_get_macs {} {return [list cmac hmac]}
proc list_tolower {list} {
    set result [list]
    foreach element $list {
        lappend result [string tolower $element]
    }
    return $result
}


# Test list ciphers


test Ciphers_List-1.1 {All} -body {
	lcompare [lsort [exec_get_ciphers]] [list_tolower [lsort [::tls::ciphers]]]
    } -result {missing {rc5 rc5-cbc rc5-cfb rc5-ecb rc5-ofb} unexpected {aes-128-ccm aes-128-gcm aes-192-ccm aes-192-gcm aes-256-ccm aes-256-gcm}}
    } -result {missing {} unexpected {aes-128-ccm aes-128-gcm aes-192-ccm aes-192-gcm aes-256-ccm aes-256-gcm}}

# Test list ciphers for protocols


test Ciphers_By_Protocol-2.1 {SSL2} -constraints {ssl2} -body {
	lcompare [exec_get ":" ciphers -ssl2] [::tls::ciphers ssl2]
    } -result {missing {} unexpected {}}