Skip to content

Commit

Permalink
Merge branch 'hotfix/base64'
Browse files Browse the repository at this point in the history
  • Loading branch information
radeklos committed Oct 1, 2015
2 parents 72af91f + 60bfab3 commit 5b828c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Change Log
----------

1.0.3
~~~~~
- Fix: use base64.b64encode instead of base64.urlsafe_b64encode

1.0.2
~~~~~
- Fix: HMAC_SECRET should be optional
Expand Down
4 changes: 2 additions & 2 deletions djangohmac/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def make_hmac(self, data='', key=None):
key (str): secret key of another app
'''
hmac_token_server = self._hmac_factory(encode_string(data), key).digest()
hmac_token_server = base64.urlsafe_b64encode(hmac_token_server)
hmac_token_server = base64.b64encode(hmac_token_server)
return hmac_token_server

def make_hmac_for(self, name, data=''):
Expand All @@ -74,7 +74,7 @@ def make_hmac_for(self, name, data=''):
key = self.hmac_keys[name]
except KeyError:
raise UnknownKeyName()
token = base64.urlsafe_b64encode(six.b(
token = base64.b64encode(six.b(
'{0}:{1}'.format(name, decode_string(self.make_hmac(data, key)))
))
return token
Expand Down

0 comments on commit 5b828c3

Please sign in to comment.