Skip to content

Commit 1ddc47a

Browse files
committed
[test] adjust expected (tls) ALL ciphers suite
1 parent 2e54ff5 commit 1ddc47a

File tree

1 file changed

+60
-106
lines changed

1 file changed

+60
-106
lines changed

src/test/ruby/ssl/test_context.rb

Lines changed: 60 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -113,112 +113,66 @@ def test_context_ciphers
113113

114114
all_ciphers = context.ciphers.map { |cipher_array| cipher_array[0] }
115115

116-
# NOTE: assuming JCE installed ()CryptoSecurity.setAllPermissionPolicy)
117-
# ... otherwise on Java 8 (1.8.0_112-b15) :
118-
# Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_GCM_SHA384
119-
# Ignoring unavailable cipher suite: TLS_DH_anon_WITH_AES_256_CBC_SHA
120-
# Ignoring unavailable cipher suite: TLS_DH_anon_WITH_AES_256_CBC_SHA256
121-
# Ignoring unavailable cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA
122-
# Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
123-
# Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
124-
# Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
125-
# Ignoring unavailable cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256
126-
# Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA
127-
# Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
128-
# Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
129-
# Ignoring unavailable cipher suite: TLS_RSA_WITH_AES_256_GCM_SHA384
130-
# Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
131-
# Ignoring unavailable cipher suite: TLS_ECDH_anon_WITH_AES_256_CBC_SHA
132-
# Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
133-
# Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
134-
# Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
135-
# Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
136-
# Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
137-
# Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
138-
# Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
139-
# Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA
140-
# Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
141-
# Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
142-
# Ignoring unavailable cipher suite: TLS_DH_anon_WITH_AES_256_GCM_SHA384
143-
# Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_GCM_SHA384
144-
# Ignoring unavailable cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA
145-
# Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
146-
# Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
147-
# Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
148-
# Ignoring unavailable cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256
149-
# Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA
150-
# Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
151-
# Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
152-
# Ignoring unavailable cipher suite: TLS_RSA_WITH_AES_256_GCM_SHA384
153-
# Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
154-
# Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
155-
# Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
156-
# Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
157-
# Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
158-
# Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
159-
# Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
160-
# Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
161-
# Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA
162-
# Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
163-
# Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
164-
# Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_GCM_SHA384
165-
# Ignoring unavailable cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA
166-
# Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
167-
# Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
168-
# Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
169-
# Ignoring unavailable cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256
170-
# Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA
171-
# Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
172-
# Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
173-
# Ignoring unavailable cipher suite: TLS_RSA_WITH_AES_256_GCM_SHA384
174-
# Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
175-
# Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
176-
# Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
177-
# Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
178-
# Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
179-
# Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
180-
# Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
181-
# Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
182-
# Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA
183-
# Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
184-
# Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
185-
186-
jce_installed = true # || nil
187-
expected_ciphers = [jce_installed && "ECDHE-ECDSA-AES256-SHA",
188-
jce_installed && "ECDHE-RSA-AES256-SHA",
189-
jce_installed && "AES256-SHA",
190-
jce_installed && "ECDH-ECDSA-AES256-SHA",
191-
jce_installed && "ECDH-RSA-AES256-SHA",
192-
jce_installed && "DHE-RSA-AES256-SHA",
193-
jce_installed && "DHE-DSS-AES256-SHA",
194-
"ECDHE-ECDSA-AES128-SHA256",
195-
"ECDHE-RSA-AES128-SHA256",
196-
"ECDH-ECDSA-AES128-SHA256",
197-
"ECDH-RSA-AES128-SHA256",
198-
"ECDHE-ECDSA-AES128-SHA",
199-
"ECDHE-RSA-AES128-SHA",
200-
"AES128-SHA",
201-
"ECDH-ECDSA-AES128-SHA",
202-
"ECDH-RSA-AES128-SHA",
203-
"DHE-RSA-AES128-SHA",
204-
"DHE-DSS-AES128-SHA",
205-
"ECDHE-ECDSA-DES-CBC3-SHA",
206-
"ECDHE-RSA-DES-CBC3-SHA",
207-
"DES-CBC3-SHA",
208-
"ECDH-ECDSA-DES-CBC3-SHA",
209-
"ECDH-RSA-DES-CBC3-SHA",
210-
"EDH-RSA-DES-CBC3-SHA",
211-
"EDH-DSS-DES-CBC3-SHA",
212-
jce_installed && "AECDH-AES256-SHA",
213-
jce_installed && "ADH-AES256-SHA",
214-
"AECDH-AES128-SHA",
215-
"ADH-AES128-SHA",
216-
"AECDH-DES-CBC3-SHA",
217-
"ADH-DES-CBC3-SHA"]
218-
219-
#expected_ciphers.compact.each do |cipher|
220-
# assert all_ciphers.include?(cipher), "#{cipher} should have been included"
221-
#end
116+
jce_installed = true # always assume installed (Java 8+)
117+
118+
defunct_ciphers = [ # in terms of OpenSSL not reporting them on "ALL" (Ubuntu 16 LTS)
119+
jce_installed && "ECDH-ECDSA-AES256-SHA", # (old) backward compatibility
120+
jce_installed && "ECDH-RSA-AES256-SHA", # (old) backward compatibility
121+
"ECDH-ECDSA-AES128-SHA",
122+
"ECDH-RSA-AES128-SHA",
123+
#"ECDHE-ECDSA-DES-CBC3-SHA",
124+
#"ECDHE-RSA-DES-CBC3-SHA",
125+
#"DES-CBC3-SHA", # (old) SSLv3
126+
#"ECDH-ECDSA-DES-CBC3-SHA",
127+
#"ECDH-RSA-DES-CBC3-SHA",
128+
#"EDH-RSA-DES-CBC3-SHA",
129+
#"EDH-DSS-DES-CBC3-SHA",
130+
jce_installed && "AECDH-AES256-SHA",
131+
jce_installed && "ADH-AES256-SHA",
132+
#"AECDH-DES-CBC3-SHA",
133+
#"ADH-DES-CBC3-SHA",
134+
]
135+
136+
shared_ciphers = [
137+
jce_installed && "ECDHE-ECDSA-AES256-SHA",
138+
jce_installed && "ECDHE-RSA-AES256-SHA",
139+
jce_installed && "AES256-SHA",
140+
jce_installed && "DHE-RSA-AES256-SHA",
141+
jce_installed && "DHE-DSS-AES256-SHA",
142+
"ECDHE-ECDSA-AES128-SHA",
143+
"ECDHE-RSA-AES128-SHA",
144+
"AES128-SHA",
145+
"DHE-RSA-AES128-SHA",
146+
"DHE-DSS-AES128-SHA",
147+
"AECDH-AES128-SHA",
148+
"ADH-AES128-SHA",
149+
150+
"ECDHE-RSA-AES128-SHA256", "ECDHE-RSA-AES128-GCM-SHA256",
151+
"ECDHE-RSA-AES256-SHA384", "ECDHE-RSA-AES256-GCM-SHA384",
152+
153+
# added support in 0.10.3
154+
"ECDHE-ECDSA-AES256-SHA384",
155+
"ECDHE-RSA-AES256-SHA384",
156+
"DHE-RSA-AES256-SHA256",
157+
"DHE-DSS-AES256-SHA256",
158+
"ECDHE-ECDSA-AES128-GCM-SHA256", "ECDHE-ECDSA-AES256-GCM-SHA384",
159+
"ECDHE-RSA-AES128-GCM-SHA256", "ECDHE-RSA-AES256-GCM-SHA384",
160+
"DHE-DSS-AES128-GCM-SHA256", "DHE-DSS-AES256-GCM-SHA384",
161+
"DHE-RSA-AES128-GCM-SHA256", "DHE-RSA-AES256-GCM-SHA384",
162+
"AES128-GCM-SHA256", "AES256-GCM-SHA384",
163+
]
164+
165+
expected_ciphers = [
166+
"ECDHE-ECDSA-AES128-SHA256",
167+
"ECDH-ECDSA-AES128-SHA256",
168+
"ECDH-RSA-AES128-SHA256",
169+
#"ECDH-ECDSA-AES128-SHA",
170+
#"ECDH-RSA-AES128-SHA",
171+
] + defunct_ciphers + shared_ciphers
172+
173+
expected_ciphers.compact.each do |cipher|
174+
assert all_ciphers.include?(cipher), "#{cipher} should have been included"
175+
end
222176

223177
diff = (expected_ciphers - all_ciphers).compact
224178
assert_equal [], diff

0 commit comments

Comments
 (0)