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

ruby-changes:39333

From: normal <ko1@a...>
Date: Wed, 29 Jul 2015 05:02:57 +0900 (JST)
Subject: [ruby-changes:39333] normal:r51414 (trunk): test/rubygems/test_gem_remote_fetcher.rb: pre-generate test key

normal	2015-07-29 05:02:38 +0900 (Wed, 29 Jul 2015)

  New Revision: 51414

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

  Log:
    test/rubygems/test_gem_remote_fetcher.rb: pre-generate test key
    
    OpenSSL::PKey::DH.new(2048) takes forever, and we pre-generate
    test keys for other SSL-using tests anyways.
    
    * test/rubygems/test_gem_remote_fetcher.rb: pre-generate test key
      [ruby-core:70151] [Bug #11397]

  Modified files:
    trunk/ChangeLog
    trunk/test/rubygems/test_gem_remote_fetcher.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51413)
+++ ChangeLog	(revision 51414)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jul 29 04:54:47 2015  Eric Wong  <e@8...>
+
+	* test/rubygems/test_gem_remote_fetcher.rb: pre-generate test key
+	  [ruby-core:70151] [Bug #11397]
+
 Tue Jul 28 10:32:09 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* internal.h (struct RClass): moved from ruby/ruby.h to hide the
Index: test/rubygems/test_gem_remote_fetcher.rb
===================================================================
--- test/rubygems/test_gem_remote_fetcher.rb	(revision 51413)
+++ test/rubygems/test_gem_remote_fetcher.rb	(revision 51414)
@@ -77,6 +77,32 @@ gems: https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_remote_fetcher.rb#L77
 
   DIR = File.expand_path(File.dirname(__FILE__))
 
+  # Generated via:
+  #   x = OpenSSL::PKey::DH.new(2048) # wait a while...
+  #   x.to_s => pem
+  #   x.priv_key.to_s => hex for OpenSSL::BN.new
+  TEST_KEY_DH2048 =  OpenSSL::PKey::DH.new <<-_end_of_pem_
+-----BEGIN DH PARAMETERS-----
+MIIBCAKCAQEA3Ze2EHSfYkZLUn557torAmjBgPsqzbodaRaGZtgK1gEU+9nNJaFV
+G1JKhmGUiEDyIW7idsBpe4sX/Wqjnp48Lr8IeI/SlEzLdoGpf05iRYXC8Cm9o8aM
+cfmVgoSEAo9YLBpzoji2jHkO7Q5IPt4zxbTdlmmGFLc/GO9q7LGHhC+rcMcNTGsM
+49AnILNn49pq4Y72jSwdmvq4psHZwwFBbPwLdw6bLUDDCN90jfqvYt18muwUxDiN
+NP0fuvVAIB158VnQ0liHSwcl6+9vE1mL0Jo/qEXQxl0+UdKDjaGfTsn6HIrwTnmJ
+PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
+-----END DH PARAMETERS-----
+    _end_of_pem_
+
+  TEST_KEY_DH2048.priv_key = OpenSSL::BN.new("108911488509734781344423639" \
+     "5585749502236089033416160524030987005037540379474123441273555416835" \
+     "4725688238369352738266590757370603937618499698665047757588998555345" \
+     "3446251978586372525530219375408331096098220027413238477359960428372" \
+     "0195464393332338164504352015535549496585792320286513563739305843396" \
+     "9294344974028713065472959376197728193162272314514335882399554394661" \
+     "5306385003430991221886779612878793446851681835397455333989268503748" \
+     "7862488679178398716189205737442996155432191656080664090596502674943" \
+     "7902481557157485795980326766117882761941455140582265347052939604724" \
+     "964857770053363840471912215799994973597613931991572884", 16)
+
   def setup
     @proxies = %w[http_proxy HTTP_PROXY http_proxy_user HTTP_PROXY_USER http_proxy_pass HTTP_PROXY_PASS no_proxy NO_PROXY]
     @old_proxies = @proxies.map {|k| ENV[k] }
@@ -898,7 +924,7 @@ gems: https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_remote_fetcher.rb#L924
       server.mount_proc("/insecure_redirect") { |req, res|
         res.set_redirect(WEBrick::HTTPStatus::MovedPermanently, req.query['to'])
       }
-      server.ssl_context.tmp_dh_callback = proc { OpenSSL::PKey::DH.new 2048 }
+      server.ssl_context.tmp_dh_callback = proc { TEST_KEY_DH2048 }
       t = Thread.new do
         begin
           server.start

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

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