~ken-vandine/ubuntu-system-settings/changelogs_in_update

« back to all changes in this revision

Viewing changes to plugins/wifi/OtherNetwork.qml

  • Committer: CI Train Bot
  • Author(s): jonas-drange
  • Date: 2015-09-18 14:20:14 UTC
  • mfrom: (1519.3.3 lp1490417)
  • Revision ID: ci-train-bot@canonical.com-20150918142014-775ngpcny31zfzj6
[wifi/wpa2ep] allow passwords of length 1 for wpa enterprise authentication schemes. Fixes: #1490417
Approved by: Ken VanDine

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
            if (networkname.length === 0) {
39
39
                return false;
40
40
            }
41
 
            if (securityList.selectedIndex === 0) {
42
 
                return true
43
 
            }
44
 
            if (securityList.selectedIndex === 3) {
45
 
                // WEP
46
 
                return password.length === 5  ||
47
 
                       password.length === 10 ||
48
 
                       password.length === 13 ||
49
 
                       password.length === 26;
50
 
            }
51
 
            //WPA
52
 
            return password.length >= 8
 
41
            switch (securityList.selectedIndex) {
 
42
                case 1: // WPA
 
43
                    return password.length >= 8 || password.length >= 64;
 
44
                case 2: // WPA Enterprise
 
45
                case 4: // Dynamic WEP
 
46
                case 5: // LEAP
 
47
                    return password.length > 0 && username.length > 0;
 
48
                case 3: // WEP
 
49
                    return password.length === 5  ||
 
50
                           password.length === 10 ||
 
51
                           password.length === 13 ||
 
52
                           password.length === 26;
 
53
                case 0: // None
 
54
                default:
 
55
                    return true;
 
56
            }
53
57
        }
54
58
 
55
59
        function filePicker (type) {