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:
Matthias Schiffer 2017-02-25 01:04:03 +01:00
parent ac55ad56b5
commit 6a2d288006
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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