Fix to imporve randomness of the salt

https://github.com/webmin/webmin/pull/1669#discussion_r901011178
This commit is contained in:
Ilia
2022-06-18 23:35:55 +03:00
parent 9d36b7c0e4
commit cd1ae41ad5

View File

@@ -435,8 +435,9 @@ else {
}
# Generate random
$salt8 = substr(time(), -8);
$salt2 = substr(time(), -2);
@saltbase = ('a'..'z', 'A'..'Z', '0'..'9', split(//, time()));
$salt8 = join('', map ($saltbase[rand(@saltbase)], 1..8));
$salt2 = join('', map ($saltbase[rand(@saltbase)], 1..2));
# Create users file
open(UFILE, ">$ufile");