]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
commands/verify: Fix sha1 context zeroing-out.
authorVladimir Serbinenko <phcoder@gmail.com>
Sat, 24 Jan 2015 20:27:10 +0000 (21:27 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sat, 24 Jan 2015 20:27:10 +0000 (21:27 +0100)
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

index d5995766b4c9e2c2918ff871c6f2776b31975395..6569391898cac10d91bd3b5e060de510baaa0360 100644 (file)
@@ -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);