90-test_gost.t 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #! /usr/bin/env perl
  2. # Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License 2.0 (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. use OpenSSL::Test::Utils;
  9. use OpenSSL::Test qw/:DEFAULT srctop_file/;
  10. setup("test_gost");
  11. # The GOST ciphers are dynamically loaded via the GOST engine, so we must be
  12. # able to support that. The engine also uses DSA, CMS and CMAC symbols, so we
  13. # skip this test on no-dsa, no-cms or no-cmac.
  14. plan skip_all => "GOST support is disabled in this OpenSSL build"
  15. if disabled("gost") || disabled("engine") || disabled("dynamic-engine")
  16. || disabled("dsa") || disabled("cms") || disabled("cmac");
  17. plan skip_all => "TLSv1.3 or TLSv1.2 are disabled in this OpenSSL build"
  18. if disabled("tls1_3") || disabled("tls1_2");
  19. plan skip_all => "EC is disabled in this OpenSSL build"
  20. if disabled("ec");
  21. #Gost engine uses some deprecated functions
  22. plan skip_all => "Deprecated functions are disabled in this OpenSSL build"
  23. if disabled("deprecated");
  24. plan skip_all => "No test GOST engine found"
  25. if !$ENV{OPENSSL_GOST_ENGINE_SO};
  26. plan tests => 1;
  27. $ENV{OPENSSL_CONF} = srctop_file("test", "recipes", "90-test_gost_data",
  28. "gost.cnf");
  29. ok(run(test(["gosttest",
  30. srctop_file("test", "recipes", "90-test_gost_data",
  31. "server-cert2001.pem"),
  32. srctop_file("test", "recipes", "90-test_gost_data",
  33. "server-key2001.pem"),
  34. srctop_file("test", "recipes", "90-test_gost_data",
  35. "server-cert2012.pem"),
  36. srctop_file("test", "recipes", "90-test_gost_data",
  37. "server-key2012.pem")])),
  38. "running gosttest");