summaryrefslogtreecommitdiffstats
path: root/test/openssl
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-27 02:54:46 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-27 02:54:46 +0000
commitd331a2812f3ee81b8f03377e6612616ddb4080b9 (patch)
tree1be7822a0047925b31d7549df47ff535e3b69793 /test/openssl
parent3cbe548093a46eaec53f73859545010083593baf (diff)
merges r25017 from trunk into ruby_1_9_1 and a test for it.
-- * ossl_config.c (ossl_config_add_value_m, ossl_config_set_section): Check if frozen (or untrusted for $SECURE >= 4) [ruby-core:18377] -- * test/openssl/test_config.rb (OpenSSL::TestConfig): new test case. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@25945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl')
-rw-r--r--test/openssl/test_config.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/openssl/test_config.rb b/test/openssl/test_config.rb
new file mode 100644
index 000000000..9578bb254
--- /dev/null
+++ b/test/openssl/test_config.rb
@@ -0,0 +1,15 @@
+require 'openssl'
+require "test/unit"
+
+class OpenSSL::TestConfig < Test::Unit::TestCase
+ def test_freeze
+ c = OpenSSL::Config.new
+ c['foo'] = [['key', 'value']]
+ c.freeze
+
+ # [ruby-core:18377]
+ assert_raise(RuntimeError, /frozen/) do
+ c['foo'] = [['key', 'wrong']]
+ end
+ end
+end