Commit Graph

4 Commits

Author SHA1 Message Date
Richard Hughes
0c51630991 Check firmware magic in a more standard way
Some parsers are ignoring the magic when using _FLAG_IGNORE_CHECKSUM
(which is wrong; fuzzers have no problem with enforcing a static prefix)
and other either disregard the offset or check the magic in an unsafe
way. Also, use FWUPD_ERROR_INVALID_FILE consistently for magic failure.

Add a vfunc, and move all the clever code into one place.
2022-07-14 14:48:15 +01:00
Richard Hughes
be6af6d11c trivial: Fix a tiny memory leak when parsing oprom firmware 2022-07-01 13:57:18 +01:00
Richard Hughes
3236682a71 Allow decoding linear firmware with 'fwupdtool firmware-parse'
We cannot enable this for all formats as some firmware images have junk
data or are aligned in a specific way. Only do this when we know it is
safe.
2022-06-28 10:09:58 +01:00
Richard Hughes
08c7172168 Add support for parsing OptionROM firmware 2022-06-28 10:09:58 +01:00