Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 May 2015 09:40:35 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r283141 - head/usr.sbin/uefisign
Message-ID:  <201505200940.t4K9eZud060231@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Wed May 20 09:40:34 2015
New Revision: 283141
URL: https://svnweb.freebsd.org/changeset/base/283141

Log:
  Remove the warning about invalid PE checksum; apparently nothing
  cares about those checksums anyway.
  
  MFC after:	1 month
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/usr.sbin/uefisign/pe.c

Modified: head/usr.sbin/uefisign/pe.c
==============================================================================
--- head/usr.sbin/uefisign/pe.c	Wed May 20 09:36:25 2015	(r283140)
+++ head/usr.sbin/uefisign/pe.c	Wed May 20 09:40:34 2015	(r283141)
@@ -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
 #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
 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, 
 #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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505200940.t4K9eZud060231>