28-seclevel.conf.in 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # -*- mode: perl; -*-
  2. # Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
  3. #
  4. # Licensed under the OpenSSL license (the "License"). You may not use
  5. # this file except in compliance with the License. You can obtain a copy
  6. # in the file LICENSE in the source distribution or at
  7. # https://www.openssl.org/source/license.html
  8. ## SSL test configurations
  9. package ssltests;
  10. use OpenSSL::Test::Utils;
  11. our @tests = (
  12. {
  13. name => "SECLEVEL 3 with default key",
  14. server => { "CipherString" => "DEFAULT:\@SECLEVEL=3" },
  15. client => { },
  16. test => { "ExpectedResult" => "ServerFail" },
  17. },
  18. );
  19. our @tests_ec = (
  20. {
  21. name => "SECLEVEL 4 with ED448 key",
  22. server => { "CipherString" => "DEFAULT:\@SECLEVEL=4",
  23. "Certificate" => test_pem("server-ed448-cert.pem"),
  24. "PrivateKey" => test_pem("server-ed448-key.pem") },
  25. client => { "CipherString" => "DEFAULT:\@SECLEVEL=4",
  26. "VerifyCAFile" => test_pem("root-ed448-cert.pem") },
  27. test => { "ExpectedResult" => "Success" },
  28. },
  29. {
  30. # The Ed488 signature algorithm will not be enabled.
  31. # Because of the config order, the certificate is first loaded, and
  32. # then the security level is chaged. If you try this with s_server
  33. # the order will be reversed and it will instead fail to load the key.
  34. name => "SECLEVEL 5 server with ED448 key",
  35. server => { "CipherString" => "DEFAULT:\@SECLEVEL=5",
  36. "Certificate" => test_pem("server-ed448-cert.pem"),
  37. "PrivateKey" => test_pem("server-ed448-key.pem") },
  38. client => { "CipherString" => "DEFAULT:\@SECLEVEL=4",
  39. "VerifyCAFile" => test_pem("root-ed448-cert.pem") },
  40. test => { "ExpectedResult" => "ServerFail" },
  41. },
  42. {
  43. # The client will not sent the Ed488 signature algorithm, so the server
  44. # doesn't have a useable signature algorithm for the certificate.
  45. name => "SECLEVEL 5 client with ED448 key",
  46. server => { "CipherString" => "DEFAULT:\@SECLEVEL=4",
  47. "Certificate" => test_pem("server-ed448-cert.pem"),
  48. "PrivateKey" => test_pem("server-ed448-key.pem") },
  49. client => { "CipherString" => "DEFAULT:\@SECLEVEL=5",
  50. "VerifyCAFile" => test_pem("root-ed448-cert.pem") },
  51. test => { "ExpectedResult" => "ServerFail" },
  52. },
  53. {
  54. name => "SECLEVEL 3 with P-384 key, X25519 ECDHE",
  55. server => { "CipherString" => "DEFAULT:\@SECLEVEL=3",
  56. "Certificate" => test_pem("p384-server-cert.pem"),
  57. "PrivateKey" => test_pem("p384-server-key.pem"),
  58. "Groups" => "X25519" },
  59. client => { "CipherString" => "ECDHE:\@SECLEVEL=3",
  60. "VerifyCAFile" => test_pem("p384-root.pem") },
  61. test => { "ExpectedResult" => "Success" },
  62. },
  63. );
  64. our @tests_tls1_2 = (
  65. {
  66. name => "SECLEVEL 3 with ED448 key, TLSv1.2",
  67. server => { "CipherString" => "DEFAULT:\@SECLEVEL=3",
  68. "Certificate" => test_pem("server-ed448-cert.pem"),
  69. "PrivateKey" => test_pem("server-ed448-key.pem"),
  70. "MaxProtocol" => "TLSv1.2" },
  71. client => { "VerifyCAFile" => test_pem("root-ed448-cert.pem") },
  72. test => { "ExpectedResult" => "Success" },
  73. },
  74. );
  75. push @tests, @tests_ec unless disabled("ec");
  76. push @tests, @tests_tls1_2 unless disabled("tls1_2") || disabled("ec");