diff options
author | Bart de Water <496367+bdewater@users.noreply.github.com> | 2020-06-29 18:31:15 -0400 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-07-31 21:07:19 +0900 |
commit | 734c5276f0ad1215eeba2f5884b384b1ffbbefc7 (patch) | |
tree | 9b8f0bfc7b1bc2c27c381a000fc1fb3ced2d4eee /lib/rubygems/security.rb | |
parent | 8161cf85ba4f9091176536bcac9107879e4293a1 (diff) | |
download | ruby-734c5276f0ad1215eeba2f5884b384b1ffbbefc7.tar.gz |
[rubygems/rubygems] Simplify digest name selection and use SHA256
The previous commit introduces the Gem::Security.create_digest method, allowing to:
- decouple algorithm choice from implementation (OpenSSL or Ruby built-in)
- untangle the SHA512 fallback for TarWriter from the generic hashing digest choice (undoing commit 9471f8ed2bdc12248d2619bbbce6e53cd6c16cb6)
https://github.com/rubygems/rubygems/commit/1bc03231e4
Diffstat (limited to 'lib/rubygems/security.rb')
-rw-r--r-- | lib/rubygems/security.rb | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/rubygems/security.rb b/lib/rubygems/security.rb index 64fb4c0f83..93bc6588e6 100644 --- a/lib/rubygems/security.rb +++ b/lib/rubygems/security.rb @@ -341,14 +341,7 @@ module Gem::Security ## # Used internally to select the signing digest from all computed digests - DIGEST_NAME = # :nodoc: - if defined?(OpenSSL::Digest::SHA256) - 'SHA256' - elsif defined?(OpenSSL::Digest::SHA1) - 'SHA1' - else - 'SHA512' - end + DIGEST_NAME = 'SHA256' # :nodoc: ## # Algorithm for creating the key pair used to sign gems |