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 "Ed25519.Certificate" => test_pem("server-ed25519-cert.pem"),
16 "Ed25519.PrivateKey" => test_pem("server-ed25519-key.pem"),
17 "Ed448.Certificate" => test_pem("server-ed448-cert.pem"),
18 "Ed448.PrivateKey" => test_pem("server-ed448-key.pem"),
19 "MaxProtocol" => "TLSv1.2"
23 "PSS.Certificate" => test_pem("server-pss-cert.pem"),
24 "PSS.PrivateKey" => test_pem("server-pss-key.pem"),
25 "ECDSA.Certificate" => test_pem("server-ecdsa-cert.pem"),
26 "ECDSA.PrivateKey" => test_pem("server-ecdsa-key.pem"),
27 "Ed25519.Certificate" => test_pem("server-ed25519-cert.pem"),
28 "Ed25519.PrivateKey" => test_pem("server-ed25519-key.pem"),
29 "Ed448.Certificate" => test_pem("server-ed448-cert.pem"),
30 "Ed448.PrivateKey" => test_pem("server-ed448-key.pem"),
31 "MaxProtocol" => "TLSv1.2"
34 my $server_pss_only = {
35 "Certificate" => test_pem("server-pss-cert.pem"),
36 "PrivateKey" => test_pem("server-pss-key.pem"),
41 name => "ECDSA CipherString Selection",
44 "CipherString" => "aECDSA",
45 "MaxProtocol" => "TLSv1.2",
46 "RequestCAFile" => test_pem("root-cert.pem"),
49 "ExpectedServerCertType" =>, "P-256",
50 "ExpectedServerSignType" =>, "EC",
51 # Note: certificate_authorities not sent for TLS < 1.3
52 "ExpectedServerCANames" =>, "empty",
53 "ExpectedResult" => "Success"
57 name => "Ed25519 CipherString and Signature Algorithm Selection",
60 "CipherString" => "aECDSA",
61 "MaxProtocol" => "TLSv1.2",
62 "SignatureAlgorithms" => "ed25519:ECDSA+SHA256",
63 "RequestCAFile" => test_pem("root-cert.pem"),
66 "ExpectedServerCertType" =>, "Ed25519",
67 "ExpectedServerSignType" =>, "Ed25519",
68 # Note: certificate_authorities not sent for TLS < 1.3
69 "ExpectedServerCANames" =>, "empty",
70 "ExpectedResult" => "Success"
74 name => "Ed448 CipherString and Signature Algorithm Selection",
77 "CipherString" => "aECDSA",
78 "MaxProtocol" => "TLSv1.2",
79 "SignatureAlgorithms" => "ed448:ECDSA+SHA256",
80 "RequestCAFile" => test_pem("root-cert.pem"),
83 "ExpectedServerCertType" =>, "Ed448",
84 "ExpectedServerSignType" =>, "Ed448",
85 # Note: certificate_authorities not sent for TLS < 1.3
86 "ExpectedServerCANames" =>, "empty",
87 "ExpectedResult" => "Success"
91 name => "RSA CipherString Selection",
94 "CipherString" => "aRSA",
95 "MaxProtocol" => "TLSv1.2",
98 "ExpectedServerCertType" =>, "RSA",
99 "ExpectedServerSignType" =>, "RSA-PSS",
100 "ExpectedResult" => "Success"
104 name => "RSA-PSS Certificate CipherString Selection",
105 server => $server_pss,
107 "CipherString" => "aRSA",
108 "MaxProtocol" => "TLSv1.2",
111 "ExpectedServerCertType" =>, "RSA-PSS",
112 "ExpectedServerSignType" =>, "RSA-PSS",
113 "ExpectedResult" => "Success"
117 name => "P-256 CipherString and Signature Algorithm Selection",
120 "CipherString" => "aECDSA",
121 "MaxProtocol" => "TLSv1.2",
122 "SignatureAlgorithms" => "ECDSA+SHA256:ed25519",
125 "ExpectedServerCertType" => "P-256",
126 "ExpectedServerSignHash" => "SHA256",
127 "ExpectedServerSignType" => "EC",
128 "ExpectedResult" => "Success"
132 name => "Ed25519 CipherString and Curves Selection",
135 "CipherString" => "aECDSA",
136 "MaxProtocol" => "TLSv1.2",
137 "SignatureAlgorithms" => "ECDSA+SHA256:ed25519",
138 # Excluding P-256 from the supported curves list means server
139 # certificate should be Ed25519 and not P-256
143 "ExpectedServerCertType" =>, "Ed25519",
144 "ExpectedServerSignType" =>, "Ed25519",
145 "ExpectedResult" => "Success"
149 name => "Ed448 CipherString and Curves Selection",
152 "CipherString" => "aECDSA",
153 "MaxProtocol" => "TLSv1.2",
154 "SignatureAlgorithms" => "ECDSA+SHA256:ed448",
155 # Excluding P-256 from the supported curves list means server
156 # certificate should be Ed25519 and not P-256
160 "ExpectedServerCertType" =>, "Ed448",
161 "ExpectedServerSignType" =>, "Ed448",
162 "ExpectedResult" => "Success"
166 name => "ECDSA CipherString Selection, no ECDSA certificate",
168 "MaxProtocol" => "TLSv1.2"
171 "CipherString" => "aECDSA",
172 "MaxProtocol" => "TLSv1.2"
175 "ExpectedResult" => "ServerFail"
179 name => "ECDSA Signature Algorithm Selection",
182 "SignatureAlgorithms" => "ECDSA+SHA256",
185 "ExpectedServerCertType" => "P-256",
186 "ExpectedServerSignHash" => "SHA256",
187 "ExpectedServerSignType" => "EC",
188 "ExpectedResult" => "Success"
192 name => "ECDSA Signature Algorithm Selection SHA384",
195 "SignatureAlgorithms" => "ECDSA+SHA384",
198 "ExpectedServerCertType" => "P-256",
199 "ExpectedServerSignHash" => "SHA384",
200 "ExpectedServerSignType" => "EC",
201 "ExpectedResult" => "Success"
205 name => "ECDSA Signature Algorithm Selection SHA1",
208 "SignatureAlgorithms" => "ECDSA+SHA1",
211 "ExpectedServerCertType" => "P-256",
212 "ExpectedServerSignHash" => "SHA1",
213 "ExpectedServerSignType" => "EC",
214 "ExpectedResult" => "Success"
218 name => "ECDSA Signature Algorithm Selection compressed point",
220 "ECDSA.Certificate" => test_pem("server-cecdsa-cert.pem"),
221 "ECDSA.PrivateKey" => test_pem("server-cecdsa-key.pem"),
222 "MaxProtocol" => "TLSv1.2"
225 "SignatureAlgorithms" => "ECDSA+SHA256",
228 "ExpectedServerCertType" => "P-256",
229 "ExpectedServerSignHash" => "SHA256",
230 "ExpectedServerSignType" => "EC",
231 "ExpectedResult" => "Success"
235 name => "ECDSA Signature Algorithm Selection, no ECDSA certificate",
237 "MaxProtocol" => "TLSv1.2"
240 "SignatureAlgorithms" => "ECDSA+SHA256",
243 "ExpectedResult" => "ServerFail"
247 name => "RSA Signature Algorithm Selection",
250 "SignatureAlgorithms" => "RSA+SHA256",
253 "ExpectedServerCertType" => "RSA",
254 "ExpectedServerSignHash" => "SHA256",
255 "ExpectedServerSignType" => "RSA",
256 "ExpectedResult" => "Success"
260 name => "RSA-PSS Signature Algorithm Selection",
263 "SignatureAlgorithms" => "RSA-PSS+SHA256",
266 "ExpectedServerCertType" => "RSA",
267 "ExpectedServerSignHash" => "SHA256",
268 "ExpectedServerSignType" => "RSA-PSS",
269 "ExpectedResult" => "Success"
273 name => "RSA-PSS Certificate Legacy Signature Algorithm Selection",
274 server => $server_pss,
276 "SignatureAlgorithms" => "RSA-PSS+SHA256",
279 "ExpectedServerCertType" => "RSA",
280 "ExpectedServerSignHash" => "SHA256",
281 "ExpectedServerSignType" => "RSA-PSS",
282 "ExpectedResult" => "Success"
286 name => "RSA-PSS Certificate Unified Signature Algorithm Selection",
287 server => $server_pss,
289 "SignatureAlgorithms" => "rsa_pss_pss_sha256",
292 "ExpectedServerCertType" => "RSA-PSS",
293 "ExpectedServerSignHash" => "SHA256",
294 "ExpectedServerSignType" => "RSA-PSS",
295 "ExpectedResult" => "Success"
299 name => "Only RSA-PSS Certificate",
300 server => $server_pss_only,
303 "ExpectedServerCertType" => "RSA-PSS",
304 "ExpectedServerSignHash" => "SHA256",
305 "ExpectedServerSignType" => "RSA-PSS",
306 "ExpectedResult" => "Success"
310 name => "RSA-PSS Certificate, no PSS signature algorithms",
311 server => $server_pss_only,
313 "SignatureAlgorithms" => "RSA+SHA256",
316 "ExpectedResult" => "ServerFail"
320 name => "Suite B P-256 Hash Algorithm Selection",
322 "ECDSA.Certificate" => test_pem("p256-server-cert.pem"),
323 "ECDSA.PrivateKey" => test_pem("p256-server-key.pem"),
324 "MaxProtocol" => "TLSv1.2",
325 "CipherString" => "SUITEB128"
328 "VerifyCAFile" => test_pem("p384-root.pem"),
329 "SignatureAlgorithms" => "ECDSA+SHA384:ECDSA+SHA256"
332 "ExpectedServerCertType" => "P-256",
333 "ExpectedServerSignHash" => "SHA256",
334 "ExpectedServerSignType" => "EC",
335 "ExpectedResult" => "Success"
339 name => "Suite B P-384 Hash Algorithm Selection",
341 "ECDSA.Certificate" => test_pem("p384-server-cert.pem"),
342 "ECDSA.PrivateKey" => test_pem("p384-server-key.pem"),
343 "MaxProtocol" => "TLSv1.2",
344 "CipherString" => "SUITEB128"
347 "VerifyCAFile" => test_pem("p384-root.pem"),
348 "SignatureAlgorithms" => "ECDSA+SHA256:ECDSA+SHA384"
351 "ExpectedServerCertType" => "P-384",
352 "ExpectedServerSignHash" => "SHA384",
353 "ExpectedServerSignType" => "EC",
354 "ExpectedResult" => "Success"
358 name => "TLS 1.2 Ed25519 Client Auth",
360 "VerifyCAFile" => test_pem("root-cert.pem"),
361 "VerifyMode" => "Require"
364 "Ed25519.Certificate" => test_pem("client-ed25519-cert.pem"),
365 "Ed25519.PrivateKey" => test_pem("client-ed25519-key.pem"),
366 "MinProtocol" => "TLSv1.2",
367 "MaxProtocol" => "TLSv1.2"
370 "ExpectedClientCertType" => "Ed25519",
371 "ExpectedClientSignType" => "Ed25519",
372 "ExpectedResult" => "Success"
376 name => "TLS 1.2 Ed448 Client Auth",
378 "VerifyCAFile" => test_pem("root-cert.pem"),
379 "VerifyMode" => "Require"
382 "Ed448.Certificate" => test_pem("client-ed448-cert.pem"),
383 "Ed448.PrivateKey" => test_pem("client-ed448-key.pem"),
384 "MinProtocol" => "TLSv1.2",
385 "MaxProtocol" => "TLSv1.2"
388 "ExpectedClientCertType" => "Ed448",
389 "ExpectedClientSignType" => "Ed448",
390 "ExpectedResult" => "Success"
395 my @tests_tls_1_1 = (
397 name => "Only RSA-PSS Certificate, TLS v1.1",
398 server => $server_pss_only,
400 "MaxProtocol" => "TLSv1.1",
403 "ExpectedResult" => "ServerFail"
408 push @tests, @tests_tls_1_1 unless disabled("tls1_1");
410 my $server_tls_1_3 = {
411 "ECDSA.Certificate" => test_pem("server-ecdsa-cert.pem"),
412 "ECDSA.PrivateKey" => test_pem("server-ecdsa-key.pem"),
413 "Ed25519.Certificate" => test_pem("server-ed25519-cert.pem"),
414 "Ed25519.PrivateKey" => test_pem("server-ed25519-key.pem"),
415 "Ed448.Certificate" => test_pem("server-ed448-cert.pem"),
416 "Ed448.PrivateKey" => test_pem("server-ed448-key.pem"),
417 "MinProtocol" => "TLSv1.3",
418 "MaxProtocol" => "TLSv1.3"
421 my $server_tls_1_3_pss = {
422 "PSS.Certificate" => test_pem("server-pss-cert.pem"),
423 "PSS.PrivateKey" => test_pem("server-pss-key.pem"),
424 "ECDSA.Certificate" => test_pem("server-ecdsa-cert.pem"),
425 "ECDSA.PrivateKey" => test_pem("server-ecdsa-key.pem"),
426 "Ed25519.Certificate" => test_pem("server-ed25519-cert.pem"),
427 "Ed25519.PrivateKey" => test_pem("server-ed25519-key.pem"),
428 "Ed448.Certificate" => test_pem("server-ed448-cert.pem"),
429 "Ed448.PrivateKey" => test_pem("server-ed449-key.pem"),
430 "MinProtocol" => "TLSv1.3",
431 "MaxProtocol" => "TLSv1.3"
434 my $client_tls_1_3 = {
435 "RSA.Certificate" => test_pem("ee-client-chain.pem"),
436 "RSA.PrivateKey" => test_pem("ee-key.pem"),
437 "ECDSA.Certificate" => test_pem("ee-ecdsa-client-chain.pem"),
438 "ECDSA.PrivateKey" => test_pem("ee-ecdsa-key.pem"),
439 "MinProtocol" => "TLSv1.3",
440 "MaxProtocol" => "TLSv1.3"
443 my @tests_tls_1_3 = (
445 name => "TLS 1.3 ECDSA Signature Algorithm Selection",
446 server => $server_tls_1_3,
448 "SignatureAlgorithms" => "ECDSA+SHA256",
451 "ExpectedServerCertType" => "P-256",
452 "ExpectedServerSignHash" => "SHA256",
453 "ExpectedServerSignType" => "EC",
454 "ExpectedServerCANames" => "empty",
455 "ExpectedResult" => "Success"
459 name => "TLS 1.3 ECDSA Signature Algorithm Selection compressed point",
461 "ECDSA.Certificate" => test_pem("server-cecdsa-cert.pem"),
462 "ECDSA.PrivateKey" => test_pem("server-cecdsa-key.pem"),
463 "MinProtocol" => "TLSv1.3",
464 "MaxProtocol" => "TLSv1.3"
467 "SignatureAlgorithms" => "ECDSA+SHA256",
470 "ExpectedResult" => "ServerFail"
474 name => "TLS 1.3 ECDSA Signature Algorithm Selection SHA1",
475 server => $server_tls_1_3,
477 "SignatureAlgorithms" => "ECDSA+SHA1",
480 "ExpectedResult" => "ServerFail"
484 name => "TLS 1.3 ECDSA Signature Algorithm Selection with PSS",
485 server => $server_tls_1_3,
487 "SignatureAlgorithms" => "ECDSA+SHA256:RSA-PSS+SHA256",
488 "RequestCAFile" => test_pem("root-cert.pem"),
491 "ExpectedServerCertType" => "P-256",
492 "ExpectedServerSignHash" => "SHA256",
493 "ExpectedServerSignType" => "EC",
494 "ExpectedServerCANames" => test_pem("root-cert.pem"),
495 "ExpectedResult" => "Success"
499 name => "TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS",
500 server => $server_tls_1_3,
502 "SignatureAlgorithms" => "ECDSA+SHA384:RSA-PSS+SHA384",
505 "ExpectedServerCertType" => "RSA",
506 "ExpectedServerSignHash" => "SHA384",
507 "ExpectedServerSignType" => "RSA-PSS",
508 "ExpectedResult" => "Success"
512 name => "TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate",
514 "MinProtocol" => "TLSv1.3",
515 "MaxProtocol" => "TLSv1.3"
518 "SignatureAlgorithms" => "ECDSA+SHA256",
521 "ExpectedResult" => "ServerFail"
525 name => "TLS 1.3 RSA Signature Algorithm Selection, no PSS",
526 server => $server_tls_1_3,
528 "SignatureAlgorithms" => "RSA+SHA256",
531 "ExpectedResult" => "ServerFail"
535 name => "TLS 1.3 RSA-PSS Signature Algorithm Selection",
536 server => $server_tls_1_3,
538 "SignatureAlgorithms" => "RSA-PSS+SHA256",
541 "ExpectedServerCertType" => "RSA",
542 "ExpectedServerSignHash" => "SHA256",
543 "ExpectedServerSignType" => "RSA-PSS",
544 "ExpectedResult" => "Success"
548 name => "TLS 1.3 Ed25519 Signature Algorithm Selection",
549 server => $server_tls_1_3,
551 "SignatureAlgorithms" => "ed25519",
554 "ExpectedServerCertType" => "Ed25519",
555 "ExpectedServerSignType" => "Ed25519",
556 "ExpectedResult" => "Success"
560 name => "TLS 1.3 Ed448 Signature Algorithm Selection",
561 server => $server_tls_1_3,
563 "SignatureAlgorithms" => "ed448",
566 "ExpectedServerCertType" => "Ed448",
567 "ExpectedServerSignType" => "Ed448",
568 "ExpectedResult" => "Success"
572 name => "TLS 1.3 Ed25519 CipherString and Groups Selection",
573 server => $server_tls_1_3,
575 "SignatureAlgorithms" => "ECDSA+SHA256:ed25519",
576 # Excluding P-256 from the supported groups list should
577 # mean server still uses a P-256 certificate because supported
578 # groups is not used in signature selection for TLS 1.3
582 "ExpectedServerCertType" =>, "P-256",
583 "ExpectedServerSignType" =>, "EC",
584 "ExpectedResult" => "Success"
588 name => "TLS 1.3 Ed448 CipherString and Groups Selection",
589 server => $server_tls_1_3,
591 "SignatureAlgorithms" => "ECDSA+SHA256:ed448",
592 # Excluding P-256 from the supported groups list should
593 # mean server still uses a P-256 certificate because supported
594 # groups is not used in signature selection for TLS 1.3
598 "ExpectedServerCertType" =>, "P-256",
599 "ExpectedServerSignType" =>, "EC",
600 "ExpectedResult" => "Success"
604 name => "TLS 1.3 RSA Client Auth Signature Algorithm Selection",
606 "ClientSignatureAlgorithms" => "PSS+SHA256",
607 "VerifyCAFile" => test_pem("root-cert.pem"),
608 "VerifyMode" => "Require"
610 client => $client_tls_1_3,
612 "ExpectedClientCertType" => "RSA",
613 "ExpectedClientSignHash" => "SHA256",
614 "ExpectedClientSignType" => "RSA-PSS",
615 "ExpectedClientCANames" => "empty",
616 "ExpectedResult" => "Success"
620 name => "TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names",
622 "ClientSignatureAlgorithms" => "PSS+SHA256",
623 "VerifyCAFile" => test_pem("root-cert.pem"),
624 "RequestCAFile" => test_pem("root-cert.pem"),
625 "VerifyMode" => "Require"
627 client => $client_tls_1_3,
629 "ExpectedClientCertType" => "RSA",
630 "ExpectedClientSignHash" => "SHA256",
631 "ExpectedClientSignType" => "RSA-PSS",
632 "ExpectedClientCANames" => test_pem("root-cert.pem"),
633 "ExpectedResult" => "Success"
637 name => "TLS 1.3 ECDSA Client Auth Signature Algorithm Selection",
639 "ClientSignatureAlgorithms" => "ECDSA+SHA256",
640 "VerifyCAFile" => test_pem("root-cert.pem"),
641 "VerifyMode" => "Require"
643 client => $client_tls_1_3,
645 "ExpectedClientCertType" => "P-256",
646 "ExpectedClientSignHash" => "SHA256",
647 "ExpectedClientSignType" => "EC",
648 "ExpectedResult" => "Success"
652 name => "TLS 1.3 Ed25519 Client Auth",
654 "VerifyCAFile" => test_pem("root-cert.pem"),
655 "VerifyMode" => "Require"
658 "EdDSA.Certificate" => test_pem("client-ed25519-cert.pem"),
659 "EdDSA.PrivateKey" => test_pem("client-ed25519-key.pem"),
660 "MinProtocol" => "TLSv1.3",
661 "MaxProtocol" => "TLSv1.3"
664 "ExpectedClientCertType" => "Ed25519",
665 "ExpectedClientSignType" => "Ed25519",
666 "ExpectedResult" => "Success"
670 name => "TLS 1.3 Ed448 Client Auth",
672 "VerifyCAFile" => test_pem("root-cert.pem"),
673 "VerifyMode" => "Require"
676 "EdDSA.Certificate" => test_pem("client-ed448-cert.pem"),
677 "EdDSA.PrivateKey" => test_pem("client-ed448-key.pem"),
678 "MinProtocol" => "TLSv1.3",
679 "MaxProtocol" => "TLSv1.3"
682 "ExpectedClientCertType" => "Ed448",
683 "ExpectedClientSignType" => "Ed448",
684 "ExpectedResult" => "Success"
689 push @tests, @tests_tls_1_3 unless disabled("tls1_3");
691 my @tests_dsa_tls_1_2 = (
693 name => "TLS 1.2 DSA Certificate Test",
695 "DSA.Certificate" => test_pem("server-dsa-cert.pem"),
696 "DSA.PrivateKey" => test_pem("server-dsa-key.pem"),
697 "DHParameters" => test_pem("dhp2048.pem"),
698 "MinProtocol" => "TLSv1.2",
699 "MaxProtocol" => "TLSv1.2",
700 "CipherString" => "ALL",
703 "SignatureAlgorithms" => "DSA+SHA256:DSA+SHA1",
704 "CipherString" => "ALL",
707 "ExpectedResult" => "Success"
712 my @tests_dsa_tls_1_3 = (
714 name => "TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms",
716 "ClientSignatureAlgorithms" => "ECDSA+SHA1:DSA+SHA256:RSA+SHA256",
717 "VerifyCAFile" => test_pem("root-cert.pem"),
718 "VerifyMode" => "Request"
722 "ExpectedResult" => "ServerFail"
726 name => "TLS 1.3 DSA Certificate Test",
728 "DSA.Certificate" => test_pem("server-dsa-cert.pem"),
729 "DSA.PrivateKey" => test_pem("server-dsa-key.pem"),
730 "MinProtocol" => "TLSv1.3",
731 "MaxProtocol" => "TLSv1.3",
732 "CipherString" => "ALL",
735 "SignatureAlgorithms" => "DSA+SHA1:DSA+SHA256:ECDSA+SHA256",
736 "CipherString" => "ALL",
739 "ExpectedResult" => "ServerFail"
744 if (!disabled("dsa")) {
745 push @tests, @tests_dsa_tls_1_2 unless disabled("dh");
746 push @tests, @tests_dsa_tls_1_3 unless disabled("tls1_3");