Refactor trustConnection function to use getTrustKey instead of getPassword for improved security
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user