mkpasswd: Default to SHA512 instead of inherently insecure DES.

This commit is contained in:
William Pitcock 2010-09-15 03:44:58 -05:00
parent 2f38ac760c
commit 1146ee7dc4
1 changed files with 10 additions and 10 deletions

View File

@ -189,15 +189,6 @@ main(int argc, char *argv[])
else else
salt = make_sha256_salt(length); salt = make_sha256_salt(length);
} }
else if(flag & FLAG_SHA512)
{
if(length == 0)
length = 16;
if(flag & FLAG_SALT)
salt = make_sha512_salt_para(saltpara);
else
salt = make_sha512_salt(length);
}
else if(flag & FLAG_EXT) else if(flag & FLAG_EXT)
{ {
/* XXX - rounds needs to be done */ /* XXX - rounds needs to be done */
@ -218,7 +209,7 @@ main(int argc, char *argv[])
salt = make_ext_salt(rounds); salt = make_ext_salt(rounds);
} }
} }
else else if (flag & FLAG_DES)
{ {
if(flag & FLAG_SALT) if(flag & FLAG_SALT)
{ {
@ -237,6 +228,15 @@ main(int argc, char *argv[])
salt = make_des_salt(); salt = make_des_salt();
} }
} }
else
{
if(length == 0)
length = 16;
if(flag & FLAG_SALT)
salt = make_sha512_salt_para(saltpara);
else
salt = make_sha512_salt(length);
}
if(flag & FLAG_PASS) if(flag & FLAG_PASS)
{ {