From 8b17435950bf51ce9170533076ece69d4d93b3a7 Mon Sep 17 00:00:00 2001 From: ernolf Date: Sat, 17 Aug 2024 08:51:20 +0200 Subject: [PATCH] fix(share): adjust min token length and correct variation calculations Updated the minimum token length to reflect the smaller character set (52 characters, not the assumed 62) in use. Signed-off-by: ernolf --- lib/private/Share/Constants.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/private/Share/Constants.php b/lib/private/Share/Constants.php index de168ac2ca569..baff04fbc4a87 100644 --- a/lib/private/Share/Constants.php +++ b/lib/private/Share/Constants.php @@ -63,9 +63,9 @@ class Constants { public const RESPONSE_FORMAT = 'json'; // default response format for ocs calls - public const MIN_TOKEN_LENGTH = 4; // 14,776,336 different possible variations - public const DEFAULT_TOKEN_LENGTH = 15; // 768,909,704,948,766,668,552,634,368 different possible variations - public const MAX_TOKEN_LENGTH = 32; // 2,272,657,884,496,751,345,355,241,563,627,544,170,162,852,933,518,655,225,856 different possible variations + public const MIN_TOKEN_LENGTH = 6; // 19,770,609,664 different possible variations + public const DEFAULT_TOKEN_LENGTH = 15; // 54,960,434,128,018,667,122,720,768 different possible variations + public const MAX_TOKEN_LENGTH = 32; // 8,167,835,760,036,914,488,254,418,108,462,708,901,695,678,621,570,564,096 different possible variations public const TOKEN_LENGTH = self::DEFAULT_TOKEN_LENGTH; // old (oc7) length is 32, keep token length in db at least that for compatibility protected static $shareTypeUserAndGroups = -1;