Make sure to parse the big int into a byte string

This commit is contained in:
Joseph Schorr 2015-03-26 16:13:35 -04:00
parent 4d1792db1c
commit f8afd8b5ce

View file

@ -3,6 +3,7 @@ import logging
import json
import itertools
import uuid
import struct
from util.aes import AESCipher
from util.validation import generate_valid_usernames
@ -150,7 +151,8 @@ class UserAuthentication(object):
# First try parsing the key as an int.
try:
secret_key = int(app_secret_key)
big_int = int(app_secret_key)
secret_key = bytearray.fromhex('{:02x}'.format(big_int))
except ValueError:
secret_key = app_secret_key