From fce366c4982273cd73df727338ed02d9f357b6c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sun, 8 Dec 2024 09:55:27 +0100 Subject: [PATCH] libblkid: (gpt) use blkid_probe_verify_csum() for partition array checksum MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All checksums should be tests with this function to keep checksum validation configurable. Signed-off-by: Thomas Weißschuh --- libblkid/src/partitions/gpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libblkid/src/partitions/gpt.c b/libblkid/src/partitions/gpt.c index 473bf5c0e21..a8846be21f2 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; }