grub2/0196-commands-verify-Fix-sha1-context-zeroing-out.patch
Peter Jones 8c6b1ac71e Reconcile with upstream once again.
Also include some minor fixes for gcc 5.1.1

Signed-off-by: Peter Jones <pjones@redhat.com>
2015-07-22 09:46:32 -04:00

28 lines
1013 B
Diff

From 37ba761b1cba6e210fa451a7f3dbd6e3dab58a65 Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phcoder@gmail.com>
Date: Sat, 24 Jan 2015 21:27:10 +0100
Subject: [PATCH 196/506] commands/verify: Fix sha1 context zeroing-out.
Current code doesn't zero-out context completely. It's a minor issue
really as sha1 init already takes care of initing the context.
---
grub-core/commands/verify.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/commands/verify.c b/grub-core/commands/verify.c
index d599576..6569391 100644
--- a/grub-core/commands/verify.c
+++ b/grub-core/commands/verify.c
@@ -308,7 +308,7 @@ grub_load_public_key (grub_file_t f)
if (!sk)
goto fail;
- grub_memset (fingerprint_context, 0, sizeof (fingerprint_context));
+ grub_memset (fingerprint_context, 0, GRUB_MD_SHA1->contextsize);
GRUB_MD_SHA1->init (fingerprint_context);
GRUB_MD_SHA1->write (fingerprint_context, "\x99", 1);
len_be = grub_cpu_to_be16 (len);
--
2.4.3