ruby-changes:62083
From: Bart <ko1@a...>
Date: Mon, 29 Jun 2020 13:25:58 +0900 (JST)
Subject: [ruby-changes:62083] 3621a7debf (master): Avoid deprecated OpenSSL::Digest constants
https://git.ruby-lang.org/ruby.git/commit/?id=3621a7debf From 3621a7debf746723281900851e009c2111fc1f56 Mon Sep 17 00:00:00 2001 From: Bart de Water <bartdewater@g...> Date: Sun, 28 Jun 2020 17:18:34 -0400 Subject: Avoid deprecated OpenSSL::Digest constants diff --git a/lib/drb/ssl.rb b/lib/drb/ssl.rb index 3d528c6..54ab1ef 100644 --- a/lib/drb/ssl.rb +++ b/lib/drb/ssl.rb @@ -196,7 +196,7 @@ module DRb https://github.com/ruby/ruby/blob/trunk/lib/drb/ssl.rb#L196 if comment = self[:SSLCertComment] cert.add_extension(ef.create_extension("nsComment", comment)) end - cert.sign(rsa, OpenSSL::Digest::SHA256.new) + cert.sign(rsa, "SHA256") @cert = cert @pkey = rsa diff --git a/lib/webrick/ssl.rb b/lib/webrick/ssl.rb index ab1837f..e448095 100644 --- a/lib/webrick/ssl.rb +++ b/lib/webrick/ssl.rb @@ -130,7 +130,7 @@ module WEBrick https://github.com/ruby/ruby/blob/trunk/lib/webrick/ssl.rb#L130 aki = ef.create_extension("authorityKeyIdentifier", "keyid:always,issuer:always") cert.add_extension(aki) - cert.sign(rsa, OpenSSL::Digest::SHA256.new) + cert.sign(rsa, "SHA256") return [ cert, rsa ] end diff --git a/spec/ruby/library/openssl/hmac/digest_spec.rb b/spec/ruby/library/openssl/hmac/digest_spec.rb index 22bc702..03ed136 100644 --- a/spec/ruby/library/openssl/hmac/digest_spec.rb +++ b/spec/ruby/library/openssl/hmac/digest_spec.rb @@ -4,7 +4,7 @@ require 'openssl' https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/openssl/hmac/digest_spec.rb#L4 describe "OpenSSL::HMAC.digest" do it "returns an SHA1 digest" do - cur_digest = OpenSSL::Digest::SHA1.new + cur_digest = OpenSSL::Digest.new("SHA1") cur_digest.digest.should == HMACConstants::BlankSHA1Digest digest = OpenSSL::HMAC.digest(cur_digest, HMACConstants::Key, diff --git a/spec/ruby/library/openssl/hmac/hexdigest_spec.rb b/spec/ruby/library/openssl/hmac/hexdigest_spec.rb index 7f73b2d..3508c1b 100644 --- a/spec/ruby/library/openssl/hmac/hexdigest_spec.rb +++ b/spec/ruby/library/openssl/hmac/hexdigest_spec.rb @@ -4,7 +4,7 @@ require 'openssl' https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/openssl/hmac/hexdigest_spec.rb#L4 describe "OpenSSL::HMAC.hexdigest" do it "returns an SHA1 hex digest" do - cur_digest = OpenSSL::Digest::SHA1.new + cur_digest = OpenSSL::Digest.new("SHA1") cur_digest.hexdigest.should == HMACConstants::BlankSHA1HexDigest hexdigest = OpenSSL::HMAC.hexdigest(cur_digest, HMACConstants::Key, -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/