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 01b7a527a3
commit 920cb1dc4a

View file

@ -190,15 +190,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 */
@ -219,7 +210,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)
{ {
@ -238,6 +229,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)
{ {