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

ruby-changes:31407

From: usa <ko1@a...>
Date: Thu, 31 Oct 2013 23:32:05 +0900 (JST)
Subject: [ruby-changes:31407] usa:r43486 (ruby_1_9_3): merge revision(s) 41808: [Backport #9066]

usa	2013-10-31 23:31:52 +0900 (Thu, 31 Oct 2013)

  New Revision: 43486

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43486

  Log:
    merge revision(s) 41808: [Backport #9066]
    
    * ext/openssl/ossl_pkey_ec.c: Ensure compatibility to builds of
      OpenSSL with OPENSSL_NO_EC2M defined, but OPENSSL_NO_EC not
      defined.
    
    * test/openssl/test_pkey_ec.rb: Iterate over built-in curves
      (and assert their non-emptiness!) instead of hard-coding them, as
      this may cause problems with respect to the different availability
      of individual curves in individual OpenSSL builds.
      [ruby-core:54881] [Bug #8384]
      Thanks to Vit Ondruch for providing the patch!

  Modified directories:
    branches/ruby_1_9_3/
  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/ext/openssl/ossl_pkey_ec.c
    branches/ruby_1_9_3/test/openssl/test_pkey_ec.rb
    branches/ruby_1_9_3/version.h
Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 43485)
+++ ruby_1_9_3/ChangeLog	(revision 43486)
@@ -1,3 +1,16 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1
+Thu Oct 31 23:25:25 2013  Martin Bosslet  <Martin.Bosslet@g...>
+
+	* ext/openssl/ossl_pkey_ec.c: Ensure compatibility to builds of
+	  OpenSSL with OPENSSL_NO_EC2M defined, but OPENSSL_NO_EC not
+	  defined.
+	* test/openssl/test_pkey_ec.rb: Iterate over built-in curves
+	  (and assert their non-emptiness!) instead of hard-coding them, as
+	  this may cause problems with respect to the different availability
+	  of individual curves in individual OpenSSL builds.
+	  [ruby-core:54881] [Bug #8384]
+
+	  Thanks to Vit Ondruch for providing the patch!
+
 Thu Oct 31 23:22:35 2013  NAKAMURA Usaku  <usa@r...>
 
 	* object.c (rb_obj_cmp): [DOC] patched by Keith Bennett
Index: ruby_1_9_3/ext/openssl/ossl_pkey_ec.c
===================================================================
--- ruby_1_9_3/ext/openssl/ossl_pkey_ec.c	(revision 43485)
+++ ruby_1_9_3/ext/openssl/ossl_pkey_ec.c	(revision 43486)
@@ -757,8 +757,10 @@ static VALUE ossl_ec_group_initialize(in https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ext/openssl/ossl_pkey_ec.c#L757
                 method = EC_GFp_mont_method();
             } else if (id == s_GFp_nist) {
                 method = EC_GFp_nist_method();
+#if !defined(OPENSSL_NO_EC2M)
             } else if (id == s_GF2m_simple) {
                 method = EC_GF2m_simple_method();
+#endif
             }
 
             if (method) {
@@ -812,8 +814,10 @@ static VALUE ossl_ec_group_initialize(in https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ext/openssl/ossl_pkey_ec.c#L814
 
             if (id == s_GFp) {
                 new_curve = EC_GROUP_new_curve_GFp;
+#if !defined(OPENSSL_NO_EC2M)
             } else if (id == s_GF2m) {
                 new_curve = EC_GROUP_new_curve_GF2m;
+#endif
             } else {
                 ossl_raise(rb_eArgError, "unknown symbol, must be :GFp or :GF2m");
             }
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 43485)
+++ ruby_1_9_3/version.h	(revision 43486)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 474
+#define RUBY_PATCHLEVEL 475
 
 #define RUBY_RELEASE_DATE "2013-10-31"
 #define RUBY_RELEASE_YEAR 2013
Index: ruby_1_9_3/test/openssl/test_pkey_ec.rb
===================================================================
--- ruby_1_9_3/test/openssl/test_pkey_ec.rb	(revision 43485)
+++ ruby_1_9_3/test/openssl/test_pkey_ec.rb	(revision 43486)
@@ -7,28 +7,28 @@ class OpenSSL::TestEC < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/test/openssl/test_pkey_ec.rb#L7
     @data1 = 'foo'
     @data2 = 'bar' * 1000 # data too long for DSA sig
 
-    @group1 = OpenSSL::PKey::EC::Group.new('secp112r1')
-    @group2 = OpenSSL::PKey::EC::Group.new('sect163k1')
-    @group3 = OpenSSL::PKey::EC::Group.new('prime256v1')
-
-    @key1 = OpenSSL::PKey::EC.new
-    @key1.group = @group1
-    @key1.generate_key
+    @groups = []
+    @keys = []
 
-    @key2 = OpenSSL::PKey::EC.new(@group2.curve_name)
-    @key2.generate_key
+    OpenSSL::PKey::EC.builtin_curves.each do |curve, comment|
+      group = OpenSSL::PKey::EC::Group.new(curve)
 
-    @key3 = OpenSSL::PKey::EC.new(@group3)
-    @key3.generate_key
+      key = OpenSSL::PKey::EC.new(group)
+      key.generate_key
 
-    @groups = [@group1, @group2, @group3]
-    @keys = [@key1, @key2, @key3]
+      @groups << group
+      @keys << key
+    end
   end
 
   def compare_keys(k1, k2)
     assert_equal(k1.to_pem, k2.to_pem)
   end
 
+  def test_builtin_curves
+    assert(!OpenSSL::PKey::EC.builtin_curves.empty?)
+  end
+
   def test_curve_names
     @groups.each_with_index do |group, idx|
       key = @keys[idx]

Property changes on: ruby_1_9_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r41808


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

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