From 3a758cc7d2668241c05846f3981c1b5d07676d57 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 4 Apr 2012 21:33:04 +0530 Subject: [PATCH] ... --- src/calibre/library/server/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/library/server/utils.py b/src/calibre/library/server/utils.py index b69d3e6a72..ebc7998020 100644 --- a/src/calibre/library/server/utils.py +++ b/src/calibre/library/server/utils.py @@ -5,7 +5,7 @@ __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal ' __docformat__ = 'restructuredtext en' -import time, sys, uuid, hashlib +import time, sys, hashlib, binascii, random, os from urllib import quote as quote_, unquote as unquote_ from functools import wraps @@ -89,7 +89,8 @@ class AuthController(object): def __init__(self, realm, users_dict): self.realm = realm self.users_dict = users_dict - self.secret = bytes(uuid.uuid4().hex) + self.secret = bytes(binascii.hexlify(os.urandom(random.randint(20, + 30)))) self.cookie_name = 'android_workaround' def hashit(self, raw):