#65 safe concat where appropriate
This commit is contained in:
@@ -107,7 +107,7 @@ function crypto.encrypt(plaintext)
|
||||
local ciphertext = c_eng.cipher.asHex() ---@type hex
|
||||
|
||||
log.debug("crypto.encrypt: aes128-ctr-mode took " .. (util.time() - start) .. "ms")
|
||||
log.debug("ciphertext: " .. ciphertext)
|
||||
log.debug("ciphertext: " .. util.strval(ciphertext))
|
||||
|
||||
return iv, ciphertext
|
||||
end
|
||||
@@ -129,7 +129,7 @@ function crypto.decrypt(iv, ciphertext)
|
||||
local plaintext = stream.toString(stream.fromHex(plaintext_hex))
|
||||
|
||||
log.debug("crypto.decrypt: aes128-ctr-mode took " .. (util.time() - start) .. "ms")
|
||||
log.debug("plaintext: " .. plaintext)
|
||||
log.debug("plaintext: " .. util.strval(plaintext))
|
||||
|
||||
return plaintext
|
||||
end
|
||||
@@ -146,7 +146,7 @@ function crypto.hmac(message_hex)
|
||||
local hash = c_eng.hmac.asHex() ---@type hex
|
||||
|
||||
log.debug("crypto.hmac: hmac-sha1 took " .. (util.time() - start) .. "ms")
|
||||
log.debug("hmac: " .. hash)
|
||||
log.debug("hmac: " .. util.strval(hash))
|
||||
|
||||
return hash
|
||||
end
|
||||
|
||||
@@ -177,7 +177,7 @@ function log.dmesg(msg, tag, tag_color)
|
||||
out.write(lines[i])
|
||||
end
|
||||
|
||||
_log("[" .. t_stamp .. "] " .. tag .. " " .. msg)
|
||||
_log(util.c("[", t_stamp, "] ", tag, " ", msg))
|
||||
end
|
||||
|
||||
-- log debug messages
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
-- Protected Peripheral Manager
|
||||
--
|
||||
|
||||
local log = require("scada-common.log")
|
||||
local log = require("scada-common.log")
|
||||
local util = require("scada-common.util")
|
||||
|
||||
---@class ppm
|
||||
local ppm = {}
|
||||
@@ -76,7 +77,7 @@ local function peri_init(iface)
|
||||
count_str = " [" .. self.fault_counts[key] .. " total faults]"
|
||||
end
|
||||
|
||||
log.error("PPM: protected " .. key .. "() -> " .. result .. count_str)
|
||||
log.error(util.c("PPM: protected ", key, "() -> ", result, count_str))
|
||||
end
|
||||
|
||||
self.fault_counts[key] = self.fault_counts[key] + 1
|
||||
@@ -176,7 +177,7 @@ function ppm.mount_all()
|
||||
for i = 1, #ifaces do
|
||||
_ppm_sys.mounts[ifaces[i]] = peri_init(ifaces[i])
|
||||
|
||||
log.info("PPM: found a " .. _ppm_sys.mounts[ifaces[i]].type .. " (" .. ifaces[i] .. ")")
|
||||
log.info(util.c("PPM: found a ", _ppm_sys.mounts[ifaces[i]].type, " (", ifaces[i], ")"))
|
||||
end
|
||||
|
||||
if #ifaces == 0 then
|
||||
@@ -199,7 +200,7 @@ function ppm.mount(iface)
|
||||
pm_type = _ppm_sys.mounts[iface].type
|
||||
pm_dev = _ppm_sys.mounts[iface].dev
|
||||
|
||||
log.info("PPM: mount(" .. iface .. ") -> found a " .. pm_type)
|
||||
log.info(util.c("PPM: mount(", iface, ") -> found a ", pm_type))
|
||||
break
|
||||
end
|
||||
end
|
||||
@@ -221,9 +222,9 @@ function ppm.handle_unmount(iface)
|
||||
pm_type = lost_dev.type
|
||||
pm_dev = lost_dev.dev
|
||||
|
||||
log.warning("PPM: lost device " .. pm_type .. " mounted to " .. iface)
|
||||
log.warning(util.c("PPM: lost device ", pm_type, " mounted to ", iface))
|
||||
else
|
||||
log.error("PPM: lost device unknown to the PPM mounted to " .. iface)
|
||||
log.error(util.c("PPM: lost device unknown to the PPM mounted to ", iface))
|
||||
end
|
||||
|
||||
return pm_type, pm_dev
|
||||
|
||||
Reference in New Issue
Block a user