autoupdater: use SHA256 checksums instead of SHA512
We already use SHA256 for the manifest signature, so we'll be able to unify the implementations after some refactoring.
This commit is contained in:
parent
ac55ad56b5
commit
6a2d288006
|
@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/package.mk
|
|||
define Package/autoupdater
|
||||
SECTION:=admin
|
||||
CATEGORY:=Administration
|
||||
DEPENDS:=+lua-platform-info +libuci-lua +luci-lib-nixio +ecdsautils +!BUSYBOX_CONFIG_SHA512SUM:coreutils-sha512sum
|
||||
DEPENDS:=+lua-platform-info +libuci-lua +luci-lib-nixio +ecdsautils +!BUSYBOX_CONFIG_SHA256SUM:coreutils-sha256sum
|
||||
TITLE:=Automatically update firmware
|
||||
endef
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ local function read_manifest(mirror)
|
|||
ret.date = autoupdater_util.parse_date(date)
|
||||
elseif priority then
|
||||
ret.priority = tonumber(priority)
|
||||
elseif model == platform_info.get_image_name() then
|
||||
elseif model == platform_info.get_image_name() and #checksum == 64 then
|
||||
ret.version = version
|
||||
ret.checksum = checksum
|
||||
ret.filename = filename
|
||||
|
@ -308,7 +308,7 @@ local function autoupdate(mirror)
|
|||
return false
|
||||
end
|
||||
|
||||
local popen = io.popen(string.format("exec sha512sum '%s'", image))
|
||||
local popen = io.popen(string.format("exec sha256sum '%s'", image))
|
||||
local checksum = popen:read('*l'):match('^%x+')
|
||||
popen:close()
|
||||
if checksum ~= manifest.checksum then
|
||||
|
|
Loading…
Reference in New Issue