* util/grub-mkpasswd-pbkdf2.c (main): Rename top-level `c' variable
to `count', fixing variable shadowing that broke the -c option.
This commit is contained in:
parent
71c3809882
commit
db8fa1ad87
2 changed files with 11 additions and 5 deletions
|
@ -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',
|
* util/grub.d/00_header.in: Quote values assigned to `saved_entry',
|
||||||
in case they contain spaces.
|
in case they contain spaces.
|
||||||
|
|
|
@ -112,7 +112,7 @@ hexify (char *hex, grub_uint8_t *bin, grub_size_t n)
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
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 *pass1, *pass2;
|
||||||
char *bufhex, *salthex;
|
char *bufhex, *salthex;
|
||||||
gcry_err_code_t gcry_err;
|
gcry_err_code_t gcry_err;
|
||||||
|
@ -137,7 +137,7 @@ main (int argc, char *argv[])
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case 'c':
|
case 'c':
|
||||||
c = strtoul (optarg, NULL, 0);
|
count = strtoul (optarg, NULL, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'l':
|
case 'l':
|
||||||
|
@ -307,7 +307,7 @@ main (int argc, char *argv[])
|
||||||
gcry_err = grub_crypto_pbkdf2 (GRUB_MD_SHA512,
|
gcry_err = grub_crypto_pbkdf2 (GRUB_MD_SHA512,
|
||||||
(grub_uint8_t *) pass1, strlen (pass1),
|
(grub_uint8_t *) pass1, strlen (pass1),
|
||||||
salt, saltlen,
|
salt, saltlen,
|
||||||
c, buf, buflen);
|
count, buf, buflen);
|
||||||
memset (pass1, 0, strlen (pass1));
|
memset (pass1, 0, strlen (pass1));
|
||||||
free (pass1);
|
free (pass1);
|
||||||
|
|
||||||
|
@ -327,7 +327,8 @@ main (int argc, char *argv[])
|
||||||
hexify (bufhex, buf, buflen);
|
hexify (bufhex, buf, buflen);
|
||||||
hexify (salthex, salt, saltlen);
|
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 (buf, 0, buflen);
|
||||||
memset (bufhex, 0, 2 * buflen);
|
memset (bufhex, 0, 2 * buflen);
|
||||||
free (buf);
|
free (buf);
|
||||||
|
|
Loading…
Add table
Reference in a new issue