summaryrefslogtreecommitdiffstats
path: root/usr.sbin/uefisign
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2015-06-21 07:00:54 +0000
committertrasz <trasz@FreeBSD.org>2015-06-21 07:00:54 +0000
commit7c999938ee9a41067d117058bd668a3d6f92b3d3 (patch)
treeb253a3f7d30e89c3c2f93c56119ddf62914c8bfd /usr.sbin/uefisign
parent88bb9f05c4ae1bf7513ab7e6d5875ba8769fec5f (diff)
downloadFreeBSD-src-7c999938ee9a41067d117058bd668a3d6f92b3d3.zip
FreeBSD-src-7c999938ee9a41067d117058bd668a3d6f92b3d3.tar.gz
MFC r283141:
Remove the warning about invalid PE checksum; apparently nothing cares about those checksums anyway. Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.sbin/uefisign')
-rw-r--r--usr.sbin/uefisign/pe.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/uefisign/pe.c b/usr.sbin/uefisign/pe.c
index 26bb6d5..f4695b4 100644
--- a/usr.sbin/uefisign/pe.c
+++ b/usr.sbin/uefisign/pe.c
@@ -346,7 +346,9 @@ static void
parse_optional_32_plus(struct executable *x, off_t off,
int number_of_sections)
{
+#if 0
uint32_t computed_checksum;
+#endif
const struct pe_optional_header_32_plus *po;
range_check(x, off, sizeof(*po), "PE Optional Header");
@@ -373,13 +375,13 @@ parse_optional_32_plus(struct executable *x, off_t off,
#if 0
printf("checksum 0x%x at offset %zd, len %zd\n",
po->po_checksum, x->x_checksum_off, x->x_checksum_len);
-#endif
computed_checksum = compute_checksum(x);
if (computed_checksum != po->po_checksum) {
warnx("invalid PE+ checksum; is 0x%x, should be 0x%x",
po->po_checksum, computed_checksum);
}
+#endif
if (x->x_len < x->x_headers_len)
errx(1, "invalid SizeOfHeaders %d", po->po_size_of_headers);
@@ -393,7 +395,9 @@ parse_optional_32_plus(struct executable *x, off_t off,
static void
parse_optional_32(struct executable *x, off_t off, int number_of_sections)
{
+#if 0
uint32_t computed_checksum;
+#endif
const struct pe_optional_header_32 *po;
range_check(x, off, sizeof(*po), "PE Optional Header");
@@ -420,13 +424,13 @@ parse_optional_32(struct executable *x, off_t off, int number_of_sections)
#if 0
printf("checksum at offset %zd, len %zd\n",
x->x_checksum_off, x->x_checksum_len);
-#endif
computed_checksum = compute_checksum(x);
if (computed_checksum != po->po_checksum) {
warnx("invalid PE checksum; is 0x%x, should be 0x%x",
po->po_checksum, computed_checksum);
}
+#endif
if (x->x_len < x->x_headers_len)
errx(1, "invalid SizeOfHeaders %d", po->po_size_of_headers);
OpenPOWER on IntegriCloud