3 ## SSL test configurations
10 use OpenSSL::Test::Utils;
13 "ECDSA.Certificate" => test_pem("server-ecdsa-cert.pem"),
14 "ECDSA.PrivateKey" => test_pem("server-ecdsa-key.pem"),
15 "EdDSA.Certificate" => test_pem("server-ed25519-cert.pem"),
16 "EdDSA.PrivateKey" => test_pem("server-ed25519-key.pem"),
17 "MaxProtocol" => "TLSv1.2"
22 name => "ECDSA CipherString Selection",
25 "CipherString" => "aECDSA",
26 "MaxProtocol" => "TLSv1.2",
27 "RequestCAFile" => test_pem("root-cert.pem"),
30 "ExpectedServerCertType" =>, "P-256",
31 "ExpectedServerSignType" =>, "EC",
32 # Note: certificate_authorities not sent for TLS < 1.3
33 "ExpectedServerCANames" =>, "empty",
34 "ExpectedResult" => "Success"
38 name => "Ed25519 CipherString and Signature Algorithm Selection",
41 "CipherString" => "aECDSA",
42 "MaxProtocol" => "TLSv1.2",
43 "SignatureAlgorithms" => "ed25519:ECDSA+SHA256",
44 "RequestCAFile" => test_pem("root-cert.pem"),
47 "ExpectedServerCertType" =>, "Ed25519",
48 "ExpectedServerSignType" =>, "Ed25519",
49 # Note: certificate_authorities not sent for TLS < 1.3
50 "ExpectedServerCANames" =>, "empty",
51 "ExpectedResult" => "Success"
55 name => "RSA CipherString Selection",
58 "CipherString" => "aRSA",
59 "MaxProtocol" => "TLSv1.2",
62 "ExpectedServerCertType" =>, "RSA",
63 "ExpectedServerSignType" =>, "RSA-PSS",
64 "ExpectedResult" => "Success"
68 name => "P-256 CipherString and Signature Algorithm Selection",
71 "CipherString" => "aECDSA",
72 "MaxProtocol" => "TLSv1.2",
73 "SignatureAlgorithms" => "ECDSA+SHA256:ed25519",
76 "ExpectedServerCertType" => "P-256",
77 "ExpectedServerSignHash" => "SHA256",
78 "ExpectedServerSignType" => "EC",
79 "ExpectedResult" => "Success"
83 name => "Ed25519 CipherString and Curves Selection",
86 "CipherString" => "aECDSA",
87 "MaxProtocol" => "TLSv1.2",
88 "SignatureAlgorithms" => "ECDSA+SHA256:ed25519",
89 # Excluding P-256 from the supported curves list means server
90 # certificate should be Ed25519 and not P-256
94 "ExpectedServerCertType" =>, "Ed25519",
95 "ExpectedServerSignType" =>, "Ed25519",
96 "ExpectedResult" => "Success"
100 name => "ECDSA CipherString Selection, no ECDSA certificate",
102 "MaxProtocol" => "TLSv1.2"
105 "CipherString" => "aECDSA",
106 "MaxProtocol" => "TLSv1.2"
109 "ExpectedResult" => "ServerFail"
113 name => "ECDSA Signature Algorithm Selection",
116 "SignatureAlgorithms" => "ECDSA+SHA256",
119 "ExpectedServerCertType" => "P-256",
120 "ExpectedServerSignHash" => "SHA256",
121 "ExpectedServerSignType" => "EC",
122 "ExpectedResult" => "Success"
126 name => "ECDSA Signature Algorithm Selection SHA384",
129 "SignatureAlgorithms" => "ECDSA+SHA384",
132 "ExpectedServerCertType" => "P-256",
133 "ExpectedServerSignHash" => "SHA384",
134 "ExpectedServerSignType" => "EC",
135 "ExpectedResult" => "Success"
139 name => "ECDSA Signature Algorithm Selection SHA1",
142 "SignatureAlgorithms" => "ECDSA+SHA1",
145 "ExpectedServerCertType" => "P-256",
146 "ExpectedServerSignHash" => "SHA1",
147 "ExpectedServerSignType" => "EC",
148 "ExpectedResult" => "Success"
152 name => "ECDSA Signature Algorithm Selection compressed point",
154 "ECDSA.Certificate" => test_pem("server-cecdsa-cert.pem"),
155 "ECDSA.PrivateKey" => test_pem("server-cecdsa-key.pem"),
156 "MaxProtocol" => "TLSv1.2"
159 "SignatureAlgorithms" => "ECDSA+SHA256",
162 "ExpectedServerCertType" => "P-256",
163 "ExpectedServerSignHash" => "SHA256",
164 "ExpectedServerSignType" => "EC",
165 "ExpectedResult" => "Success"
169 name => "ECDSA Signature Algorithm Selection, no ECDSA certificate",
171 "MaxProtocol" => "TLSv1.2"
174 "SignatureAlgorithms" => "ECDSA+SHA256",
177 "ExpectedResult" => "ServerFail"
181 name => "RSA Signature Algorithm Selection",
184 "SignatureAlgorithms" => "RSA+SHA256",
187 "ExpectedServerCertType" => "RSA",
188 "ExpectedServerSignHash" => "SHA256",
189 "ExpectedServerSignType" => "RSA",
190 "ExpectedResult" => "Success"
194 name => "RSA-PSS Signature Algorithm Selection",
197 "SignatureAlgorithms" => "RSA-PSS+SHA256",
200 "ExpectedServerCertType" => "RSA",
201 "ExpectedServerSignHash" => "SHA256",
202 "ExpectedServerSignType" => "RSA-PSS",
203 "ExpectedResult" => "Success"
207 name => "Suite B P-256 Hash Algorithm Selection",
209 "ECDSA.Certificate" => test_pem("p256-server-cert.pem"),
210 "ECDSA.PrivateKey" => test_pem("p256-server-key.pem"),
211 "MaxProtocol" => "TLSv1.2",
212 "CipherString" => "SUITEB128"
215 "VerifyCAFile" => test_pem("p384-root.pem"),
216 "SignatureAlgorithms" => "ECDSA+SHA384:ECDSA+SHA256"
219 "ExpectedServerCertType" => "P-256",
220 "ExpectedServerSignHash" => "SHA256",
221 "ExpectedServerSignType" => "EC",
222 "ExpectedResult" => "Success"
226 name => "Suite B P-384 Hash Algorithm Selection",
228 "ECDSA.Certificate" => test_pem("p384-server-cert.pem"),
229 "ECDSA.PrivateKey" => test_pem("p384-server-key.pem"),
230 "MaxProtocol" => "TLSv1.2",
231 "CipherString" => "SUITEB128"
234 "VerifyCAFile" => test_pem("p384-root.pem"),
235 "SignatureAlgorithms" => "ECDSA+SHA256:ECDSA+SHA384"
238 "ExpectedServerCertType" => "P-384",
239 "ExpectedServerSignHash" => "SHA384",
240 "ExpectedServerSignType" => "EC",
241 "ExpectedResult" => "Success"
245 name => "TLS 1.2 Ed25519 Client Auth",
247 "VerifyCAFile" => test_pem("root-cert.pem"),
248 "VerifyMode" => "Require"
251 "EdDSA.Certificate" => test_pem("client-ed25519-cert.pem"),
252 "EdDSA.PrivateKey" => test_pem("client-ed25519-key.pem"),
253 "MinProtocol" => "TLSv1.2",
254 "MaxProtocol" => "TLSv1.2"
257 "ExpectedClientCertType" => "Ed25519",
258 "ExpectedClientSignType" => "Ed25519",
259 "ExpectedResult" => "Success"
265 my $server_tls_1_3 = {
266 "ECDSA.Certificate" => test_pem("server-ecdsa-cert.pem"),
267 "ECDSA.PrivateKey" => test_pem("server-ecdsa-key.pem"),
268 "EdDSA.Certificate" => test_pem("server-ed25519-cert.pem"),
269 "EdDSA.PrivateKey" => test_pem("server-ed25519-key.pem"),
270 "MinProtocol" => "TLSv1.3",
271 "MaxProtocol" => "TLSv1.3"
274 my $client_tls_1_3 = {
275 "RSA.Certificate" => test_pem("ee-client-chain.pem"),
276 "RSA.PrivateKey" => test_pem("ee-key.pem"),
277 "ECDSA.Certificate" => test_pem("ee-ecdsa-client-chain.pem"),
278 "ECDSA.PrivateKey" => test_pem("ee-ecdsa-key.pem"),
279 "MinProtocol" => "TLSv1.3",
280 "MaxProtocol" => "TLSv1.3"
283 my @tests_tls_1_3 = (
285 name => "TLS 1.3 ECDSA Signature Algorithm Selection",
286 server => $server_tls_1_3,
288 "SignatureAlgorithms" => "ECDSA+SHA256",
291 "ExpectedServerCertType" => "P-256",
292 "ExpectedServerSignHash" => "SHA256",
293 "ExpectedServerSignType" => "EC",
294 "ExpectedServerCANames" => "empty",
295 "ExpectedResult" => "Success"
299 name => "TLS 1.3 ECDSA Signature Algorithm Selection compressed point",
301 "ECDSA.Certificate" => test_pem("server-cecdsa-cert.pem"),
302 "ECDSA.PrivateKey" => test_pem("server-cecdsa-key.pem"),
303 "MinProtocol" => "TLSv1.3",
304 "MaxProtocol" => "TLSv1.3"
307 "SignatureAlgorithms" => "ECDSA+SHA256",
310 "ExpectedResult" => "ServerFail"
314 name => "TLS 1.3 ECDSA Signature Algorithm Selection SHA1",
315 server => $server_tls_1_3,
317 "SignatureAlgorithms" => "ECDSA+SHA1",
320 "ExpectedResult" => "ServerFail"
324 name => "TLS 1.3 ECDSA Signature Algorithm Selection with PSS",
325 server => $server_tls_1_3,
327 "SignatureAlgorithms" => "ECDSA+SHA256:RSA-PSS+SHA256",
328 "RequestCAFile" => test_pem("root-cert.pem"),
331 "ExpectedServerCertType" => "P-256",
332 "ExpectedServerSignHash" => "SHA256",
333 "ExpectedServerSignType" => "EC",
334 "ExpectedServerCANames" => test_pem("root-cert.pem"),
335 "ExpectedResult" => "Success"
339 name => "TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS",
340 server => $server_tls_1_3,
342 "SignatureAlgorithms" => "ECDSA+SHA384:RSA-PSS+SHA384",
345 "ExpectedServerCertType" => "RSA",
346 "ExpectedServerSignHash" => "SHA384",
347 "ExpectedServerSignType" => "RSA-PSS",
348 "ExpectedResult" => "Success"
352 name => "TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate",
354 "MinProtocol" => "TLSv1.3",
355 "MaxProtocol" => "TLSv1.3"
358 "SignatureAlgorithms" => "ECDSA+SHA256",
361 "ExpectedResult" => "ServerFail"
365 name => "TLS 1.3 RSA Signature Algorithm Selection, no PSS",
366 server => $server_tls_1_3,
368 "SignatureAlgorithms" => "RSA+SHA256",
371 "ExpectedResult" => "ServerFail"
375 name => "TLS 1.3 RSA-PSS Signature Algorithm Selection",
376 server => $server_tls_1_3,
378 "SignatureAlgorithms" => "RSA-PSS+SHA256",
381 "ExpectedServerCertType" => "RSA",
382 "ExpectedServerSignHash" => "SHA256",
383 "ExpectedServerSignType" => "RSA-PSS",
384 "ExpectedResult" => "Success"
388 name => "TLS 1.3 Ed25519 Signature Algorithm Selection",
389 server => $server_tls_1_3,
391 "SignatureAlgorithms" => "ed25519",
394 "ExpectedServerCertType" => "Ed25519",
395 "ExpectedServerSignType" => "Ed25519",
396 "ExpectedResult" => "Success"
400 name => "TLS 1.3 Ed25519 CipherString and Groups Selection",
401 server => $server_tls_1_3,
403 "SignatureAlgorithms" => "ECDSA+SHA256:ed25519",
404 # Excluding P-256 from the supported groups list should
405 # mean server still uses a P-256 certificate because supported
406 # groups is not used in signature selection for TLS 1.3
410 "ExpectedServerCertType" =>, "P-256",
411 "ExpectedServerSignType" =>, "EC",
412 "ExpectedResult" => "Success"
416 name => "TLS 1.3 RSA Client Auth Signature Algorithm Selection",
418 "ClientSignatureAlgorithms" => "PSS+SHA256",
419 "VerifyCAFile" => test_pem("root-cert.pem"),
420 "VerifyMode" => "Require"
422 client => $client_tls_1_3,
424 "ExpectedClientCertType" => "RSA",
425 "ExpectedClientSignHash" => "SHA256",
426 "ExpectedClientSignType" => "RSA-PSS",
427 "ExpectedClientCANames" => "empty",
428 "ExpectedResult" => "Success"
432 name => "TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names",
434 "ClientSignatureAlgorithms" => "PSS+SHA256",
435 "VerifyCAFile" => test_pem("root-cert.pem"),
436 "RequestCAFile" => test_pem("root-cert.pem"),
437 "VerifyMode" => "Require"
439 client => $client_tls_1_3,
441 "ExpectedClientCertType" => "RSA",
442 "ExpectedClientSignHash" => "SHA256",
443 "ExpectedClientSignType" => "RSA-PSS",
444 "ExpectedClientCANames" => test_pem("root-cert.pem"),
445 "ExpectedResult" => "Success"
449 name => "TLS 1.3 ECDSA Client Auth Signature Algorithm Selection",
451 "ClientSignatureAlgorithms" => "ECDSA+SHA256",
452 "VerifyCAFile" => test_pem("root-cert.pem"),
453 "VerifyMode" => "Require"
455 client => $client_tls_1_3,
457 "ExpectedClientCertType" => "P-256",
458 "ExpectedClientSignHash" => "SHA256",
459 "ExpectedClientSignType" => "EC",
460 "ExpectedResult" => "Success"
464 name => "TLS 1.3 Ed25519 Client Auth",
466 "VerifyCAFile" => test_pem("root-cert.pem"),
467 "VerifyMode" => "Require"
470 "EdDSA.Certificate" => test_pem("client-ed25519-cert.pem"),
471 "EdDSA.PrivateKey" => test_pem("client-ed25519-key.pem"),
472 "MinProtocol" => "TLSv1.3",
473 "MaxProtocol" => "TLSv1.3"
476 "ExpectedClientCertType" => "Ed25519",
477 "ExpectedClientSignType" => "Ed25519",
478 "ExpectedResult" => "Success"
483 push @tests, @tests_tls_1_3 unless disabled("tls1_3");
485 my @tests_dsa_tls_1_2 = (
487 name => "TLS 1.2 DSA Certificate Test",
489 "DSA.Certificate" => test_pem("server-dsa-cert.pem"),
490 "DSA.PrivateKey" => test_pem("server-dsa-key.pem"),
491 "DHParameters" => test_pem("dhp2048.pem"),
492 "MinProtocol" => "TLSv1.2",
493 "MaxProtocol" => "TLSv1.2",
494 "CipherString" => "ALL",
497 "SignatureAlgorithms" => "DSA+SHA256:DSA+SHA1",
498 "CipherString" => "ALL",
501 "ExpectedResult" => "Success"
506 my @tests_dsa_tls_1_3 = (
508 name => "TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms",
510 "ClientSignatureAlgorithms" => "ECDSA+SHA1:DSA+SHA256:RSA+SHA256",
511 "VerifyCAFile" => test_pem("root-cert.pem"),
512 "VerifyMode" => "Request"
516 "ExpectedResult" => "ServerFail"
520 name => "TLS 1.3 DSA Certificate Test",
522 "DSA.Certificate" => test_pem("server-dsa-cert.pem"),
523 "DSA.PrivateKey" => test_pem("server-dsa-key.pem"),
524 "MinProtocol" => "TLSv1.3",
525 "MaxProtocol" => "TLSv1.3",
526 "CipherString" => "ALL",
529 "SignatureAlgorithms" => "DSA+SHA1:DSA+SHA256:ECDSA+SHA256",
530 "CipherString" => "ALL",
533 "ExpectedResult" => "ServerFail"
538 if (!disabled("dsa")) {
539 push @tests, @tests_dsa_tls_1_2 unless disabled("dh");
540 push @tests, @tests_dsa_tls_1_3 unless disabled("tls1_3");