# HG changeset patch # User Kim Alvefur # Date 1440587830 -7200 # Node ID 8b4c8e9572110b514a5a74758ad1568ea960ba95 # Parent 87ec4e783ebdd30b6dfc85f2316c97ec11125a40# Parent 509b70437035464a1b923670e1e06ce872c100e5 Merge 0.9->0.10 diff -r 87ec4e783ebd -r 8b4c8e957211 tools/ejabberd2prosody.lua --- a/tools/ejabberd2prosody.lua Wed Aug 26 13:08:51 2015 +0200 +++ b/tools/ejabberd2prosody.lua Wed Aug 26 13:17:10 2015 +0200 @@ -72,7 +72,22 @@ print("["..(err or "success").."] vCard: "..node.."@"..host); end function password(node, host, password) - local ret, err = dm.store(node, host, "accounts", {password = password}); + local data = {}; + if type(password) == "string" then + data.password = password; + elseif type(password) == "table" and password[1] == "scram" then + local unb64 = require"mime".unb64; + local function hex(s) + return s:gsub(".", function (c) + return ("%02x"):format(c:byte()); + end); + end + data.stored_key = hex(unb64(password[2])); + data.server_key = hex(unb64(password[3])); + data.salt = unb64(password[4]); + data.iteration_count = password[5]; + end + local ret, err = dm.store(node, host, "accounts", data); print("["..(err or "success").."] accounts: "..node.."@"..host); end function roster(node, host, jid, item)