Open wsp1991 opened 3 years ago
Thanks for the reviewing. Indeed, the quality of random numbers generated by random() is not as good as /dev/random. I'll evaluate converting random() to getrandom() which draws random bytes from /dev/random or /dev/urandom.
I'm working on the patch to replace generate_pw_salt() with crypt_gensalt() and this should fix https://github.com/lcp/mokutil/issues/44 all together.
random() is an insecure random number generation function,Is there a safer solution,such as /dev/random
generate_pw_salt (char salt[], const unsigned int salt_size) { struct timeval tv; char *rand_str; int remain = salt_size;
}