summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorausiv4 <ausiv4@eb105b4a-77de-11de-a249-6bf219df57d5>2009-07-28 17:59:43 +0000
committerausiv4 <ausiv4@eb105b4a-77de-11de-a249-6bf219df57d5>2009-07-28 17:59:43 +0000
commit4396bb0cd1bd2d3ac6943224524b1f5a4b477d30 (patch)
treebcfb42ae033748de8af1b1e11f3c5271040917a5 /django
parent422e476f496d944f0713484cbe0ee11b180cb12d (diff)
In this update we use jsPacker.pl to combine and compress javascript
files. Instead of sending 6 javascript files totaling about 50KB, we now send 1 file totaling 21.1KB. After modifying any javascript files, run build-pack.sh to update srp.min.js. The login.html and register.html templates have been changed to send the one packed file. The file srp.js was modified so that it would pack properly. Necessary files from the perl version of packer are included, but they shouldn't be included on production web servers. The packer files are released under the LGPL.
Diffstat (limited to 'django')
-rw-r--r--django/srpproject/srp/views.py1
-rw-r--r--django/srpproject/templates/login.html6
-rw-r--r--django/srpproject/templates/register.html3
3 files changed, 8 insertions, 2 deletions
diff --git a/django/srpproject/srp/views.py b/django/srpproject/srp/views.py
index 1ad98dc..4200e8c 100644
--- a/django/srpproject/srp/views.py
+++ b/django/srpproject/srp/views.py
@@ -116,6 +116,7 @@ def verify(request):
response = "<M>%s</M>" % hashlib.sha256("%s%s%s" % (request.session["srp_A"], request.session["srp_M"], request.session["srp_S"])).hexdigest()
auth.login(request, user)
else:
+ # This should only happen when authentication is successful with SRP, but the user isn't in the auth table.
response = "<error>Authentication failed. This is likely a server problem.</error>"
else:
response = "<error>Invalid username or password.</error>"
diff --git a/django/srpproject/templates/login.html b/django/srpproject/templates/login.html
index f949663..6a77b2c 100644
--- a/django/srpproject/templates/login.html
+++ b/django/srpproject/templates/login.html
@@ -1,11 +1,13 @@
<html>
<head>
+ {% comment %}
<script src="{{ static_files }}/SHA256.js"></script>
<script src="{{ static_files }}/prng4.js"></script>
<script src="{{ static_files }}/rng.js"></script>
<script src="{{ static_files }}/jsbn.js"></script>
- <script src="{{ static_files }}/jsbn2.js"></script>
- <script src="{{ static_files }}/srp.js"></script>
+ <script src="{{ static_files }}/jsbn2.js"></script>{% endcomment %}
+ <script src="{{ static_files }}/jsPacker/srp.min.js"></script>
+
<script type="text/javascript">
function login()
{
diff --git a/django/srpproject/templates/register.html b/django/srpproject/templates/register.html
index 82ce61e..2119802 100644
--- a/django/srpproject/templates/register.html
+++ b/django/srpproject/templates/register.html
@@ -1,11 +1,14 @@
<html>
<head>
+ {% comment %}
<script src="{{ static_files }}/SHA256.js"></script>
<script src="{{ static_files }}/prng4.js"></script>
<script src="{{ static_files }}/rng.js"></script>
<script src="{{ static_files }}/jsbn.js"></script>
<script src="{{ static_files }}/jsbn2.js"></script>
<script src="{{ static_files }}/srp.js"></script>
+ {% endcomment %}
+ <script src="{{ static_files }}/jsPacker/srp.min.js"></script>
<script type="text/javascript">
function register()
{