diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-15 04:34:29 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-15 04:34:29 +0000 |
commit | 13f33b22e129faf55cf3625b642f665f98db736e (patch) | |
tree | c798682a4087ee0d07e7fbaae138e71fd7f78f3a /test/openssl | |
parent | 33e39a76578517f0eb70f538e032c8dfc3416173 (diff) | |
download | ruby-13f33b22e129faf55cf3625b642f665f98db736e.tar.gz |
ossl_ssl.c: check SSL method name
* ext/openssl/ossl_ssl.c (ossl_sslctx_set_ssl_version): SSL method
name must not contain NUL. preserve the encoding of message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl')
-rw-r--r-- | test/openssl/test_ssl.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb index c08842ac5e..55dc518aa6 100644 --- a/test/openssl/test_ssl.rb +++ b/test/openssl/test_ssl.rb @@ -10,6 +10,16 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase assert_equal(ctx.setup, nil) end + def test_ctx_setup_invalid + m = OpenSSL::SSL::SSLContext::METHODS.first + assert_raise_with_message(ArgumentError, /null/) { + OpenSSL::SSL::SSLContext.new("#{m}\0") + } + assert_raise_with_message(ArgumentError, /\u{ff33 ff33 ff2c}/) { + OpenSSL::SSL::SSLContext.new("\u{ff33 ff33 ff2c}") + } + end + def test_options_defaults_to_OP_ALL ctx = OpenSSL::SSL::SSLContext.new assert_equal OpenSSL::SSL::OP_ALL, ctx.options |