1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-19 01:37:39 +00:00

rework app registry - trust tweaks

This commit is contained in:
kepler155c@gmail.com
2017-05-19 19:00:23 -04:00
parent fbe2c9e909
commit 8ecfea1524
33 changed files with 282 additions and 68 deletions

View File

@@ -14,17 +14,17 @@ process:newThread('trust_server', function()
if data then
local password = os.getPassword()
if not password then
socket:write('No password has been set')
socket:write({ msg = 'No password has been set' })
else
data = Crypto.decrypt(data, password)
if data and data.pk and data.dh then
if data and data.pk and data.dh == socket.dhost then
local trustList = Util.readTable('.known_hosts') or { }
trustList[data.dh] = data.pk
Util.writeTable('.known_hosts', trustList)
socket:write('Trust accepted')
socket:write({ success = true, msg = 'Trust accepted' })
else
socket:write('Invalid password')
socket:write({ msg = 'Invalid password' })
end
end
end