- usermanager.set_password(username, credentials.password);
- credentials = datamanager.load(username, host, "accounts") or {};
+ usermanager.set_password(username, credentials.password, host);
+ credentials = datamanager.load(username, host, "accounts");
+ if not credentials then return; end
+ end
+
+ -- convert hexpass to stored_key and server_key
+ -- COMPAT w/old trunk: remove before 0.8 release
+ if credentials.hashpass then
+ local salted_password = from_hex(credentials.hashpass);
+ credentials.stored_key = sha1(hmac_sha1(salted_password, "Client Key"), true);
+ credentials.server_key = to_hex(hmac_sha1(salted_password, "Server Key"));
+ credentials.hashpass = nil
+ datamanager.store(username, host, "accounts", credentials);