about summary refs log tree commit diff
path: root/src/core/nm-core-utils.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2022-08-13 16:40:06 +0200
committerMichael Biebl <biebl@debian.org>2022-08-13 16:40:06 +0200
commit38ca7ae9c3556e9a5b50ee15015ea194e6ca8da1 (patch)
tree99f19f118f550362c3288e7b82a7aab3a75c8d64 /src/core/nm-core-utils.c
parentc2473cb3f165975f2899ccef11f036c9762a8aa3 (diff)
parent49ac65f875a36d7ebcbc8270cf0fc60acbb2e052 (diff)
Merge tag 'debian/1.38.4-1' into debian/bullseye-backports
network-manager Debian release 1.38.4-1
Diffstat (limited to 'src/core/nm-core-utils.c')
-rw-r--r--src/core/nm-core-utils.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c
index c8b789b3..60c286ee 100644
--- a/src/core/nm-core-utils.c
+++ b/src/core/nm-core-utils.c
@@ -2815,7 +2815,10 @@ _host_id_read(guint8 **out_host_id, gsize *out_host_id_len)
         int    base64_save  = 0;
         gsize  len;
 
-        success = nm_utils_random_bytes(rnd_buf, sizeof(rnd_buf));
+        if (nm_random_get_crypto_bytes(rnd_buf, sizeof(rnd_buf)) < 0)
+            nm_random_get_bytes_full(rnd_buf, sizeof(rnd_buf), &success);
+        else
+            success = TRUE;
 
         /* Our key is really binary data. But since we anyway generate a random seed
          * (with 32 random bytes), don't write it in binary, but instead create
@@ -3313,7 +3316,7 @@ nm_utils_stable_id_random(void)
 {
     char buf[15];
 
-    nm_utils_random_bytes(buf, sizeof(buf));
+    nm_random_get_bytes(buf, sizeof(buf));
     return g_base64_encode((guchar *) buf, sizeof(buf));
 }
 
@@ -3684,7 +3687,7 @@ nm_utils_hw_addr_gen_random_eth(const char *current_mac_address,
 {
     struct ether_addr bin_addr;
 
-    nm_utils_random_bytes(&bin_addr, ETH_ALEN);
+    nm_random_get_bytes(&bin_addr, ETH_ALEN);
     _hw_addr_eth_complete(&bin_addr, current_mac_address, generate_mac_address_mask);
     return nm_utils_hwaddr_ntoa(&bin_addr, ETH_ALEN);
 }