Commit Graph

19 Commits

Author SHA1 Message Date
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Mario Limonciello
73cdf067ed trivial: fixup includes for a variety of plugins 2021-06-14 10:12:45 +01:00
Richard Hughes
52441f28a4 Allow objects to deserialize to XML
This makes a lot more sense; we can parse a firmware and export the same XML
we would use in a .builder.xml file. This allows us to two two things:

 * Check we can round trip from XML -> binary -> XML

 * Using a .builder.xml file we can check ->write() is endian safe
2021-03-15 12:07:30 +00:00
Richard Hughes
5d5648745e ccgx: Fix building firmware after the FuFirmwareImage conversion 2021-03-10 19:18:28 +00:00
Richard Hughes
1981c63d58 Remove FuFirmwareImage and just use FuFirmware instead
This allows us to 'nest' firmware formats, and removes a ton of duplication.

The aim here is to deprecate FuFirmwareImage -- it's almost always acting
as a 'child' FuFirmware instance, and even copies most of the vfuncs to allow
custom types. If I'm struggling to work out what should be a FuFirmware and
what should be a FuFirmwareImage then a plugin author has no hope.

For simple payloads we were adding bytes into an image and then the image into
a firmware. This gets really messy when most plugins are treating the FuFirmware
*as* the binary firmware file.

The GBytes saved in the FuFirmware would be considered the payload with the
aim of not using FuFirmwareImage in the single-image case.
2021-03-09 21:14:12 +00:00
Richard Hughes
9024112549 ccgx: Allow ignoring CCGX firmware checksum failures
This much improves fuzzing performance.
2021-03-05 11:37:46 +00:00
Richard Hughes
49527b76ca ccgx: Allow turning off the checksum verification 2021-02-17 08:53:37 +00:00
Richard Hughes
86c6c2d4a3 Add fu_firmware_set_version_raw()
A few plugins need this now, so move it into the base class.
2021-02-16 15:24:29 +00:00
Richard Hughes
4822b3317b ccgx: Check for FPE when parsing the metadata section 2021-02-15 16:47:27 +00:00
Richard Hughes
6a33d2d99e ccgx: Fix division by zero for invalid firmware 2021-02-12 13:54:01 +00:00
Richard Hughes
54bc512388 Add firmware flags for presence of CRC and VID/PID 2021-02-11 20:27:20 +00:00
Richard Hughes
b242fe4870 ccgx: Implement FuFirmware->build() to add fuzzing support 2021-02-11 14:53:43 +00:00
Richard Hughes
2e73bef923 Be more paranoid when parsing from ASCII buffers 2021-02-09 16:37:25 +00:00
Richard Hughes
f68107e609 ccgx: Fix a critical warning when parsing invalid firmware 2021-01-05 15:59:30 +00:00
Richard Hughes
364e2685ca Do not show unprintable chars from invalid firmware in the logs 2021-01-05 15:15:07 +00:00
Richard Hughes
a14de30153 trivial: Require <string.h> for strlen() and memcpy() 2020-12-14 16:49:03 +00:00
Richard Hughes
e5a4d52ea1 trivial: Spelling fixes from codespell 2020-06-18 20:49:12 +01:00
Richard Hughes
4b16642dc5 ccgx: Fix a potential division by zero
Spotted by Coverity.
2020-05-22 15:34:16 +01:00
Richard Hughes
81da69e73d ccgx: Implement writing firmware to flash
Correctly attach into the alternate mode after the update has completed.

The vendor was appending two files to make LVFS distribution 'easier' but I'd
much rather use the same deliverables as Windows. This also allows us to
simplify the firmware loading.
2020-03-27 13:25:40 +00:00