Skip to content

Commit

Permalink
force application key to bytes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dusty Phillips committed Jan 24, 2010
1 parent b94c609 commit d78828d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions psyclone/web.py
Expand Up @@ -297,8 +297,9 @@ def get_secure_cookie(self, name):

def _cookie_signature(self, *parts):
self.require_setting("cookie_secret", "secure cookies")
hash = hmac.new(self.application.settings["cookie_secret"],
digestmod=hashlib.sha1)
hash = hmac.new(force_bytes(
self.application.settings["cookie_secret"]),
digestmod=hashlib.sha1)
for part in parts:
part = force_bytes(part)
logging.debug("cookie signature part: {0}".format(part))
Expand Down

0 comments on commit d78828d

Please sign in to comment.