aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_auth_internal_hashed.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-05-19 16:33:47 +0200
committerKim Alvefur <zash@zash.se>2015-05-19 16:33:47 +0200
commitcc380360ef8163b0922b2e31eced37ce9b64c45e (patch)
tree14a722959d1179338adec58efd9e5d7fcfa58ada /plugins/mod_auth_internal_hashed.lua
parenta1eac64a926aeeec8babac775aa689dab4a598d3 (diff)
parente909a53de56e66db08941f06f796b1bedda95a1f (diff)
downloadprosody-cc380360ef8163b0922b2e31eced37ce9b64c45e.tar.gz
prosody-cc380360ef8163b0922b2e31eced37ce9b64c45e.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_auth_internal_hashed.lua')
-rw-r--r--plugins/mod_auth_internal_hashed.lua21
1 files changed, 2 insertions, 19 deletions
diff --git a/plugins/mod_auth_internal_hashed.lua b/plugins/mod_auth_internal_hashed.lua
index 954392c9..78abe50d 100644
--- a/plugins/mod_auth_internal_hashed.lua
+++ b/plugins/mod_auth_internal_hashed.lua
@@ -13,31 +13,14 @@ local getAuthenticationDatabaseSHA1 = require "util.sasl.scram".getAuthenticatio
local usermanager = require "core.usermanager";
local generate_uuid = require "util.uuid".generate;
local new_sasl = require "util.sasl".new;
+local hex = require"util.hex";
+local to_hex, from_hex = hex.to, hex.from;
local log = module._log;
local host = module.host;
local accounts = module:open_store("accounts");
-local to_hex;
-do
- local function replace_byte_with_hex(byte)
- return ("%02x"):format(byte:byte());
- end
- function to_hex(binary_string)
- return binary_string:gsub(".", replace_byte_with_hex);
- end
-end
-
-local from_hex;
-do
- local function replace_hex_with_byte(hex)
- return string.char(tonumber(hex, 16));
- end
- function from_hex(hex_string)
- return hex_string:gsub("..", replace_hex_with_byte);
- end
-end
-- Default; can be set per-user