01-test_fipsmodule_cnf.t 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #! /usr/bin/env perl
  2. # Copyright 2021 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. # This is a sanity checker to see that the fipsmodule.cnf that's been
  9. # generated for testing is valid.
  10. use strict;
  11. use warnings;
  12. use OpenSSL::Test qw/:DEFAULT srctop_dir bldtop_dir bldtop_file srctop_file data_file/;
  13. use OpenSSL::Test::Utils;
  14. BEGIN {
  15. setup("test_fipsmodule");
  16. }
  17. use lib srctop_dir('Configurations');
  18. use lib bldtop_dir('.');
  19. use platform;
  20. my $no_check = disabled("fips");
  21. plan skip_all => "Test only supported in a fips build"
  22. if $no_check;
  23. plan tests => 1;
  24. my $fipsmodule = bldtop_file('providers', platform->dso('fips'));
  25. my $fipsmoduleconf = bldtop_file('test', 'fipsmodule.cnf');
  26. # verify the $fipsconf file
  27. ok(run(app(['openssl', 'fipsinstall',
  28. '-in', $fipsmoduleconf, '-module', $fipsmodule, '-verify'])),
  29. "fipsinstall verify");