aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-05-24 21:32:37 -0700
committerKazuki Yamaguchi <k@rhe.jp>2020-08-12 18:33:49 +0900
commit0b5ae0f22b57f8232fbeb4751766abe99b222c6c (patch)
tree14a06fd52bb68830859a9ad72cee444ce0cfbb3e
parentec6542835874ca00e3a777334ee049b5b4cd02e4 (diff)
downloadruby-openssl-0b5ae0f22b57f8232fbeb4751766abe99b222c6c.tar.gz
Skip one assertion for OpenSSL::PKey::EC::Point#mul on LibreSSL
[ Original commit is 4e9801dff855 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.
-rw-r--r--test/test_pkey_ec.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/test_pkey_ec.rb b/test/test_pkey_ec.rb
index dc5a14e6..95b5a642 100644
--- a/test/test_pkey_ec.rb
+++ b/test/test_pkey_ec.rb
@@ -309,8 +309,14 @@ class OpenSSL::TestEC < OpenSSL::PKeyTestCase
result_b1 = point_a.mul([3], [])
assert_equal B(%w{ 04 10 0D }), result_b1.to_octet_string(:uncompressed)
# 3 * point_a + 2 * point_a = 3 * (6, 3) + 2 * (6, 3) = (7, 11)
- result_b1 = point_a.mul([3, 2], [point_a])
- assert_equal B(%w{ 04 07 0B }), result_b1.to_octet_string(:uncompressed)
+ begin
+ result_b1 = point_a.mul([3, 2], [point_a])
+ rescue OpenSSL::PKey::EC::Point::Error
+ # LibreSSL doesn't support multiple entries in first argument
+ raise if $!.message !~ /called a function you should not call/
+ else
+ assert_equal B(%w{ 04 07 0B }), result_b1.to_octet_string(:uncompressed)
+ end
# 3 * point_a + 5 * point_a.group.generator = 3 * (6, 3) + 5 * (5, 1) = (13, 10)
result_b1 = point_a.mul([3], [], 5)
assert_equal B(%w{ 04 0D 0A }), result_b1.to_octet_string(:uncompressed)