-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fips_mode_get to return fips_mode #125
Conversation
test/test_fips.rb
Outdated
OpenSSL.fips_mode == true | ||
OpenSSL.fips_mode = false | ||
OpenSSL.fips_mode == false | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not testing. Also, the mode can not necessarily be switched at runtime. I think all we can do here is:
assert OpenSSL.fips_mode == true || OpenSSL.fips_mode == false,
".fips_mode returns a boolean value"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update, but when can the mode not be changed at runtime? Tested locally with fips enabled by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, nevermind, my memory tricked me.
test/test_fips.rb
Outdated
assert OpenSSL.fips_mode == true, ".fips_mode returns true when .fips_mode=true" | ||
|
||
OpenSSL.fips_mode = false | ||
assert OpenSSL.fips_mode == false, ".fips_mode returns false when .fips_mode=false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing spaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, rough start of the day :)
Thanks, this now looks good to me. Can you squash them into one commit? |
0a02925
to
2958067
Compare
Yeppers, squashed. Thanks! Now off to bundler :) |
OpenSSL::OPENSSL_FIPS
causes confusion as the doc states it returns a boolean based on if FIPS is 'enabled' which isn't true. It is dependent on whether the openssl installed was built with FOM (fips object module). If it was then it will always returns true (even whenfips_mode = false
), thus it is more accurate to say FIPS-capable.Adding
OpenSSL.fips_mode
to return whether or not fips_mode is currently set. This allows for better handling around fips mode.