1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/openssl] Look up digest by name instead of constant

b28fb2f05c
This commit is contained in:
Bart de Water 2020-04-19 11:14:36 -04:00 committed by Kazuki Yamaguchi
parent 3f8665fe0e
commit 0b2c70eaa1
31 changed files with 161 additions and 171 deletions

View file

@ -161,7 +161,7 @@ private
end
def fingerprint(der)
Digest::MD5.hexdigest(der).upcase
Digest.hexdigest('MD5', der).upcase
end
end

View file

@ -37,7 +37,7 @@ else
ef.issuer_certificate = cert
cert.add_extension ef.create_extension("authorityKeyIdentifier",
"keyid:always,issuer:always")
cert.sign(key, OpenSSL::Digest::SHA1.new)
cert.sign(key, OpenSSL::Digest.new('SHA1'))
end
ctx = OpenSSL::SSL::SSLContext.new()

View file

@ -41,7 +41,7 @@ req = X509::Request.new
req.version = 0
req.subject = name
req.public_key = keypair.public_key
req.sign(keypair, Digest::MD5.new)
req.sign(keypair, Digest.new('MD5'))
puts "Writing #{csrout}..."
File.open(csrout, "w") do |f|