-
Notifications
You must be signed in to change notification settings - Fork 172
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
Improve implementations for skipping and conditions. #860
Conversation
Thanks! I noticed and really enjoyed the additional visibility
That would be awesome :). Triggering AWS-LC in FIPS mode is an additional |
…_FIPS. As OpenSSL::OPENSSL_FIPS always returns true on OpenSSL >= 3.0.0, we cannot use this constant as a flag to check whether the OpenSSL is FIPS or not. See <https://github.com/ruby/openssl/blob/d725783c5c180337f3d00efcba5b8744e0aea813/ext/openssl/ossl.c#L994-L1004>.
By using omit, we can see what tests are skipped in the test result.
13d1a89
to
669f1d4
Compare
All right!
Note I removed the following lines, and rebased the PR, and I confirmed that the
After we merge this PR, you can contribute the AWS-LC FIPS case on CI. I don't have a plan to contribute it by myself. By the way, in the OpenSSL upstream project, the term "FIPS mode" is used to enable FIPS in OS level. We use the term "FIPS module" to just enable OpenSSL library's FIPS. We are using the term in |
I'm not a fan of using For example, LibreSSL removed NPN support several years ago and they are not going to add it again. Seeing the 25 extra lines of output (5 tests, 5 lines each) every time I run On a related note, those NPN tests should probably be updated to use |
omit unless supported.include?(OpenSSL::SSL::TLS1_1_VERSION) && | ||
supported.include?(OpenSSL::SSL::TLS1_2_VERSION) |
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.
We can assume all libssl versions support TLS 1.2 and TLS 1.3, so a check for TLS 1.2 is no longer necessary. #841 overlooked this.
I agree an explicit omission would be useful here, since TLS 1.1 is not typically disabled, and this should be noted.
omit unless supported.include?(OpenSSL::SSL::TLS1_1_VERSION) && | |
supported.include?(OpenSSL::SSL::TLS1_2_VERSION) | |
omit "TLS 1.1 is required to run this test" unless supported.include?(OpenSSL::SSL::TLS1_1_VERSION) |
omit "LibreSSL and AWS-LC do not support OPENSSL_CONF" if libressl? || aws_lc? | ||
if libressl? || aws_lc? | ||
omit "LibreSSL and AWS-LC do not support OPENSSL_CONF" | ||
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.
Why is this changed?
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.
Sorry, this change is because the line length was more than 80 bytes. I didn't like it. I was working with a sleepy brain. I shouldn't include this change in this commit. I will revert this part.
return if libressl? | ||
if libressl? | ||
omit "LibreSSL 3.5.0+ doesn't support some wildcard certificates" | ||
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.
#861 is an alternative to this. This test case should run with LibreSSL too.
I was thinking you were positive about using the |
If |
I would close this PR, and will send another PR because the subject of the PR is now changing. |
I confirmed that
|
Really appreciate the help with fixing the FIPS portion of the AWS-LC test cases!
I had initially considered this, but the truth is our current FIPS release doesn't have support for Ruby integration. While we've recently added Ruby support to AWS-LC, it's only compatible with our latest releases. We're planning to validate these new changes as part of our upcoming AWS-LC FIPS v4.0.0 release. Once that validation is complete, we can revisit this. We'll keep you updated on our progress with the v4.0.0 validation. |
Cc: @samuel40791765
This PR has 3 commits and mainly improves the things I noticed in the #855.
The 1st commit is to replace
return
withomit
orpend
in the tests. I believe that theomit
andpend
are more useful thanreturn
in the tests. Because we can see the skipped tests and reasons in the testing log.Note that I think the part
pend "AWS-LC's FIPS mode is decided at compile time"
ispend
notomit
. The reason we have to skip the tests is there is only one AWS-LC case compiled with a non-FIPS option in CI. I assume that we can improve this part when we add one more AWS-LC case compiled with a FIPS option.The 2nd commit is to refactor the conditions from this perspective. I checked this PR on my forked branch. Especially the AWS-LC's skipping part in the testing result is here.
The 3rd commit is to fix a bug that the test
test_fips_mode_get_with_fips_mode_set
is not executed in OpenSSL 3.0 FIPS. According to the current implementation below, theOpenSSL::OPENSSL_FIPS
always returnstrue
on OpenSSL 3.0.0 and later versions. I checked the testtest_fips_mode_get_with_fips_mode_set
was executed on an OpenSSL 3 FIPS case, and skipped on an OpenSSL 3 non-FIPS case.openssl/ext/openssl/ossl.c
Lines 994 to 1004 in d725783