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 data = socket:read(2)
if data then
local password = Security.getPassword()
if not password then
local trustKey = Security.getTrustKey()
if not trustKey then
socket:write({ msg = 'No password has been set' })
else
if validateData(data, password, socket.dhost) then
if validateData(data, trustKey, socket.dhost) then
print("Accepted trust from " .. socket.dhost)
socket:write({ success = true, msg = 'Trust accepted' })
return