Comparison

plugins/proxy65.lua @ 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
parent 380:0891b4e27766
child 395:e86144a4eaa1
comparison
equal deleted inserted replaced
391:b496f0262a3f 392:cdea6a28369e
1 local events = require "util.events"; 1 local events = require "util.events";
2 local uuid = require "util.uuid"; 2 local uuid = require "util.uuid";
3 local sha1 = require "util.sha1"; 3 local sha1 = require "util.hashes".sha1;
4 4
5 local proxy65_mt = {}; 5 local proxy65_mt = {};
6 proxy65_mt.__index = proxy65_mt; 6 proxy65_mt.__index = proxy65_mt;
7 7
8 local xmlns_bytestreams = "http://jabber.org/protocol/bytestreams"; 8 local xmlns_bytestreams = "http://jabber.org/protocol/bytestreams";
149 end); 149 end);
150 return conn; 150 return conn;
151 end 151 end
152 152
153 function negotiate_socks5(stream, conn, sid, requester_jid, target_jid) 153 function negotiate_socks5(stream, conn, sid, requester_jid, target_jid)
154 local hash = sha1.sha1(sid..requester_jid..target_jid); 154 local hash = sha1(sid..requester_jid..target_jid);
155 local function suppress_connected() 155 local function suppress_connected()
156 conn:unhook("connected", suppress_connected); 156 conn:unhook("connected", suppress_connected);
157 return true; 157 return true;
158 end 158 end
159 local function receive_connection_response(data) 159 local function receive_connection_response(data)