-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.
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;
switch (c)
{
case 'c':
- c = strtoul (optarg, NULL, 0);
+ count = strtoul (optarg, NULL, 0);
break;
case 'l':
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);
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);