#424 fixed key derivation init

This commit is contained in:
Mikayla Fischler 2024-02-19 19:28:12 -05:00
parent 8ac46faf36
commit 126d6eb163
2 changed files with 7 additions and 7 deletions

View File

@ -7,7 +7,7 @@ local log = require("scada-common.log")
local util = require("scada-common.util")
local md5 = require("lockbox.digest.md5")
local sha256 = require("lockbox.digest.sha2_256")
local sha1 = require("lockbox.digest.sha1")
local pbkdf2 = require("lockbox.kdf.pbkdf2")
local hmac = require("lockbox.mac.hmac")
local stream = require("lockbox.util.stream")
@ -31,12 +31,12 @@ function network.init_mac(passkey)
local key_deriv = pbkdf2()
-- setup PBKDF2
key_deriv.setPassword(passkey)
key_deriv.setPRF(hmac().setBlockSize(64).setDigest(sha1))
key_deriv.setBlockLen(20)
key_deriv.setDKeyLen(20)
key_deriv.setIterations(256)
key_deriv.setSalt("pepper")
key_deriv.setIterations(32)
key_deriv.setBlockLen(8)
key_deriv.setDKeyLen(16)
key_deriv.setPRF(hmac().setBlockSize(64).setDigest(sha256))
key_deriv.setPassword(passkey)
key_deriv.finish()
c_eng.key = array.fromHex(key_deriv.asHex())

View File

@ -22,7 +22,7 @@ local t_pack = table.pack
local util = {}
-- scada-common version
util.version = "1.1.13"
util.version = "1.1.14"
util.TICK_TIME_S = 0.05
util.TICK_TIME_MS = 50