]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/libcrypt-util.c
Simplify random number selection
[thirdparty/systemd.git] / src / shared / libcrypt-util.c
index 8a46ace205a921c279df611e92c03172581511ea..81e6f1754c4f8973fb3d5cc99f0a29dbe7d151e6 100644 (file)
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: LGPL-2.1+ */
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #if HAVE_CRYPT_H
 /* libxcrypt is a replacement for glibc's libcrypt, and libcrypt might be
@@ -76,7 +76,7 @@ int make_salt(char **ret) {
         log_debug("Generating fallback salt for hash prefix: $6$");
 
         /* Insist on the best randomness by setting RANDOM_BLOCK, this is about keeping passwords secret after all. */
-        r = genuine_random_bytes(raw, sizeof(raw), RANDOM_BLOCK);
+        r = crypto_random_bytes(raw, sizeof(raw));
         if (r < 0)
                 return r;
 
@@ -197,7 +197,6 @@ int test_password_one(const char *hashed_password, const char *password) {
 }
 
 int test_password_many(char **hashed_password, const char *password) {
-        char **hpw;
         int r;
 
         STRV_FOREACH(hpw, hashed_password) {