14-curves.cnf.in 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # -*- mode: perl; -*-
  2. ## SSL test configurations
  3. package ssltests;
  4. use strict;
  5. use warnings;
  6. use OpenSSL::Test;
  7. use OpenSSL::Test::Utils qw(anydisabled);
  8. our $fips_mode;
  9. my @curves = ("prime256v1", "secp384r1", "secp521r1", "X25519",
  10. "X448");
  11. my @curves_tls_1_2 = ("sect233k1", "sect233r1",
  12. "sect283k1", "sect283r1", "sect409k1", "sect409r1",
  13. "sect571k1", "sect571r1", "secp224r1");
  14. my @curves_non_fips = ("sect163k1", "sect163r2", "prime192v1",
  15. "sect163r1", "sect193r1", "sect193r2", "sect239k1",
  16. "secp160k1", "secp160r1", "secp160r2", "secp192k1",
  17. "secp224k1", "secp256k1", "brainpoolP256r1",
  18. "brainpoolP384r1", "brainpoolP512r1");
  19. push @curves_tls_1_2, @curves_non_fips if !$fips_mode;
  20. our @tests = ();
  21. sub generate_tests() {
  22. foreach (0..$#curves) {
  23. my $curve = $curves[$_];
  24. push @tests, {
  25. name => "curve-${curve}",
  26. server => {
  27. "Curves" => $curve,
  28. "MaxProtocol" => "TLSv1.3"
  29. },
  30. client => {
  31. "CipherString" => "ECDHE",
  32. "MaxProtocol" => "TLSv1.3",
  33. "Curves" => $curve
  34. },
  35. test => {
  36. "ExpectedTmpKeyType" => $curve,
  37. "ExpectedProtocol" => "TLSv1.3",
  38. "ExpectedResult" => "Success"
  39. },
  40. };
  41. }
  42. foreach (0..$#curves_tls_1_2) {
  43. my $curve = $curves_tls_1_2[$_];
  44. push @tests, {
  45. name => "curve-${curve}",
  46. server => {
  47. "Curves" => $curve,
  48. "MaxProtocol" => "TLSv1.3"
  49. },
  50. client => {
  51. "CipherString" => "ECDHE",
  52. "MaxProtocol" => "TLSv1.2",
  53. "Curves" => $curve
  54. },
  55. test => {
  56. "ExpectedTmpKeyType" => $curve,
  57. "ExpectedProtocol" => "TLSv1.2",
  58. "ExpectedResult" => "Success"
  59. },
  60. };
  61. }
  62. foreach (0..$#curves_tls_1_2) {
  63. my $curve = $curves_tls_1_2[$_];
  64. push @tests, {
  65. name => "curve-${curve}-tls13",
  66. server => {
  67. "Curves" => $curve,
  68. "MaxProtocol" => "TLSv1.3"
  69. },
  70. client => {
  71. "CipherString" => "ECDHE",
  72. "MinProtocol" => "TLSv1.3",
  73. "Curves" => $curve
  74. },
  75. test => {
  76. "ExpectedResult" => "ClientFail"
  77. },
  78. };
  79. }
  80. }
  81. generate_tests();