Software /
code /
verse
Changeset
392:cdea6a28369e
plugins: Use util.hashes instead of util.sha1
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 25 Aug 2015 18:03:10 +0200 |
parents | 391:b496f0262a3f |
children | 393:69229fa1d24f |
files | plugins/disco.lua plugins/jingle.lua plugins/jingle_s5b.lua plugins/proxy65.lua plugins/vcard_update.lua |
diffstat | 5 files changed, 5 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/disco.lua Tue Aug 25 16:27:38 2015 +0200 +++ b/plugins/disco.lua Tue Aug 25 18:03:10 2015 +0200 @@ -8,7 +8,7 @@ local verse = require "verse"; local b64 = require("mime").b64; -local sha1 = require("util.sha1").sha1; +local sha1 = require("util.hashes").sha1; local xmlns_caps = "http://jabber.org/protocol/caps"; local xmlns_disco = "http://jabber.org/protocol/disco";
--- a/plugins/jingle.lua Tue Aug 25 16:27:38 2015 +0200 +++ b/plugins/jingle.lua Tue Aug 25 18:03:10 2015 +0200 @@ -1,5 +1,4 @@ local verse = require "verse"; -local sha1 = require "util.sha1".sha1; local timer = require "util.timer"; local uuid_generate = require "util.uuid".generate;
--- a/plugins/jingle_s5b.lua Tue Aug 25 16:27:38 2015 +0200 +++ b/plugins/jingle_s5b.lua Tue Aug 25 18:03:10 2015 +0200 @@ -2,7 +2,7 @@ local xmlns_s5b = "urn:xmpp:jingle:transports:s5b:1"; local xmlns_bytestreams = "http://jabber.org/protocol/bytestreams"; -local sha1 = require "util.sha1".sha1; +local sha1 = require "util.hashes".sha1; local uuid_generate = require "util.uuid".generate; local function negotiate_socks5(conn, hash)
--- a/plugins/proxy65.lua Tue Aug 25 16:27:38 2015 +0200 +++ b/plugins/proxy65.lua Tue Aug 25 18:03:10 2015 +0200 @@ -1,6 +1,6 @@ local events = require "util.events"; local uuid = require "util.uuid"; -local sha1 = require "util.sha1"; +local sha1 = require "util.hashes".sha1; local proxy65_mt = {}; proxy65_mt.__index = proxy65_mt; @@ -151,7 +151,7 @@ end function negotiate_socks5(stream, conn, sid, requester_jid, target_jid) - local hash = sha1.sha1(sid..requester_jid..target_jid); + local hash = sha1(sid..requester_jid..target_jid); local function suppress_connected() conn:unhook("connected", suppress_connected); return true;
--- a/plugins/vcard_update.lua Tue Aug 25 16:27:38 2015 +0200 +++ b/plugins/vcard_update.lua Tue Aug 25 18:03:10 2015 +0200 @@ -2,15 +2,7 @@ local xmlns_vcard, xmlns_vcard_update = "vcard-temp", "vcard-temp:x:update"; --- MMMmmmm.. hacky -local ok, fun = pcall(function() return require("util.hashes").sha1; end); -if not ok then - ok, fun = pcall(function() return require("util.sha1").sha1; end); - if not ok then - error("Could not find a sha1()") - end -end -local sha1 = fun; +local sha1 = require("util.hashes").sha1; local ok, fun = pcall(function() local unb64 = require("util.encodings").base64.decode;