diff options
author | rhe <rhe@ruby-lang.org> | 2016-06-05 12:38:34 +0000 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2016-06-09 15:05:21 +0900 |
commit | 77b48503423a9ed94e64e3ba8c541a9e439f2dd7 (patch) | |
tree | d7f91c75bc7ab95a5645df03a7081d26904901ed /test/test_random.rb | |
parent | 3c582bba0c186564799d274be8a4d483f676291d (diff) | |
download | ruby-openssl-77b48503423a9ed94e64e3ba8c541a9e439f2dd7.tar.gz |
openssl: check existence of RAND_pseudo_bytes()
* ext/openssl/extconf.rb: Check if RAND_pseudo_bytes() is usable. It is
marked as deprecated in OpenSSL 1.1.0.
[ruby-core:75225] [Feature #12324]
* ext/openssl/ossl_rand.c: Disable Random.pseudo_bytes if
RAND_pseudo_bytes() is unavailable.
* test/openssl/test_random.rb: Don't test Random.pseudo_bytes if not
defined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_random.rb')
-rw-r--r-- | test/test_random.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/test_random.rb b/test/test_random.rb index ca8427f7..60794619 100644 --- a/test/test_random.rb +++ b/test/test_random.rb @@ -8,7 +8,8 @@ class OpenSSL::TestRandom < OpenSSL::TestCase end def test_pseudo_bytes + # deprecated as of OpenSSL 1.1.0 assert_equal("", OpenSSL::Random.pseudo_bytes(0)) assert_equal(12, OpenSSL::Random.pseudo_bytes(12).bytesize) - end + end if OpenSSL::Random.methods.include?(:pseudo_bytes) end if defined?(OpenSSL::TestCase) |