summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-29 20:36:38 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-29 20:36:38 +0000
commit18f287a36de45edcd39541015b445ee0b954e7b1 (patch)
treed6afc15c97d97b7e5025d51a391d35d19b4162ef /test
parent53369d7e4dab675ede11b584ffc003e51ea62672 (diff)
backport additional fix memory leak from openssl upstream.
https://github.com/ruby/openssl/commit/e76f076f093efb93dabf2cb042c527500f956061 patches are provided by rhe (Kazuki Yamaguchi). * ext/openssl/ossl_x509ext.c: additional fix memory leak. [ruby-core:76922] [Bug #12680] * text/openssl/test_x509ext.rb: test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@56032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/openssl/test_x509ext.rb24
1 files changed, 15 insertions, 9 deletions
diff --git a/test/openssl/test_x509ext.rb b/test/openssl/test_x509ext.rb
index e6d49bb679..f2cce5cf4c 100644
--- a/test/openssl/test_x509ext.rb
+++ b/test/openssl/test_x509ext.rb
@@ -39,15 +39,15 @@ class OpenSSL::TestX509Extension < Test::Unit::TestCase
bc = ef.create_extension("basicConstraints", "CA:TRUE, pathlen:2", true)
assert_equal(@basic_constraints.to_der, bc.to_der)
- begin
- ef.config = OpenSSL::Config.parse(<<-_end_of_cnf_)
- [crlDistPts]
- URI.1 = http://www.example.com/crl
- URI.2 = ldap://ldap.example.com/cn=ca?certificateRevocationList;binary
- _end_of_cnf_
- rescue NotImplementedError
- return
- end
+ ef.config = OpenSSL::Config.parse(<<-_end_of_cnf_)
+ [crlDistPts]
+ URI.1 = http://www.example.com/crl
+ URI.2 = ldap://ldap.example.com/cn=ca?certificateRevocationList;binary
+
+ [certPolicies]
+ policyIdentifier = 2.23.140.1.2.1
+ CPS.1 = http://cps.example.com
+ _end_of_cnf_
cdp = ef.create_extension("crlDistributionPoints", "@crlDistPts")
assert_equal(false, cdp.critical?)
@@ -64,6 +64,12 @@ class OpenSSL::TestX509Extension < Test::Unit::TestCase
assert_match(
%r{URI:ldap://ldap.example.com/cn=ca\?certificateRevocationList;binary},
cdp.value)
+
+ cp = ef.create_extension("certificatePolicies", "@certPolicies")
+ assert_equal(false, cp.critical?)
+ assert_equal("certificatePolicies", cp.oid)
+ assert_match(%r{2.23.140.1.2.1}, cp.value)
+ assert_match(%r{http://cps.example.com}, cp.value)
end
end