get or create key now defaults to sha512 asn should have all along, thanks Harkirat

This commit is contained in:
Massimo Di Pierro
2012-05-17 15:56:19 -05:00
parent b00eca75af
commit 16ff6cef08
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.00.0 (2012-05-17 10:53:49) dev
Version 2.00.0 (2012-05-17 15:55:39) dev
+2 -2
View File
@@ -861,14 +861,14 @@ class Auth(object):
"""
@staticmethod
def get_or_create_key(filename=None):
def get_or_create_key(filename=None, alg='sha512'):
request = current.request
if not filename:
filename = os.path.join(request.folder,'private','auth.key')
if os.path.exists(filename):
key = open(filename,'r').read().strip()
else:
key = web2py_uuid()
key = alg+web2py_uuid()
open(filename,'w').write(key)
return key