Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cura
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2020-01-31 17:00:03 +0300
committerJaime van Kessel <nallath@gmail.com>2020-01-31 17:00:03 +0300
commitca25ec3dbca6b4bf1c29be39788e0fb4d58956f7 (patch)
tree37f2deaeb7b30a61e788c757de7a475db491c8be /cura
parent32d94f76f17868527d3fbbdc84b7966583a960fc (diff)
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
Diffstat (limited to 'cura')
-rw-r--r--cura/OAuth2/AuthorizationHelpers.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/cura/OAuth2/AuthorizationHelpers.py b/cura/OAuth2/AuthorizationHelpers.py
index 9fc01ba50b..cc809abf05 100644
--- a/cura/OAuth2/AuthorizationHelpers.py
+++ b/cura/OAuth2/AuthorizationHelpers.py
@@ -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