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 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
|
||||
|
||||
Reference in New Issue
Block a user