From ee5af8860f15485745a8e37c19f28704e94be7bd Mon Sep 17 00:00:00 2001 From: Samuel Chiang Date: Wed, 12 Feb 2025 01:13:38 +0000 Subject: [PATCH] [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. https://github.com/ruby/openssl/commit/9875a01b5f --- test/openssl/test_bn.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/openssl/test_bn.rb b/test/openssl/test_bn.rb index 1217f250a7..5b68544574 100644 --- a/test/openssl/test_bn.rb +++ b/test/openssl/test_bn.rb @@ -321,6 +321,8 @@ class OpenSSL::TestBN < OpenSSL::TestCase end def test_get_flags_and_set_flags + return if aws_lc? # AWS-LC does not support BN::CONSTTIME. + e = OpenSSL::BN.new(999) assert_equal(0, e.get_flags(OpenSSL::BN::CONSTTIME)) @@ -364,7 +366,9 @@ class OpenSSL::TestBN < OpenSSL::TestCase 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) - assert_equal(0, Ractor.new { OpenSSL::BN.new(999).get_flags(OpenSSL::BN::CONSTTIME) }.take) + if !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 assert Ractor.shareable?(@e1.freeze) end