Skip to content

Commit

Permalink
Refactoring: Use unless over if for negative conditions for aws_lc?.
Browse files Browse the repository at this point in the history
  • Loading branch information
junaruga committed Feb 24, 2025
1 parent 1457c99 commit 0cebb0e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/openssl/test_bn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def test_ractor
assert_equal(true, Ractor.new(@e2) { _1.negative? }.take)
assert_include(128..255, Ractor.new { OpenSSL::BN.rand(8)}.take)
assert_include(0...2**32, Ractor.new { OpenSSL::BN.generate_prime(32) }.take)
if !aws_lc? # AWS-LC does not support BN::CONSTTIME.
unless aws_lc? # AWS-LC does not support BN::CONSTTIME.
assert_equal(0, Ractor.new { OpenSSL::BN.new(999).get_flags(OpenSSL::BN::CONSTTIME) }.take)
end
# test if shareable when frozen
Expand Down
2 changes: 1 addition & 1 deletion test/openssl/test_pkey_dh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_new_generate
end if ENV["OSSL_TEST_ALL"]

def test_new_break_on_non_fips
omit_on_fips if !aws_lc?
omit_on_fips unless aws_lc?

assert_nil(OpenSSL::PKey::DH.new(NEW_KEYLEN) { break })
assert_raise(RuntimeError) do
Expand Down
2 changes: 1 addition & 1 deletion test/openssl/test_ssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,7 @@ def test_get_ephemeral_key
end
end

if !aws_lc? # AWS-LC does not support DHE ciphersuites.
unless aws_lc? # AWS-LC does not support DHE ciphersuites.
# DHE
# TODO: SSL_CTX_set1_groups() is required for testing this with TLS 1.3
ctx_proc2 = proc { |ctx|
Expand Down

0 comments on commit 0cebb0e

Please sign in to comment.