Skip to content

Commit ee5af88

Browse files
samuel40791765matzbot
authored andcommitted
[ruby/openssl] test_bn.rb: AWS-LC does not support BN::CONSTTIME
AWS-LC does not support BN_FLG_CONSTTIME due to its historically inconsistent constant-time guarantees. ruby/openssl@9875a01b5f
1 parent f14995e commit ee5af88

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/openssl/test_bn.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ def test_argument_error
321321
end
322322

323323
def test_get_flags_and_set_flags
324+
return if aws_lc? # AWS-LC does not support BN::CONSTTIME.
325+
324326
e = OpenSSL::BN.new(999)
325327

326328
assert_equal(0, e.get_flags(OpenSSL::BN::CONSTTIME))
@@ -364,7 +366,9 @@ def test_ractor
364366
assert_equal(true, Ractor.new(@e2) { _1.negative? }.take)
365367
assert_include(128..255, Ractor.new { OpenSSL::BN.rand(8)}.take)
366368
assert_include(0...2**32, Ractor.new { OpenSSL::BN.generate_prime(32) }.take)
367-
assert_equal(0, Ractor.new { OpenSSL::BN.new(999).get_flags(OpenSSL::BN::CONSTTIME) }.take)
369+
if !aws_lc? # AWS-LC does not support BN::CONSTTIME.
370+
assert_equal(0, Ractor.new { OpenSSL::BN.new(999).get_flags(OpenSSL::BN::CONSTTIME) }.take)
371+
end
368372
# test if shareable when frozen
369373
assert Ractor.shareable?(@e1.freeze)
370374
end

0 commit comments

Comments
 (0)