Mercurial > prosody-modules
comparison mod_s2s_auth_fingerprint/mod_s2s_auth_fingerprint.lua @ 1875:ee2cedb0f691
mod_s2s_auth_fingerprint: Limit number of replacements instead of stripping extra separators
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 27 Sep 2015 13:19:52 +0200 |
parents | 11b6170a50f7 |
children |
comparison
equal
deleted
inserted
replaced
1874:8ef500508c59 | 1875:ee2cedb0f691 |
---|---|
10 local function hashprep(h) | 10 local function hashprep(h) |
11 return tostring(h):gsub(":",""):lower(); | 11 return tostring(h):gsub(":",""):lower(); |
12 end | 12 end |
13 | 13 |
14 local function hashfmt(h) | 14 local function hashfmt(h) |
15 return h:gsub("..",":%0"):sub(2):upper(); | 15 return h:gsub("..","%0:", #h/2-1):upper(); |
16 end | 16 end |
17 | 17 |
18 for host, set in pairs(module:get_option("s2s_trusted_fingerprints", {})) do | 18 for host, set in pairs(module:get_option("s2s_trusted_fingerprints", {})) do |
19 local host_set = {} | 19 local host_set = {} |
20 if type(set) == "table" then -- list of fingerprints | 20 if type(set) == "table" then -- list of fingerprints |