a5bd9f6
From f7db5c611d5560adea0c15e804d3b6dbca5d03b9 Mon Sep 17 00:00:00 2001
a5bd9f6
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
a5bd9f6
Date: Fri, 5 Apr 2013 10:52:13 +0200
a5bd9f6
Subject: [PATCH 260/364] 	* grub-core/commands/verify.c: Use
a5bd9f6
 GRUB_CHAR_BIT.
a5bd9f6
a5bd9f6
---
a5bd9f6
 ChangeLog                   | 4 ++++
a5bd9f6
 grub-core/commands/verify.c | 6 +++---
a5bd9f6
 2 files changed, 7 insertions(+), 3 deletions(-)
a5bd9f6
a5bd9f6
diff --git a/ChangeLog b/ChangeLog
a5bd9f6
index 37021c0..e52e7ee 100644
a5bd9f6
--- a/ChangeLog
a5bd9f6
+++ b/ChangeLog
a5bd9f6
@@ -1,5 +1,9 @@
a5bd9f6
 2013-04-05  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
 
a5bd9f6
+	* grub-core/commands/verify.c: Use GRUB_CHAR_BIT.
a5bd9f6
+
a5bd9f6
+2013-04-05  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
+
a5bd9f6
 	* include/grub/bsdlabel.h: Use enums.
a5bd9f6
 
a5bd9f6
 2013-04-05  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
diff --git a/grub-core/commands/verify.c b/grub-core/commands/verify.c
a5bd9f6
index bd47611..fd6f436 100644
a5bd9f6
--- a/grub-core/commands/verify.c
a5bd9f6
+++ b/grub-core/commands/verify.c
a5bd9f6
@@ -77,7 +77,7 @@ read_packet_header (grub_file_t sig, grub_uint8_t *out_type, grub_size_t *len)
a5bd9f6
 	}
a5bd9f6
       if (l < 224)
a5bd9f6
 	{
a5bd9f6
-	  *len = (l - 192) << 8;
a5bd9f6
+	  *len = (l - 192) << GRUB_CHAR_BIT;
a5bd9f6
 	  if (grub_file_read (sig, &l, sizeof (l)) != 1)
a5bd9f6
 	    return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
a5bd9f6
 	  *len |= l;
a5bd9f6
@@ -273,7 +273,7 @@ grub_load_public_key (grub_file_t f)
a5bd9f6
 	      goto fail;
a5bd9f6
 	    }
a5bd9f6
 	  
a5bd9f6
-	  lb = (grub_be_to_cpu16 (l) + 7) / 8;
a5bd9f6
+	  lb = (grub_be_to_cpu16 (l) + GRUB_CHAR_BIT - 1) / GRUB_CHAR_BIT;
a5bd9f6
 	  if (lb > sizeof (buffer) - sizeof (grub_uint16_t))
a5bd9f6
 	    {
a5bd9f6
 	      grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
a5bd9f6
@@ -457,7 +457,7 @@ grub_verify_signature_real (char *buf, grub_size_t size,
a5bd9f6
 	    {
a5bd9f6
 	      if (ptr + 1 >= readbuf + rem)
a5bd9f6
 		break;
a5bd9f6
-	      l = (((ptr[0] & ~192) << 8) | ptr[1]) + 192;
a5bd9f6
+	      l = (((ptr[0] & ~192) << GRUB_CHAR_BIT) | ptr[1]) + 192;
a5bd9f6
 	      ptr += 2;
a5bd9f6
 	    }
a5bd9f6
 	  else
a5bd9f6
-- 
a5bd9f6
1.8.1.4
a5bd9f6