Skip to content

Commit

Permalink
libblkid: (gpt) use blkid_probe_verify_csum() for partition array che…
Browse files Browse the repository at this point in the history
…cksum

All checksums should be tests with this function to keep checksum
validation configurable.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
  • Loading branch information
t-8ch committed Dec 8, 2024
1 parent 139980a commit fce366c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libblkid/src/partitions/gpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ static struct gpt_header *get_gpt_header(

/* Validate entries */
crc = count_crc32((unsigned char *) *ents, esz, 0, 0);
if (crc != le32_to_cpu(h->partition_entry_array_crc32)) {
if (!blkid_probe_verify_csum(pr, crc, le32_to_cpu(h->partition_entry_array_crc32))) {
DBG(LOWPROBE, ul_debug("GPT entries corrupted"));
return NULL;
}
Expand Down

0 comments on commit fce366c

Please sign in to comment.