diff --git a/Src/Hyperion-firmware-cct/boot/cct/boot.lua b/Src/Hyperion-firmware-cct/boot/cct/boot.lua index fba14d5..97759c9 100644 --- a/Src/Hyperion-firmware-cct/boot/cct/boot.lua +++ b/Src/Hyperion-firmware-cct/boot/cct/boot.lua @@ -198,6 +198,7 @@ local ok, err = xpcall(function() local smallestDiff = math.huge for k, _ in pairs(tbl) do + if k==target then return k end local diff = math.abs(k - target) if diff < smallestDiff then smallestDiff = diff diff --git a/Src/Hyperion-firmware-cct/lib/modules/cc-tweaked/25_tty.kmod b/Src/Hyperion-firmware-cct/lib/modules/cc-tweaked/25_tty.kmod index 779b1cb..6f1698d 100644 --- a/Src/Hyperion-firmware-cct/lib/modules/cc-tweaked/25_tty.kmod +++ b/Src/Hyperion-firmware-cct/lib/modules/cc-tweaked/25_tty.kmod @@ -49,6 +49,7 @@ local function findClosest(tbl, target) local smallestDiff = math.huge for k, _ in pairs(tbl) do + if k==target then return k end local diff = math.abs(k - target) if diff < smallestDiff then smallestDiff = diff diff --git a/Src/Hyperion-kernel/lib/modules/hyperion/40_auth.kmod b/Src/Hyperion-kernel/lib/modules/hyperion/40_auth.kmod index 05229f7..e05f2c4 100644 --- a/Src/Hyperion-kernel/lib/modules/hyperion/40_auth.kmod +++ b/Src/Hyperion-kernel/lib/modules/hyperion/40_auth.kmod @@ -150,16 +150,11 @@ end local pepper = getFile("/etc/pam.d/secret") local function genSalt() - local chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./" - local s = "" - for i = 1, 16 do - s = s .. chars:sub(math.random(1, #chars), math.random(1, #chars)) - end - return s + return toHex(math.random(0,2^32)) end local function hashPassword(password, salt) - local key = (pepper .. salt):sub(1, 32) + local key = (pepper .. salt) return blake2s(password, key) end diff --git a/installers/HyperionOS-install-cct.lua b/installers/HyperionOS-install-cct.lua index 248a527..30154e2 100644 --- a/installers/HyperionOS-install-cct.lua +++ b/installers/HyperionOS-install-cct.lua @@ -6,10 +6,11 @@ local install,releasename=function()end,"" local exitall=false local function download(url) - shell.run("wget "..url.." /tmp/download") - local lib = require("tmp.download") - fs.delete("/tmp/download") - return lib + local data,err=http.get(url) + if not data then error(err) end + local func,err=load(data.readAll(),"@download","t",_ENV) + if not func then error(err) end + return func() end print("Installing JSON...")