summaryrefslogtreecommitdiff
path: root/fbin.py
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-02-15 23:46:03 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2011-02-15 23:51:24 +0100
commit12ada83027694f799d6ee5caddb00f5ffe1b4d8d (patch)
tree36ea4f69059c4eb6ed603ff510ad3e2f0338ef7c /fbin.py
parent5695704aed741e3443fa5c4d87856cab475128b8 (diff)
Use sha1 instead of md5.
Diffstat (limited to 'fbin.py')
-rwxr-xr-xfbin.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/fbin.py b/fbin.py
index 9a1a4df..507512e 100755
--- a/fbin.py
+++ b/fbin.py
@@ -85,7 +85,7 @@ class Application(object):
finally:
session.close()
- digest = hashlib.md5(str(uid) + user.password).hexdigest()
+ digest = hashlib.sha1(str(uid) + user.password).hexdigest()
return user if (digest == identifier) else None
def file(self, environ, start_response, path):
@@ -143,7 +143,7 @@ class Application(object):
}))
username = form.getvalue('username')
- password = hashlib.md5(form.getvalue('password')).hexdigest()
+ password = hashlib.sha1(form.getvalue('password')).hexdigest()
user = self.get_user(username, password)
@@ -156,7 +156,7 @@ class Application(object):
c = Cookie.SimpleCookie()
c['uid'] = user.id
- c['identifier'] = hashlib.md5(str(user.id) + password).hexdigest()
+ c['identifier'] = hashlib.sha1(str(user.id) + password).hexdigest()
dt = datetime.datetime.utcnow() + datetime.timedelta(days = 30)
expires = dt.strftime('%a, %d-%b-%y %H:%M:%S GMT')
@@ -187,7 +187,7 @@ class Application(object):
'error': 'Passwords doesn\'t match',
}))
- user = self.add_user(username, hashlib.md5(password).hexdigest())
+ user = self.add_user(username, hashlib.sha1(password).hexdigest())
if not user:
start_response('200 OK', [('Content-Type', 'text/html')])
return str(templates.register(searchList = {