Make sure to parse the big int into a byte string
This commit is contained in:
parent
4d1792db1c
commit
f8afd8b5ce
1 changed files with 3 additions and 1 deletions
|
@ -3,6 +3,7 @@ import logging
|
||||||
import json
|
import json
|
||||||
import itertools
|
import itertools
|
||||||
import uuid
|
import uuid
|
||||||
|
import struct
|
||||||
|
|
||||||
from util.aes import AESCipher
|
from util.aes import AESCipher
|
||||||
from util.validation import generate_valid_usernames
|
from util.validation import generate_valid_usernames
|
||||||
|
@ -150,7 +151,8 @@ class UserAuthentication(object):
|
||||||
|
|
||||||
# First try parsing the key as an int.
|
# First try parsing the key as an int.
|
||||||
try:
|
try:
|
||||||
secret_key = int(app_secret_key)
|
big_int = int(app_secret_key)
|
||||||
|
secret_key = bytearray.fromhex('{:02x}'.format(big_int))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
secret_key = app_secret_key
|
secret_key = app_secret_key
|
||||||
|
|
||||||
|
|
Reference in a new issue