> On Aug. 3, 2011, 2:27 p.m., Ilia Kats wrote: > > libs/ui/security/wepwidget.cpp, line 105 > > <http://git.reviewboard.kde.org/r/102157/diff/1/?file=30472#file30472line105> > > > > That's not quite correct. A key can be either hex or ascii, while a > > passphrase can be anything, the actual key will be derived from the MD5-sum > > of the passphrase. So the original regex/validator was correct in that > > part. However, the regexes here specify ranges in length ({5,13} means the > > thing before that can be repeated from 5 to 13 times), while a hex key can > > be either 10 or 26, an ascii key either 5 or 13 characters. I think > > something like (asciiregex{5}|asciiregex{13}|hexregex{10}|hexregex{26}) > > will do what we want here. Also, the commented out old code should probably > > be removed completely. > > Lamarque Vieira Souza wrote: > I think NM includes a similar check in its code. Can you check if you > implementation is compatible with NM's? > > Lamarque Vieira Souza wrote: > I have check and your tests are equals to NM's, so you just need to fix > the 'valid(bool)' signal redefinition and this patch is good to go.
One more thing: the passphrase can consist of arbitrary characters, not just ascii. However, currently, the validator is set in the constructor, if it returns Invalid, characters like ö, ä, ü or % are not even accepted by the lineEdit. I think we need to move the call to setValidator into keyTypeChanged() and call it with 0 if passphrase is selected to remove the validator from the lineEdit. - Ilia ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/102157/#review5347 ----------------------------------------------------------- On Aug. 7, 2011, 4:05 p.m., Rajeesh K Nambiar wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://git.reviewboard.kde.org/r/102157/ > ----------------------------------------------------------- > > (Updated Aug. 7, 2011, 4:05 p.m.) > > > Review request for Network Management. > > > Summary > ------- > > WEP key validation (should have only 5 to 13 ASCII characters for Ascii key; > and 10 to 26 Hex characters for Hex key) wasn't working. Most of the bits > were present, here's a gross hack to make it really work. Only implemented > and tested WEP validation, but can be extended for other security types as > well. > > I'm not sure this could be the best/easiest implementation, spent a night > figuring out the right signal/slots :-). If this hack could be refined, > please let me know! > > > Diffs > ----- > > libs/ui/security/eapmethodstack.h 552f5c9 > libs/ui/security/leapauthwidget.h 3c01e1d > libs/ui/security/nullsecuritywidget.h dc84fb5 > libs/ui/security/securityleap.h 402a7af > libs/ui/security/securitywidget.h c536cf6 > libs/ui/security/wepauthwidget.h 6ff721b > libs/ui/security/wepwidget.h e78338c > libs/ui/security/wepwidget.cpp f024555 > libs/ui/security/wirelesssecuritysettingwidget.cpp fbc2c34 > libs/ui/security/wpaauthwidget.h 91e7495 > libs/ui/security/wpapskwidget.h 7077836 > > Diff: http://git.reviewboard.kde.org/r/102157/diff > > > Testing > ------- > > Tested with WEP Hex and ASCII key validations. "OK" button of connection > editor widget is now properly enabled/disabled upon changing key. > > > Thanks, > > Rajeesh > >
_______________________________________________ kde-networkmanager mailing list [email protected] https://mail.kde.org/mailman/listinfo/kde-networkmanager
