Skip to content

Commit

Permalink
Merge pull request ruby#666 from junaruga/wip/rake-print-fips
Browse files Browse the repository at this point in the history
Rakefile: Print FIPS information in the `rake debug`.
  • Loading branch information
rhenium committed Aug 24, 2023
2 parents fe7612f + 61434f6 commit 8273416
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ jobs:
# TODO Fix other tests, and run all the tests on FIPS mode.
- name: test on fips mode
run: |
ruby -I./lib -ropenssl \
bundle exec rake debug &&
ruby -I./lib -ropenssl \
-e 'Dir.glob "./test/openssl/{test_fips.rb,test_pkey.rb}", &method(:require)'
if: matrix.fips-enabled
4 changes: 4 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@ task :debug do
openssl_version_number_str = OpenSSL::OPENSSL_VERSION_NUMBER.to_s(16)
libressl_version_number_str = (defined? OpenSSL::LIBRESSL_VERSION_NUMBER) ?
OpenSSL::LIBRESSL_VERSION_NUMBER.to_s(16) : "undefined"
providers_str = (defined? OpenSSL::Provider) ?
OpenSSL::Provider.provider_names.join(", ") : "undefined"
puts <<~MESSAGE
OpenSSL::OPENSSL_VERSION: #{OpenSSL::OPENSSL_VERSION}
OpenSSL::OPENSSL_LIBRARY_VERSION: #{OpenSSL::OPENSSL_LIBRARY_VERSION}
OpenSSL::OPENSSL_VERSION_NUMBER: #{openssl_version_number_str}
OpenSSL::LIBRESSL_VERSION_NUMBER: #{libressl_version_number_str}
FIPS enabled: #{OpenSSL.fips_mode}
Providers: #{providers_str}
MESSAGE
EOF
ruby %Q(-I./lib -ropenssl -ve'#{ruby_code}')
Expand Down

0 comments on commit 8273416

Please sign in to comment.