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

This commit is contained in:
Massimo Di Pierro committed 2012-05-17 15:56:19 -05:00
1 parent c1f10fe9cf
commit 05ee1e90ca
2 files changed
+3 -3

No files matched your search

+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 @staticmethod
def get_or_create_key(filename=None): def get_or_create_key(filename=None, alg='sha512'):
request = current.request request = current.request
if not filename: if not filename:
filename = os.path.join(request.folder,'private','auth.key') filename = os.path.join(request.folder,'private','auth.key')
if os.path.exists(filename): if os.path.exists(filename):
key = open(filename,'r').read().strip() key = open(filename,'r').read().strip()
else: else:
key = web2py_uuid() key = alg+web2py_uuid()
open(filename,'w').write(key) open(filename,'w').write(key)
return key return key