fwtool: do not omit final 16 byte when image does not contain signature

This commit is contained in:
CN_SZTL 2019-10-19 08:17:46 +08:00
parent 29b7da999b
commit 1bcdb25911
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
2 changed files with 4 additions and 2 deletions

View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fwtool
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_FLAGS:=nonshared

View File

@ -322,12 +322,14 @@ extract_data(const char *name)
if (extract_tail(&dbuf, &tr, sizeof(tr)))
break;
data_len = be32_to_cpu(tr.size) - sizeof(tr);
if (tr.magic != cpu_to_be32(FWIMAGE_MAGIC)) {
msg("Data not found\n");
metadata_keep = true;
break;
}
data_len = be32_to_cpu(tr.size) - sizeof(tr);
if (be32_to_cpu(tr.crc32) != tail_crc32(&dbuf, crc32)) {
msg("CRC error\n");
break;