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

ruby-changes:41479

From: hsbt <ko1@a...>
Date: Sat, 16 Jan 2016 16:50:54 +0900 (JST)
Subject: [ruby-changes:41479] hsbt:r53553 (trunk): * ext/openssl/lib/openssl/pkey.rb: Added 2048 bit DH parameter.

hsbt	2016-01-16 16:51:24 +0900 (Sat, 16 Jan 2016)

  New Revision: 53553

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

  Log:
    * ext/openssl/lib/openssl/pkey.rb: Added 2048 bit DH parameter.
    * test/openssl/test_pkey_dh.rb: ditto.

  Modified files:
    trunk/ChangeLog
    trunk/ext/openssl/lib/openssl/pkey.rb
    trunk/test/openssl/test_pkey_dh.rb
Index: test/openssl/test_pkey_dh.rb
===================================================================
--- test/openssl/test_pkey_dh.rb	(revision 53552)
+++ test/openssl/test_pkey_dh.rb	(revision 53553)
@@ -18,6 +18,20 @@ T4h7KZ/2zmjvV+eF8kBUHBJAojUlzxKj4QeO2x20 https://github.com/ruby/ruby/blob/trunk/test/openssl/test_pkey_dh.rb#L18
     assert_equal params, OpenSSL::PKey::DH::DEFAULT_1024.to_s
   end
 
+  def test_DEFAULT_2048
+    params = <<-eop
+-----BEGIN DH PARAMETERS-----
+MIIBCAKCAQEA7E6kBrYiyvmKAMzQ7i8WvwVk9Y/+f8S7sCTN712KkK3cqd1jhJDY
+JbrYeNV3kUIKhPxWHhObHKpD1R84UpL+s2b55+iMd6GmL7OYmNIT/FccKhTcveab
+VBmZT86BZKYyf45hUF9FOuUM9xPzuK3Vd8oJQvfYMCd7LPC0taAEljQLR4Edf8E6
+YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
+1bNveX5wInh5GDx1FGhKBZ+s1H+aedudCm7sCgRwv8lKWYGiHzObSma8A86KG+MD
+7Lo5JquQ3DlBodj3IDyPrxIv96lvRPFtAwIBAg==
+-----END DH PARAMETERS-----
+    eop
+    assert_equal params, OpenSSL::PKey::DH::DEFAULT_2048.to_s
+  end
+
   def test_new
     dh = OpenSSL::PKey::DH.new(NEW_KEYLEN)
     assert_key(dh)
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 53552)
+++ ChangeLog	(revision 53553)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jan 16 16:47:14 2016  SHIBATA Hiroshi  <hsbt@r...>
+
+	* ext/openssl/lib/openssl/pkey.rb: Added 2048 bit DH parameter.
+	* test/openssl/test_pkey_dh.rb: ditto.
+
 Sat Jan 16 10:51:19 2016  SHIBATA Hiroshi  <hsbt@r...>
 
 	* enc/unicode.c: fix implicit conversion error with clang. fixup r53548.
Index: ext/openssl/lib/openssl/pkey.rb
===================================================================
--- ext/openssl/lib/openssl/pkey.rb	(revision 53552)
+++ ext/openssl/lib/openssl/pkey.rb	(revision 53553)
@@ -11,12 +11,24 @@ AV/ZD2AWPbrTqV76mGRgJg4EddgT1zG0jq3rnFdM https://github.com/ruby/ruby/blob/trunk/ext/openssl/lib/openssl/pkey.rb#L11
 T4h7KZ/2zmjvV+eF8kBUHBJAojUlzxKj4QeO2x20FP9X5xmNUXeDAgEC
 -----END DH PARAMETERS-----
       _end_of_pem_
+
+      DEFAULT_2048 = new <<-_end_of_pem_
+-----BEGIN DH PARAMETERS-----
+MIIBCAKCAQEA7E6kBrYiyvmKAMzQ7i8WvwVk9Y/+f8S7sCTN712KkK3cqd1jhJDY
+JbrYeNV3kUIKhPxWHhObHKpD1R84UpL+s2b55+iMd6GmL7OYmNIT/FccKhTcveab
+VBmZT86BZKYyf45hUF9FOuUM9xPzuK3Vd8oJQvfYMCd7LPC0taAEljQLR4Edf8E6
+YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
+1bNveX5wInh5GDx1FGhKBZ+s1H+aedudCm7sCgRwv8lKWYGiHzObSma8A86KG+MD
+7Lo5JquQ3DlBodj3IDyPrxIv96lvRPFtAwIBAg==
+-----END DH PARAMETERS-----
+      _end_of_pem_
     end
 
     DEFAULT_TMP_DH_CALLBACK = lambda { |ctx, is_export, keylen|
       warn "using default DH parameters." if $VERBOSE
       case keylen
       when 1024 then OpenSSL::PKey::DH::DEFAULT_1024
+      when 2048 then OpenSSL::PKey::DH::DEFAULT_2048
       else
         nil
       end

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

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