mirror of
https://github.com/kepler155c/opus
synced 2025-01-03 20:30:28 +00:00
oops again
This commit is contained in:
parent
cd7122921f
commit
aec5ac0121
@ -13,10 +13,9 @@ local function trustConnection(socket)
|
|||||||
if not password then
|
if not password then
|
||||||
socket:write({ msg = 'No password has been set' })
|
socket:write({ msg = 'No password has been set' })
|
||||||
else
|
else
|
||||||
pcall(function()
|
local s
|
||||||
data = Crypto.decrypt(data, password)
|
s, data = pcall(Crypto.decrypt, data, password)
|
||||||
end)
|
if s and data and data.pk and data.dh == socket.dhost then
|
||||||
if data and data.pk and data.dh == socket.dhost then
|
|
||||||
local trustList = Util.readTable('usr/.known_hosts') or { }
|
local trustList = Util.readTable('usr/.known_hosts') or { }
|
||||||
trustList[data.dh] = data.pk
|
trustList[data.dh] = data.pk
|
||||||
Util.writeTable('usr/.known_hosts', trustList)
|
Util.writeTable('usr/.known_hosts', trustList)
|
||||||
|
@ -210,7 +210,6 @@ function Socket.server(port, options)
|
|||||||
local _, _, sport, dport, msg = os.pullEvent('modem_message')
|
local _, _, sport, dport, msg = os.pullEvent('modem_message')
|
||||||
|
|
||||||
if sport == port and
|
if sport == port and
|
||||||
msg and
|
|
||||||
type(msg) == 'table' and
|
type(msg) == 'table' and
|
||||||
msg.dhost == os.getComputerID() and
|
msg.dhost == os.getComputerID() and
|
||||||
msg.type == 'OPEN' then
|
msg.type == 'OPEN' then
|
||||||
|
Loading…
Reference in New Issue
Block a user