Reject invalid keys
ClosedPublic

Authored by McPain on Mon, Apr 29, 2:50 PM.

Details

Summary

PasswordDialog accepted invalid keys, which causes storing them in user's
wallet. In that case, no new secrets will be requested from user:
plasma-nm will silently fail to connect unless key is edited or deleted.

GUI: OK button is disabled when key is invalid

Diff Detail

Repository
R116 Plasma Network Management Applet
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
McPain created this revision.Mon, Apr 29, 2:50 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMon, Apr 29, 2:50 PM
Restricted Application added a reviewer: jgrulich. · View Herald Transcript
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
McPain requested review of this revision.Mon, Apr 29, 2:50 PM

Then the password dialog should use some sort of validation (we already use it for example in the editor and applet) and do not allow to accept a password which is likely not valid.

McPain updated this revision to Diff 57237.Tue, Apr 30, 8:27 AM

Use validation

Use NetworkManagerQt::Utils::wpaPskIsValid() and NetworkManagerQt::Utils:wepKeyIsValid(). It doesn't make sense to have only validation for WPA.

McPain updated this revision to Diff 57239.Tue, Apr 30, 9:02 AM
McPain retitled this revision from Reject short PSK passwords to Reject invalid keys.
McPain edited the summary of this revision. (Show Details)

validate WPA-PSK and WEP keys

jgrulich added inline comments.Tue, Apr 30, 9:14 AM
kded/passworddialog.cpp
93

It shouldn't definitely be hiding buttons, you can make the "OK" button just disabled.

McPain updated this revision to Diff 57245.Tue, Apr 30, 10:19 AM
McPain edited the summary of this revision. (Show Details)
McPain removed 1 blocking reviewer(s): jgrulich.
Restricted Application added 1 blocking reviewer(s): jgrulich. · View Herald TranscriptTue, Apr 30, 10:19 AM
jgrulich added inline comments.Tue, Apr 30, 10:59 AM
kded/passworddialog.cpp
76

Last thing I would change is:

  1. First check whether the connection type is NetworkManager::ConnectionSettings::Wireless
  2. Then attempt to get WirelessSecuritySetting, because it's not necessary to do it for all the other connection types
McPain updated this revision to Diff 57249.Tue, Apr 30, 11:42 AM
McPain marked an inline comment as done.
McPain marked an inline comment as done.Tue, Apr 30, 11:42 AM
jgrulich accepted this revision.Tue, Apr 30, 12:11 PM
This revision is now accepted and ready to land.Tue, Apr 30, 12:11 PM
This revision was automatically updated to reflect the committed changes.