diff options
Diffstat (limited to 'vendor/gems/bundler-checksum')
3 files changed, 14 insertions, 8 deletions
diff --git a/vendor/gems/bundler-checksum/Gemfile.lock b/vendor/gems/bundler-checksum/Gemfile.lock index 8ae053f0105..4db0507a63b 100644 --- a/vendor/gems/bundler-checksum/Gemfile.lock +++ b/vendor/gems/bundler-checksum/Gemfile.lock @@ -15,4 +15,4 @@ DEPENDENCIES bundler-checksum! BUNDLED WITH - 2.3.17 + 2.5.4 diff --git a/vendor/gems/bundler-checksum/lib/bundler_checksum.rb b/vendor/gems/bundler-checksum/lib/bundler_checksum.rb index b3d36521f24..083082c0ab1 100644 --- a/vendor/gems/bundler-checksum/lib/bundler_checksum.rb +++ b/vendor/gems/bundler-checksum/lib/bundler_checksum.rb @@ -41,12 +41,18 @@ module Bundler raise "#{@package.inspect} does not have :@gem" unless source raise "#{source.inspect} does not respond to :with_read_io" unless source.respond_to?(:with_read_io) - digest = source.with_read_io do |io| - digest = SharedHelpers.digest(:SHA256).new - digest << io.read(16_384) until io.eof? - io.rewind - send(checksum_type(checksum), digest) - end + digest = + if Gem::Version.new(Bundler::VERSION) >= Gem::Version.new("2.5.0") + gem_checksum.digest + else + source.with_read_io do |io| + digest = SharedHelpers.digest(:SHA256).new + digest << io.read(16_384) until io.eof? + io.rewind + send(checksum_type(checksum), digest) + end + end + unless digest == checksum raise SecurityError, <<-MESSAGE Bundler cannot continue installing #{spec.name} (#{spec.version}). diff --git a/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile.lock b/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile.lock index d633184e300..2aa6a15070f 100644 --- a/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile.lock +++ b/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile.lock @@ -135,4 +135,4 @@ DEPENDENCIES rails (~> 6.1.6.1) BUNDLED WITH - 2.3.22 + 2.5.4 |