summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-11-16 14:37:56 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2015-11-30 09:03:01 -0800
commitcceeaa705b4bea1c201d174a3f3f85c87a2034ac (patch)
tree674285c9b0647430fb15de3fa992ab7fc8bb809e /lib
parentd63ade4dc2999c829a159b9d3a58deb90980f69b (diff)
downloadmixlib-authentication-cceeaa705b4bea1c201d174a3f3f85c87a2034ac.tar.gz
Modify validate function to use the same parameter ordering as other functions
Diffstat (limited to 'lib')
-rw-r--r--lib/mixlib/authentication/signatureverification.rb2
-rw-r--r--lib/mixlib/authentication/signedheaderauth.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/mixlib/authentication/signatureverification.rb b/lib/mixlib/authentication/signatureverification.rb
index ff43664..e3e2ae9 100644
--- a/lib/mixlib/authentication/signatureverification.rb
+++ b/lib/mixlib/authentication/signatureverification.rb
@@ -141,7 +141,7 @@ module Mixlib
signature = Base64.decode64(request_signature)
@valid_signature = case version
when '1.3'
- digest = validate_sign_version_digest!(version, algorithm)
+ digest = validate_sign_version_digest!(algorithm, version)
@user_secret.verify(digest.new, signature, candidate_block)
else
request_decrypted_block = @user_secret.public_decrypt(signature)
diff --git a/lib/mixlib/authentication/signedheaderauth.rb b/lib/mixlib/authentication/signedheaderauth.rb
index 24ea106..dbb6b3f 100644
--- a/lib/mixlib/authentication/signedheaderauth.rb
+++ b/lib/mixlib/authentication/signedheaderauth.rb
@@ -99,7 +99,7 @@ module Mixlib
# ====Parameters
# private_key<OpenSSL::PKey::RSA>:: user's RSA private key.
def sign(private_key, sign_algorithm=algorithm, sign_version=proto_version)
- digest = validate_sign_version_digest!(sign_version, sign_algorithm)
+ digest = validate_sign_version_digest!(sign_algorithm, sign_version)
# Our multiline hash for authorization will be encoded in multiple header
# lines - X-Ops-Authorization-1, ... (starts at 1, not 0!)
header_hash = {
@@ -121,7 +121,7 @@ module Mixlib
header_hash
end
- def validate_sign_version_digest!(sign_version, sign_algorithm)
+ def validate_sign_version_digest!(sign_algorithm, sign_version)
if ALGORITHMS_FOR_VERSION[sign_version].nil?
raise AuthenticationError,
"Unsupported version '#{sign_version}'"
@@ -191,7 +191,7 @@ module Mixlib
#
#
def canonicalize_request(sign_algorithm=algorithm, sign_version=proto_version)
- digest = validate_sign_version_digest!(sign_version, sign_algorithm)
+ digest = validate_sign_version_digest!(sign_algorithm, sign_version)
canonical_x_ops_user_id = canonicalize_user_id(user_id, sign_version, digest)
case sign_version
when "1.3"