From b01524d5e79080452c56268a3f62a2e13a1ecfce Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 22 Mar 2023 10:21:30 +0100 Subject: [PATCH] nmcli: fix generating hotspot password The generated password was all non-alphanumeric characters. Fixes: 6e96d7173168 ('all: use nm_random_*() instead of g_random_*()') (cherry picked from commit ac2fb0e93d1a7c9c41eba5c77e7e62a9eb07691b) --- src/nmcli/devices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nmcli/devices.c b/src/nmcli/devices.c index 31e7d8be4d..4c9e7d9f4e 100644 --- a/src/nmcli/devices.c +++ b/src/nmcli/devices.c @@ -4107,7 +4107,7 @@ generate_wpa_key(char *key, size_t len) do { c = nm_random_u64_range_full(33, 126, TRUE); /* too many non alphanumeric characters are hard to remember for humans */ - } while (g_ascii_isalnum(c)); + } while (!g_ascii_isalnum(c)); key[i] = (char) c; }