From eb93b5f86380b96928e2cc4eb4eba8c99e1ca34f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Wed, 3 May 2023 19:49:05 +0000 Subject: [PATCH] sculpt_manager: check passphrase before ENTER Prevent setting an invalid configuration by guarding against are premature generation. Issue #4858. --- repos/gems/src/app/sculpt_manager/network.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/repos/gems/src/app/sculpt_manager/network.cc b/repos/gems/src/app/sculpt_manager/network.cc index 90c0bb7b61..3e2c8e3f90 100644 --- a/repos/gems/src/app/sculpt_manager/network.cc +++ b/repos/gems/src/app/sculpt_manager/network.cc @@ -38,8 +38,10 @@ void Sculpt::Network::handle_key_press(Codepoint code) enum { BACKSPACE = 8, ENTER = 10 }; if (code.value == BACKSPACE) wpa_passphrase.remove_last_character(); - else if (code.value == ENTER) - wifi_connect(dialog.selected_ap()); + else if (code.value == ENTER) { + if (wpa_passphrase.suitable_for_connect()) + wifi_connect(dialog.selected_ap()); + } else if (code.valid()) wpa_passphrase.append_character(code);