mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#424 fixed key derivation init
This commit is contained in:
parent
8ac46faf36
commit
126d6eb163
@ -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())
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user