Skip to content
This repository has been archived by the owner on Apr 8, 2019. It is now read-only.

IOS app breaks when WIFI password is shorter than 8 characters #16

Open
4 of 7 tasks
arsenal942 opened this issue Jul 19, 2018 · 6 comments
Open
4 of 7 tasks

IOS app breaks when WIFI password is shorter than 8 characters #16

arsenal942 opened this issue Jul 19, 2018 · 6 comments
Assignees
Labels

Comments

@arsenal942
Copy link
Owner

Prerequisites

Check all boxes if you have done the following:

Issue type

Select all that apply

  • Bug
  • Enhancement
  • Task
  • Question
  • Other

Description

First of all: Great plugin! Very handy and useful!

The IOS call to connect() breaks the IOS app whenever the user inserts a WIFI password shorter than 8 characters.

It's well know that the WPA/WPA2 password length should be at least 8 character long and the app developer can easily prohibit the user for attempting such a connection.

But it would be nice to have a fail callback so the app won't break in case the developer forgets to verify the password length.

Steps to Reproduce

On an IOS device try to connect on an WIFI network with a password shorter than 8 characters.

Expected behavior: [What you expect to happen]
Connect to a WIFI network.

Actual behavior: [What actually happens]
2018-04-23 17:18:31.209909-0300 EasyKey[3954:1944346] [] -[NEHotspotConfiguration valid:726 NEHotspotConfiguration invalid WPA/WPA2 passphrase length.
(lldb)

Reproduces how often: [What percentage of the time does it reproduce?]

Everytime.

Versions

Test were made on IONIC built app running on an iPhone (IOS 11).

@arsenal942 arsenal942 added the bug label Jul 19, 2018
@arsenal942 arsenal942 self-assigned this Jul 19, 2018
arsenal942 pushed a commit that referenced this issue Jul 19, 2018
#16
- Reject any passwords of less than 8 in length
@gailu
Copy link

gailu commented Jul 25, 2018

We are trying to connect with open network and passed empty string in the password as API does not have option to specify type of network (WPA/WEP/Open). It works in Android but fails in ios with same error [NEHotspotConfiguration valid:726 NEHotspotConfiguration invalid WPA/WPA2 passphrase length.

I tried to change following code

NEHotspotConfiguration *configuration = [[NEHotspotConfiguration alloc] initWithSSID:ssidString passphrase:passwordString isWEP:(BOOL)false];
to
NEHotspotConfiguration *configuration = [[NEHotspotConfiguration alloc] initWithSSID:ssidString ];
in cordovaNetworkManager.m hoping that it will fix the issue as other parameters are not required for open network. But its not taking effect. Probably its not rebuild properly. How to rebuild plugin so that code changes cordovaNetworkManager.m are reflected in the app?

@arsenal942
Copy link
Owner Author

WPA standards specifies that you have to have a password length of >= 8. I was in the middle of implementing a fix for this and will finish it today. I was a bit naive in how I did in in 2.5.3 so I will address it by end of day.

For the latest stable release, install @2.5.0

@gailu
Copy link

gailu commented Jul 26, 2018

I understand that WPA standard specifies to have password length of >= 8 but here the problem is connecting with Open network not the WPA network. Apple has two different APIs to connect WPA and Open Network.

Actually plugin should check the length of password and if length is zero then it should call open network API otherwise WPA API. However problem is that calling Open Network API i.e. - (instancetype)initWithSSID:(NSString *)SSID; does not solve the problem and apple still checks the password length so I suspect a bug in apple API implementation of Open Network unless I am missing something obvious.

@gailu
Copy link

gailu commented Jul 27, 2018

Can anybody confirm if it is bug in ios API ((instancetype)initWithSSID:(NSString *)SSID) for open network?

@tripflex
Copy link

@gailu try the latest release of WifiWizard2 I added support for open networks (just can't test myself without an ios device):
https://github.com/tripflex/WifiWizard2

@arsenal942
Copy link
Owner Author

Sorry guys I've been away for a bit. I'll be looking to add this shortly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants