Reject invalid keys
ClosedPublic

Authored by McPain on Apr 29 2019, 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
Branch
D20900
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 11382
Build 11400: arc lint + arc unit
McPain created this revision.Apr 29 2019, 2:50 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 29 2019, 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.Apr 29 2019, 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.Apr 30 2019, 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.Apr 30 2019, 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.Apr 30 2019, 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.Apr 30 2019, 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 TranscriptApr 30 2019, 10:19 AM
jgrulich added inline comments.Apr 30 2019, 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.Apr 30 2019, 11:42 AM
McPain marked an inline comment as done.
McPain marked an inline comment as done.Apr 30 2019, 11:42 AM
jgrulich accepted this revision.Apr 30 2019, 12:11 PM
This revision is now accepted and ready to land.Apr 30 2019, 12:11 PM
This revision was automatically updated to reflect the committed changes.