Skip to content

Commit 0b5ae0f

Browse files
jeremyevansrhenium
authored andcommitted
Skip one assertion for OpenSSL::PKey::EC::Point#mul on LibreSSL
[ Original commit is 4e9801d in 2.2.0. This is a backport to the 2.1 branch. ] LibreSSL 2.8.0+ does not support multiple elements in the first argument.
1 parent ec65428 commit 0b5ae0f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/test_pkey_ec.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,14 @@ def test_ec_point_mul
309309
result_b1 = point_a.mul([3], [])
310310
assert_equal B(%w{ 04 10 0D }), result_b1.to_octet_string(:uncompressed)
311311
# 3 * point_a + 2 * point_a = 3 * (6, 3) + 2 * (6, 3) = (7, 11)
312-
result_b1 = point_a.mul([3, 2], [point_a])
313-
assert_equal B(%w{ 04 07 0B }), result_b1.to_octet_string(:uncompressed)
312+
begin
313+
result_b1 = point_a.mul([3, 2], [point_a])
314+
rescue OpenSSL::PKey::EC::Point::Error
315+
# LibreSSL doesn't support multiple entries in first argument
316+
raise if $!.message !~ /called a function you should not call/
317+
else
318+
assert_equal B(%w{ 04 07 0B }), result_b1.to_octet_string(:uncompressed)
319+
end
314320
# 3 * point_a + 5 * point_a.group.generator = 3 * (6, 3) + 5 * (5, 1) = (13, 10)
315321
result_b1 = point_a.mul([3], [], 5)
316322
assert_equal B(%w{ 04 0D 0A }), result_b1.to_octet_string(:uncompressed)

0 commit comments

Comments
 (0)