generated from chef/oss_project_boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build OpenSSL 3.0.9 with FIPS (1.0.2zi for Windows)
* add FIPS validation for Windows and non-Windows * add tests for openssl and FIPS Signed-off-by: Thomas Powell <[email protected]>
- Loading branch information
1 parent
48daca2
commit 81d1b23
Showing
11 changed files
with
246 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
require "chefstyle" | ||
require "rubocop/rake_task" | ||
desc " Run ChefStyle" | ||
RuboCop::RakeTask.new(:chefstyle) do |task| | ||
task.options << "--display-cop-names" | ||
task.options << "config" | ||
# not loaded on msys devkit | ||
unless RUBY_PLATFORM.include?('mingw') | ||
require "rubocop/rake_task" | ||
require "cookstyle/chefstyle" | ||
|
||
desc "Run ChefStyle" | ||
RuboCop::RakeTask.new(:chefstyle) do |task| | ||
task.options << "--display-cop-names" | ||
task.options << "config" | ||
end | ||
end | ||
|
||
require "rake/testtask" | ||
|
||
desc "Run tests" | ||
Rake::TestTask.new do |t| | ||
t.libs << "test" | ||
t.test_files = FileList["test/**/*_test.rb"] | ||
t.warning = true | ||
t.verbose = false | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# frozen_string_literal: true | ||
require 'minitest/autorun' | ||
require 'openssl' | ||
|
||
class FipsTest < Minitest::Test | ||
def test_sha256 | ||
sha256 = OpenSSL::Digest.new('SHA256') | ||
sha256 << 'test' | ||
|
||
# just invoke the digest method to make sure it doesn't crash | ||
sha256.digest | ||
end | ||
|
||
def make_md5 | ||
md5 = OpenSSL::Digest.new('MD5') | ||
md5 << 'test' | ||
md5.digest | ||
end | ||
def test_md5 | ||
if ENV['OMNIBUS_FIPS_MODE'].to_s.casecmp('true').zero? | ||
# this will raise an exception if FIPS mode support not available | ||
OpenSSL.fips_mode = true | ||
|
||
assert_raises OpenSSL::Digest::DigestError do | ||
make_md5 | ||
end | ||
end | ||
|
||
OpenSSL.fips_mode = false | ||
# if md5 raises an exception with FIPS off, then something's wrong | ||
make_md5 | ||
end | ||
end |
Oops, something went wrong.