From 29e50956daeadaa6786b7cf34ab96387e5295bb6 Mon Sep 17 00:00:00 2001 From: ausiv4 Date: Fri, 7 Aug 2009 03:38:03 +0000 Subject: This update separates the register functionality from the login library. The login script is now .3 kb smaller, but there is a new 1.1 kb register file. I think that registrations are rare enough relative to logins that this should be a worthwhile tradeoff. This also prepares a framework for importing an update file, which will allow existing installations to upgrade from less secure authentication protocols, so some of the overhead in srp.js that was added here will help reduce the size as we add the update functionality. --- django/srpproject/srp/views.py | 2 - django/srpproject/templates/register.html | 1 + javascript/jsPacker/build-pack-register.sh | 2 + javascript/jsPacker/srp.min.js | 2 +- javascript/jsPacker/srp_register.min.js | 1 + javascript/srp.js | 120 ++++++++++++----------------- javascript/srp_register.js | 52 +++++++++++++ 7 files changed, 106 insertions(+), 74 deletions(-) create mode 100644 javascript/jsPacker/build-pack-register.sh create mode 100644 javascript/jsPacker/srp_register.min.js create mode 100644 javascript/srp_register.js diff --git a/django/srpproject/srp/views.py b/django/srpproject/srp/views.py index ffc5679..38d5503 100644 --- a/django/srpproject/srp/views.py +++ b/django/srpproject/srp/views.py @@ -51,7 +51,6 @@ def register_salt(request): def register_user(request): from django.contrib import auth models.SRPUser(salt=request.session["srp_salt"], username=request.session["srp_name"], verifier=request.POST["v"]).save() - # auth.models.SRPUser.objects.create_user(request.session["srp_name"],'', str(request.POST["v"])) del request.session["srp_salt"] del request.session["srp_name"] return HttpResponse("", mimetype="text/xml"); @@ -107,7 +106,6 @@ def handshake(request): def verify(request): import hashlib from django.contrib.auth import login, authenticate - # H(A, M, K) try: user = authenticate(username=request.session["srp_I"], M=(request.POST["M"], request.session["srp_M"])) if user: diff --git a/django/srpproject/templates/register.html b/django/srpproject/templates/register.html index 2119802..102daed 100644 --- a/django/srpproject/templates/register.html +++ b/django/srpproject/templates/register.html @@ -9,6 +9,7 @@ {% endcomment %} +