summaryrefslogtreecommitdiff
path: root/lib/mixlib/authentication/signatureverification.rb
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-11-10 17:12:08 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2015-11-30 09:03:01 -0800
commit929231fb583816c76b5fc1c46a8436753848d981 (patch)
treeea7dcf7f8acb11796e1c0b903383e2e35c9c9c4d /lib/mixlib/authentication/signatureverification.rb
parentd1a46e16129cc7139a773ec146ac31e24548e6b8 (diff)
downloadmixlib-authentication-929231fb583816c76b5fc1c46a8436753848d981.tar.gz
Pass digest to all the functions that will need it
Diffstat (limited to 'lib/mixlib/authentication/signatureverification.rb')
-rw-r--r--lib/mixlib/authentication/signatureverification.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/mixlib/authentication/signatureverification.rb b/lib/mixlib/authentication/signatureverification.rb
index 45e4480..d73b16c 100644
--- a/lib/mixlib/authentication/signatureverification.rb
+++ b/lib/mixlib/authentication/signatureverification.rb
@@ -171,7 +171,7 @@ module Mixlib
# The request signature is based on any file attached, if any. Otherwise
# it's based on the body of the request.
- def hashed_body
+ def hashed_body(digest=Digest::SHA1)
unless @hashed_body
# TODO: tim: 2009-112-28: It'd be nice to remove this special case, and
# always hash the entire request body. In the file case it would just be
@@ -205,11 +205,11 @@ module Mixlib
# we hash the body.
if file_param
Mixlib::Authentication::Log.debug "Digesting file_param: '#{file_param.inspect}'"
- @hashed_body = digester.hash_file(Digest::SHA1, file_param)
+ @hashed_body = digester.hash_file(digest, file_param)
else
body = request.raw_post
Mixlib::Authentication::Log.debug "Digesting body: '#{body}'"
- @hashed_body = digester.hash_string(Digest::SHA1, body)
+ @hashed_body = digester.hash_string(digest, body)
end
end
@hashed_body