aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-09-24 12:59:54 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-09-24 13:03:21 +0900
commit45bec388132a156471be5fae9713bcc7ea65530b (patch)
tree58af4037e2c4cb14c0cfe9fa0c1f33fa004aaaba
parent8c4bf53262d9a2d21641f1bb6eaf352424f648b7 (diff)
downloadruby-openssl-45bec388132a156471be5fae9713bcc7ea65530b.tar.gz
test/test_engine: check if RC4 is supported
Skip test_openssl_engine_cipher_rc4 which will fail without RC4 support. It may be disabled by 'no-rc4' configure option of the OpenSSL library. Reference: https://github.com/ruby/openssl/issues/154
-rw-r--r--test/test_engine.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/test_engine.rb b/test/test_engine.rb
index ee1ebb33..801d1c8e 100644
--- a/test/test_engine.rb
+++ b/test/test_engine.rb
@@ -52,9 +52,15 @@ class OpenSSL::TestEngine < OpenSSL::TestCase
end
def test_openssl_engine_cipher_rc4
+ begin
+ OpenSSL::Cipher.new("rc4")
+ rescue OpenSSL::Cipher::CipherError
+ pend "RC4 is not supported"
+ end
+
with_openssl(<<-'end;', ignore_stderr: true)
engine = get_engine
- algo = "RC4" #AES is not supported by openssl Engine (<=1.0.0e)
+ algo = "RC4"
data = "a" * 1000
key = OpenSSL::Random.random_bytes(16)
encrypted = crypt_data(data, key, :encrypt) { engine.cipher(algo) }