summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Meyer <imeyer@tool01.ny4.etsy.com>2010-01-29 18:51:23 +0000
committerIan Meyer <imeyer@tool01.ny4.etsy.com>2010-01-29 18:51:23 +0000
commitaa81ca75f7994fa7105235aa4f49b2de8480ebe1 (patch)
treefe18117ac4af1ad256d171a6abe71a9722014e33
parent065c909660bb1509224e7f7525adc7bc90e4512b (diff)
downloadmixlib-authentication-aa81ca75f7994fa7105235aa4f49b2de8480ebe1.tar.gz
CHEF-902 remove digest/hmac and use openssl instead
-rw-r--r--Rakefile1
-rw-r--r--lib/mixlib/authentication/digester.rb4
-rw-r--r--lib/mixlib/authentication/signedheaderauth.rb4
3 files changed, 4 insertions, 5 deletions
diff --git a/Rakefile b/Rakefile
index 9d7ec4b..cd8afed 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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'