summaryrefslogtreecommitdiffstats
path: root/gluster/swift/common/middleware/gswauth
diff options
context:
space:
mode:
Diffstat (limited to 'gluster/swift/common/middleware/gswauth')
-rw-r--r--gluster/swift/common/middleware/gswauth/swauth/middleware.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gluster/swift/common/middleware/gswauth/swauth/middleware.py b/gluster/swift/common/middleware/gswauth/swauth/middleware.py
index 745c6f1..48f1d71 100644
--- a/gluster/swift/common/middleware/gswauth/swauth/middleware.py
+++ b/gluster/swift/common/middleware/gswauth/swauth/middleware.py
@@ -318,7 +318,7 @@ class Swauth(object):
account_id, 1)
detail = json.loads(resp.body)
- password = detail['auth'].split(':')[-1]
+ password_type, password = detail['auth'].split(':')
msg = base64.urlsafe_b64decode(unquote(token))
# https://bugs.python.org/issue5285
@@ -327,6 +327,10 @@ class Swauth(object):
if isinstance(msg, unicode):
msg = msg.encode('utf-8')
+ if password_type != 'plaintext':
+ # Password isn't plaintext, contains salt string
+ password = password.split('$')[-1]
+
s = base64.encodestring(hmac.new(password,
msg, sha1).digest()).strip()
if s != sign: