From 8be9c04a3a6f84c8673e0b6db3305cf0f427a43b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20G=C3=B6hler?= <somebody.here@gmx.de>
Date: Mon, 15 Oct 2012 20:00:33 +0200
Subject: [PATCH] 128byte is not 128bit - now we realy use 256bit (same as
 PHPSESSID)

---
 db_structure.xml | 2 +-
 lib/base.php     | 4 ++--
 lib/util.php     | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/db_structure.xml b/db_structure.xml
index a17ab90b8a..99a30cb613 100644
--- a/db_structure.xml
+++ b/db_structure.xml
@@ -395,7 +395,7 @@
 				<type>text</type>
 				<default></default>
 				<notnull>true</notnull>
-				<length>128</length>
+				<length>64</length>
 			</field>
 
 			<field>
diff --git a/lib/base.php b/lib/base.php
index 0ba028a68d..c9dcac3cbb 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -566,7 +566,7 @@ class OC{
 			if (in_array($_COOKIE['oc_token'], $tokens, true)) {
 				// replace successfully used token with a new one
 				OC_Preferences::deleteKey($_COOKIE['oc_username'], 'login_token', $_COOKIE['oc_token']);
-				$token = OC_Util::generate_random_bytes(128);
+				$token = OC_Util::generate_random_bytes(32);
 				OC_Preferences::setValue($_COOKIE['oc_username'], 'login_token', $token, time());
 				OC_User::setMagicInCookie($_COOKIE['oc_username'], $token);
 				// login
@@ -600,7 +600,7 @@ class OC{
 				if(defined("DEBUG") && DEBUG) {
 					OC_Log::write('core', 'Setting remember login to cookie', OC_Log::DEBUG);
 				}
-				$token = OC_Util::generate_random_bytes(128);
+				$token = OC_Util::generate_random_bytes(32);
 				OC_Preferences::setValue($_POST['user'], 'login_token', $token, time());
 				OC_User::setMagicInCookie($_POST["user"], $token);
 			}
diff --git a/lib/util.php b/lib/util.php
index 707100a9bc..68c4920258 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -83,7 +83,7 @@ class OC_Util {
 	 */
 	public static function getVersion() {
 		// hint: We only can count up. So the internal version number of ownCloud 4.5 will be 4.90.0. This is not visible to the user
-		return array(4,91,01);
+		return array(4,91,00);
 	}
 
 	/**
-- 
GitLab