Skip to content

Commit 45bec38

Browse files
committed
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: #154
1 parent 8c4bf53 commit 45bec38

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/test_engine.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,15 @@ def test_openssl_engine_digest_sha1
5252
end
5353

5454
def test_openssl_engine_cipher_rc4
55+
begin
56+
OpenSSL::Cipher.new("rc4")
57+
rescue OpenSSL::Cipher::CipherError
58+
pend "RC4 is not supported"
59+
end
60+
5561
with_openssl(<<-'end;', ignore_stderr: true)
5662
engine = get_engine
57-
algo = "RC4" #AES is not supported by openssl Engine (<=1.0.0e)
63+
algo = "RC4"
5864
data = "a" * 1000
5965
key = OpenSSL::Random.random_bytes(16)
6066
encrypted = crypt_data(data, key, :encrypt) { engine.cipher(algo) }

0 commit comments

Comments
 (0)