[前][次][番号順一覧][スレッド一覧]

ruby-changes:43959

From: nagachika <ko1@a...>
Date: Tue, 30 Aug 2016 05:36:43 +0900 (JST)
Subject: [ruby-changes:43959] nagachika:r56032 (ruby_2_3): backport additional fix memory leak from openssl upstream.

nagachika	2016-08-30 05:36:38 +0900 (Tue, 30 Aug 2016)

  New Revision: 56032

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56032

  Log:
    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.

  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/ext/openssl/ossl_x509ext.c
    branches/ruby_2_3/test/openssl/test_x509ext.rb
    branches/ruby_2_3/version.h
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 56031)
+++ ruby_2_3/version.h	(revision 56032)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.2"
-#define RUBY_RELEASE_DATE "2016-08-28"
-#define RUBY_PATCHLEVEL 181
+#define RUBY_RELEASE_DATE "2016-08-30"
+#define RUBY_PATCHLEVEL 182
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 8
-#define RUBY_RELEASE_DAY 28
+#define RUBY_RELEASE_DAY 30
 
 #include "ruby/version.h"
 
Index: ruby_2_3/test/openssl/test_x509ext.rb
===================================================================
--- ruby_2_3/test/openssl/test_x509ext.rb	(revision 56031)
+++ ruby_2_3/test/openssl/test_x509ext.rb	(revision 56032)
@@ -39,15 +39,15 @@ class OpenSSL::TestX509Extension < Test: https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/openssl/test_x509ext.rb#L39
     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: https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/openssl/test_x509ext.rb#L64
     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
 
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 56031)
+++ ruby_2_3/ChangeLog	(revision 56032)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Tue Aug 30 05:24:33 2016  Kazuki Yamaguchi  <k@r...>
+
+	* ext/openssl/ossl_x509ext.c: additional fix memory leak.
+	  [ruby-core:76922] [Bug #12680]
+
+	* text/openssl/test_x509ext.rb: test for above.
+
 Sun Aug 28 00:26:58 2016  CHIKANAGA Tomoyuki  <nagachika@r...>
 
 	* vm_method.c: revert r55869. it breaks Integer#days with
Index: ruby_2_3/ext/openssl/ossl_x509ext.c
===================================================================
--- ruby_2_3/ext/openssl/ossl_x509ext.c	(revision 56031)
+++ ruby_2_3/ext/openssl/ossl_x509ext.c	(revision 56032)
@@ -247,7 +247,9 @@ ossl_x509extfactory_create_ext(int argc, https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/openssl/ossl_x509ext.c#L247
 #ifdef HAVE_X509V3_EXT_NCONF_NID
     rconf = rb_iv_get(self, "@config");
     conf = NIL_P(rconf) ? NULL : DupConfigPtr(rconf);
+    X509V3_set_nconf(ctx, conf);
     ext = X509V3_EXT_nconf_nid(conf, ctx, nid, RSTRING_PTR(valstr));
+    X509V3_set_ctx_nodb(ctx);
     NCONF_free(conf);
 #else
     if (!empty_lhash) empty_lhash = lh_new(NULL, NULL);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]