diff options
Diffstat (limited to 'debian/patches/0005-nm-fix-rendering-of-password-for-unknown-passthrough.patch')
-rw-r--r-- | debian/patches/0005-nm-fix-rendering-of-password-for-unknown-passthrough.patch | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/debian/patches/0005-nm-fix-rendering-of-password-for-unknown-passthrough.patch b/debian/patches/0005-nm-fix-rendering-of-password-for-unknown-passthrough.patch deleted file mode 100644 index 1f63e09..0000000 --- a/debian/patches/0005-nm-fix-rendering-of-password-for-unknown-passthrough.patch +++ /dev/null @@ -1,115 +0,0 @@ -From: =?utf-8?q?Lukas_M=C3=A4rdian?= <slyon@ubuntu.com> -Date: Thu, 19 May 2022 12:42:11 +0200 -Subject: nm: fix rendering of password for unknown/passthrough WPA types - (#279) - -The NetworkManager backend should not take a shortcut and skip rendering the password, in case of an unknown WPA type, as that might be overwritten by a passthrough value. - -LP: #1972800 ---- - src/nm.c | 15 ++++++------- - tests/parser/test_keyfile.py | 51 ++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 57 insertions(+), 9 deletions(-) - -diff --git a/src/nm.c b/src/nm.c -index 319a80b..b00a21c 100644 ---- a/src/nm.c -+++ b/src/nm.c -@@ -431,9 +431,6 @@ write_tunnel_params(const NetplanNetDefinition* def, GKeyFile *kf) - static void - write_dot1x_auth_parameters(const NetplanAuthenticationSettings* auth, GKeyFile *kf) - { -- if (auth->eap_method == NETPLAN_AUTH_EAP_NONE) -- return; -- - switch (auth->eap_method) { - case NETPLAN_AUTH_EAP_TLS: - g_key_file_set_string(kf, "802-1x", "eap", "tls"); -@@ -468,14 +465,11 @@ write_dot1x_auth_parameters(const NetplanAuthenticationSettings* auth, GKeyFile - static void - write_wifi_auth_parameters(const NetplanAuthenticationSettings* auth, GKeyFile *kf) - { -- if (auth->key_management == NETPLAN_AUTH_KEY_MANAGEMENT_NONE) -- return; -- - switch (auth->key_management) { -+ case NETPLAN_AUTH_KEY_MANAGEMENT_NONE: -+ break; - case NETPLAN_AUTH_KEY_MANAGEMENT_WPA_PSK: - g_key_file_set_string(kf, "wifi-security", "key-mgmt", "wpa-psk"); -- if (auth->password) -- g_key_file_set_string(kf, "wifi-security", "psk", auth->password); - break; - case NETPLAN_AUTH_KEY_MANAGEMENT_WPA_EAP: - g_key_file_set_string(kf, "wifi-security", "key-mgmt", "wpa-eap"); -@@ -486,7 +480,10 @@ write_wifi_auth_parameters(const NetplanAuthenticationSettings* auth, GKeyFile * - default: break; // LCOV_EXCL_LINE - } - -- write_dot1x_auth_parameters(auth, kf); -+ if (auth->eap_method != NETPLAN_AUTH_EAP_NONE) -+ write_dot1x_auth_parameters(auth, kf); -+ else if (auth->password) -+ g_key_file_set_string(kf, "wifi-security", "psk", auth->password); - } - - static void -diff --git a/tests/parser/test_keyfile.py b/tests/parser/test_keyfile.py -index 809cfd8..7822bbe 100644 ---- a/tests/parser/test_keyfile.py -+++ b/tests/parser/test_keyfile.py -@@ -1242,3 +1242,54 @@ method=auto - passthrough: - ipv6.ip6-privacy: "-1" - '''.format(UUID, UUID)}) -+ -+ def test_keyfile_wpa3_sae(self): -+ self.generate_from_keyfile('''[connection] -+id=test2 -+uuid={} -+type=wifi -+interface-name=wlan0 -+ -+[wifi] -+mode=infrastructure -+ssid=ubuntu-wpa2-wpa3-mixed -+ -+[wifi-security] -+key-mgmt=sae -+psk=test1234 -+ -+[ipv4] -+method=auto -+ -+[ipv6] -+addr-gen-mode=stable-privacy -+method=auto -+ -+[proxy] -+'''.format(UUID)) -+ self.assert_netplan({UUID: '''network: -+ version: 2 -+ wifis: -+ NM-{}: -+ renderer: NetworkManager -+ match: -+ name: "wlan0" -+ dhcp4: true -+ dhcp6: true -+ ipv6-address-generation: "stable-privacy" -+ access-points: -+ "ubuntu-wpa2-wpa3-mixed": -+ auth: -+ key-management: "none" -+ password: "test1234" -+ networkmanager: -+ uuid: "ff9d6ebc-226d-4f82-a485-b7ff83b9607f" -+ name: "test2" -+ passthrough: -+ wifi-security.key-mgmt: "sae" -+ ipv6.ip6-privacy: "-1" -+ proxy._: "" -+ networkmanager: -+ uuid: "{}" -+ name: "test2" -+'''.format(UUID, UUID)}) |