mirror of
https://github.com/kepler155c/opus
synced 2025-10-26 13:17:39 +00:00
The big Anavrins security update (round 1)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
local Crypto = require('crypto')
|
||||
local Crypto = require('crypto.chacha20')
|
||||
local Event = require('event')
|
||||
local Security = require('security')
|
||||
local Socket = require('socket')
|
||||
@@ -14,7 +14,7 @@ local function trustConnection(socket)
|
||||
data = Crypto.decrypt(data, password)
|
||||
if data and data.pk and data.dh == socket.dhost then
|
||||
local trustList = Util.readTable('usr/.known_hosts') or { }
|
||||
trustList[data.dh] = data.pk
|
||||
trustList[data.dh] = Util.byteArrayToHex(data.pk)
|
||||
Util.writeTable('usr/.known_hosts', trustList)
|
||||
|
||||
socket:write({ success = true, msg = 'Trust accepted' })
|
||||
@@ -26,8 +26,8 @@ local function trustConnection(socket)
|
||||
end
|
||||
|
||||
Event.addRoutine(function()
|
||||
|
||||
print('trust: listening on port 19')
|
||||
|
||||
while true do
|
||||
local socket = Socket.server(19)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user