diff options
author | Ian Meyer <imeyer@tool01.ny4.etsy.com> | 2010-01-29 18:51:23 +0000 |
---|---|---|
committer | Ian Meyer <imeyer@tool01.ny4.etsy.com> | 2010-01-29 18:51:23 +0000 |
commit | aa81ca75f7994fa7105235aa4f49b2de8480ebe1 (patch) | |
tree | fe18117ac4af1ad256d171a6abe71a9722014e33 | |
parent | 065c909660bb1509224e7f7525adc7bc90e4512b (diff) | |
download | mixlib-authentication-aa81ca75f7994fa7105235aa4f49b2de8480ebe1.tar.gz |
CHEF-902 remove digest/hmac and use openssl instead
-rw-r--r-- | Rakefile | 1 | ||||
-rw-r--r-- | lib/mixlib/authentication/digester.rb | 4 | ||||
-rw-r--r-- | lib/mixlib/authentication/signedheaderauth.rb | 4 |
3 files changed, 4 insertions, 5 deletions
@@ -26,6 +26,7 @@ spec = Gem::Specification.new do |s| # Uncomment this to add a dependency s.add_dependency "ruby-hmac" + s.add_dependency "openssl" s.add_dependency "mixlib-log" s.require_path = 'lib' diff --git a/lib/mixlib/authentication/digester.rb b/lib/mixlib/authentication/digester.rb index f3a3597..690cc0e 100644 --- a/lib/mixlib/authentication/digester.rb +++ b/lib/mixlib/authentication/digester.rb @@ -35,7 +35,7 @@ module Mixlib # time2<Time>:: subtrahend # def hash_file(f) - digester = Digest::SHA1.new + digester = OpenSSL::Digest::SHA1.new buf = "" while f.read(16384, buf) digester.update buf @@ -49,7 +49,7 @@ module Mixlib # ====Parameters # def hash_body(body) - @hashed_body ||= ::Base64.encode64(Digest::SHA1.digest(body)).chomp + @hashed_body ||= ::Base64.encode64(OpenSSL::Digest::SHA1.digest(body)).chomp end end end diff --git a/lib/mixlib/authentication/signedheaderauth.rb b/lib/mixlib/authentication/signedheaderauth.rb index 4d72a4a..cbffe27 100644 --- a/lib/mixlib/authentication/signedheaderauth.rb +++ b/lib/mixlib/authentication/signedheaderauth.rb @@ -19,9 +19,7 @@ require 'time' require 'base64' require 'ostruct' -require 'digest/sha2' -require 'hmac' -require 'hmac-sha2' +require 'openssl' require 'mixlib/authentication' require 'mixlib/authentication/digester' |