mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-15 06:33:49 +00:00
trivial: Fix writing uSWIDv2 payloads
The optional flags come last in the header.
This commit is contained in:
parent
a01379f835
commit
2fef67db3b
@ -258,13 +258,13 @@ fu_uswid_firmware_write(FuFirmware *firmware, GError **error)
|
||||
g_byte_array_append(buf, USWID_HEADER_MAGIC, sizeof(USWID_HEADER_MAGIC));
|
||||
fu_byte_array_append_uint8(buf, priv->hdrver);
|
||||
fu_byte_array_append_uint16(buf, fu_uswid_firmware_calculate_hdrsz(self), G_LITTLE_ENDIAN);
|
||||
fu_byte_array_append_uint32(buf, payload->len, G_LITTLE_ENDIAN);
|
||||
if (priv->hdrver >= 2) {
|
||||
guint8 flags = 0;
|
||||
if (priv->compressed)
|
||||
flags |= USWID_HEADER_FLAG_COMPRESSED;
|
||||
fu_byte_array_append_uint8(buf, flags);
|
||||
}
|
||||
fu_byte_array_append_uint32(buf, payload->len, G_LITTLE_ENDIAN);
|
||||
g_byte_array_append(buf, payload->data, payload->len);
|
||||
|
||||
/* success */
|
||||
|
Loading…
Reference in New Issue
Block a user