]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-mkpasswd-pbkdf2.c (main): Rename top-level `c' variable
authorColin Watson <cjwatson@ubuntu.com>
Mon, 7 Jun 2010 13:15:57 +0000 (14:15 +0100)
committerColin Watson <cjwatson@ubuntu.com>
Mon, 7 Jun 2010 13:15:57 +0000 (14:15 +0100)
to `count', fixing variable shadowing that broke the -c option.

ChangeLog
util/grub-mkpasswd-pbkdf2.c

index 779973f1e7efbedb663c616d15ac95bc88440a13..07c262dc273101f1b76a6eccbe2858c100c1f3a0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-2010-06-05  Colin Watson  <cjwatson@debian.org>
+2010-06-07  Colin Watson  <cjwatson@ubuntu.com>
+
+       * util/grub-mkpasswd-pbkdf2.c (main): Rename top-level `c' variable
+       to `count', fixing variable shadowing that broke the -c option.
+
+2010-06-05  Colin Watson  <cjwatson@ubuntu.com>
 
        * util/grub.d/00_header.in: Quote values assigned to `saved_entry',
        in case they contain spaces.
index a00b1e99072f0566bab8b6c353c48a5974b3e7df..944c6c46a69ba6f43f83657c17cb397c0bcd5cd3 100644 (file)
@@ -112,7 +112,7 @@ hexify (char *hex, grub_uint8_t *bin, grub_size_t n)
 int
 main (int argc, char *argv[])
 {
-  unsigned int c = 10000, buflen = 64, saltlen = 64;
+  unsigned int count = 10000, buflen = 64, saltlen = 64;
   char *pass1, *pass2;
   char *bufhex, *salthex;
   gcry_err_code_t gcry_err;
@@ -137,7 +137,7 @@ main (int argc, char *argv[])
       switch (c)
        {
        case 'c':
-         c = strtoul (optarg, NULL, 0);
+         count = strtoul (optarg, NULL, 0);
          break;
 
        case 'l':
@@ -307,7 +307,7 @@ main (int argc, char *argv[])
   gcry_err = grub_crypto_pbkdf2 (GRUB_MD_SHA512,
                                 (grub_uint8_t *) pass1, strlen (pass1),
                                 salt, saltlen,
-                                c, buf, buflen);
+                                count, buf, buflen);
   memset (pass1, 0, strlen (pass1));
   free (pass1);
 
@@ -327,7 +327,8 @@ main (int argc, char *argv[])
   hexify (bufhex, buf, buflen);
   hexify (salthex, salt, saltlen);
 
-  printf ("Your PBKDF2 is grub.pbkdf2.sha512.%d.%s.%s\n", c, salthex, bufhex);
+  printf ("Your PBKDF2 is grub.pbkdf2.sha512.%d.%s.%s\n",
+         count, salthex, bufhex);
   memset (buf, 0, buflen);
   memset (bufhex, 0, 2 * buflen);
   free (buf);