From: Thomas Weißschuh Date: Sun, 8 Dec 2024 08:55:27 +0000 (+0100) Subject: libblkid: (gpt) use blkid_probe_verify_csum() for partition array checksum X-Git-Tag: v2.40.3~52 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=74a88250bdec3f83048de90594319e6e4c5cc1e2;p=thirdparty%2Futil-linux.git libblkid: (gpt) use blkid_probe_verify_csum() for partition array checksum All checksums should be tests with this function to keep checksum validation configurable. Signed-off-by: Thomas Weißschuh (cherry picked from commit fce366c4982273cd73df727338ed02d9f357b6c6) --- diff --git a/libblkid/src/partitions/gpt.c b/libblkid/src/partitions/gpt.c index 473bf5c0e2..a8846be21f 100644 --- a/libblkid/src/partitions/gpt.c +++ b/libblkid/src/partitions/gpt.c @@ -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; }