Refactor trustConnection function to use getTrustKey instead of getPassword for improved security

This commit is contained in:
MayaTheShy
2026-03-22 11:20:57 -04:00
parent 39caa32908
commit 9e06241ac3

View File

@@ -25,11 +25,11 @@ end
local function trustConnection(socket) local function trustConnection(socket)
local data = socket:read(2) local data = socket:read(2)
if data then if data then
local password = Security.getPassword() local trustKey = Security.getTrustKey()
if not password then if not trustKey then
socket:write({ msg = 'No password has been set' }) socket:write({ msg = 'No password has been set' })
else else
if validateData(data, password, socket.dhost) then if validateData(data, trustKey, socket.dhost) then
print("Accepted trust from " .. socket.dhost) print("Accepted trust from " .. socket.dhost)
socket:write({ success = true, msg = 'Trust accepted' }) socket:write({ success = true, msg = 'Trust accepted' })
return return