Changeset

3390:a88576f675cb

Merge with trunk.
author Waqas Hussain <waqas20@gmail.com>
date Sat, 17 Jul 2010 19:36:14 +0500
parents 3389:9e2485880cd6 (diff) 3388:02e668d64e05 (current diff)
children 3391:8ac3f60af3c4
files
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_auth_internal_hashed.lua	Sat Jul 17 15:20:45 2010 +0100
+++ b/plugins/mod_auth_internal_hashed.lua	Sat Jul 17 19:36:14 2010 +0500
@@ -144,10 +144,12 @@
 				return usermanager.test_password(prepped_username, password, realm), true;
 			end,
 			scram_sha_1 = function(username, realm)
-				local credentials = datamanager.load(username, host, "accounts") or {};
+				local credentials = datamanager.load(username, host, "accounts");
+				if not credentials then return; end
 				if credentials.password then
 					usermanager.set_password(username, credentials.password, host);
-					credentials = datamanager.load(username, host, "accounts") or {};
+					credentials = datamanager.load(username, host, "accounts");
+					if not credentials then return; end
 				end
 				
 				-- convert hexpass to stored_key and server_key
@@ -159,7 +161,7 @@
 					credentials.hashpass = nil
 					datamanager.store(username, host, "accounts", credentials);
 				end
-				
+			
 				local stored_key, server_key, iteration_count, salt = credentials.stored_key, credentials.server_key, credentials.iteration_count, credentials.salt;
 				stored_key = stored_key and from_hex(stored_key);
 				server_key = server_key and from_hex(server_key);