diff options
| author | Michael Biebl <biebl@debian.org> | 2022-08-12 19:27:49 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2022-08-12 19:27:49 +0200 |
| commit | 3237c6678bee0411e44b2d2055fb16c2f86da218 (patch) | |
| tree | e3d8a0dab846c99fa6132c945ec3bbd59b1cc170 /src/core/nm-core-utils.c | |
| parent | b020a0dc29267ec099f631e93f214a0d3549ba40 (diff) | |
| parent | 6accbd3ec0e42d8633bbde4d47ed7bfe854e7e0b (diff) | |
Update upstream source from tag 'upstream/1.38.4'
Update to upstream version '1.38.4' with Debian dir 24b65b102e62687c29d90ce76c47d939b35b96ad
Diffstat (limited to 'src/core/nm-core-utils.c')
| -rw-r--r-- | src/core/nm-core-utils.c | 9 |
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); } |