Increase size of the verificationCode

It's mostly a theoretical problem, but 16 could theoretically be brute
forced. Bumping it up to 32 won't break anything, but it does make it
exteremely unlikely that it gets broken
This commit is contained in:
Jaime van Kessel 2020-01-31 15:00:03 +01:00
parent 32d94f76f1
commit ca25ec3dbc
No known key found for this signature in database
GPG key ID: 3710727397403C91

View file

@ -115,9 +115,10 @@ class AuthorizationHelpers:
)
@staticmethod
## Generate a 16-character verification code.
# \param code_length: How long should the code be?
def generateVerificationCode(code_length: int = 16) -> str:
## Generate a verification code of arbitrary length.
# \param code_length: How long should the code be? This should never be lower than 16, but it's probably better to
# leave it at 32
def generateVerificationCode(code_length: int = 32) -> str:
return "".join(random.choice("0123456789ABCDEF") for i in range(code_length))
@staticmethod