mkpasswd: Default to MD5-based crypt instead of SHA-based.
We have own code for MD5-based crypt and can therefore support this even if the OS does not. The SHA-based crypts are not ubiquitous yet.
This commit is contained in:
parent
0a2e2a35c8
commit
62a2743ab7
|
@ -162,16 +162,7 @@ main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flag & FLAG_MD5)
|
if(flag & FLAG_BLOWFISH)
|
||||||
{
|
|
||||||
if(length == 0)
|
|
||||||
length = 8;
|
|
||||||
if(flag & FLAG_SALT)
|
|
||||||
salt = make_md5_salt_para(saltpara);
|
|
||||||
else
|
|
||||||
salt = make_md5_salt(length);
|
|
||||||
}
|
|
||||||
else if(flag & FLAG_BLOWFISH)
|
|
||||||
{
|
{
|
||||||
if(length == 0)
|
if(length == 0)
|
||||||
length = 22;
|
length = 22;
|
||||||
|
@ -189,6 +180,15 @@ 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 */
|
||||||
|
@ -231,11 +231,11 @@ main(int argc, char *argv[])
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(length == 0)
|
if(length == 0)
|
||||||
length = 16;
|
length = 8;
|
||||||
if(flag & FLAG_SALT)
|
if(flag & FLAG_SALT)
|
||||||
salt = make_sha512_salt_para(saltpara);
|
salt = make_md5_salt_para(saltpara);
|
||||||
else
|
else
|
||||||
salt = make_sha512_salt(length);
|
salt = make_md5_salt(length);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flag & FLAG_PASS)
|
if(flag & FLAG_PASS)
|
||||||
|
|
Loading…
Reference in New Issue