Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPA don't accept special characters #16

Open
MMonrad opened this issue Sep 18, 2015 · 2 comments
Open

WPA don't accept special characters #16

MMonrad opened this issue Sep 18, 2015 · 2 comments
Labels
Milestone

Comments

@MMonrad
Copy link

MMonrad commented Sep 18, 2015

When I'm trying to connect to a network with a key like this "1234567890&" I get an error 1206. If the key is 1234567890 on the same network it works just fine. How can I solve this problem?

@robinwassen
Copy link
Contributor

Error 1206 is Bad network profile.

I would guess that the password isn't encoded properly for the profile XML, so it is breaks the profile when it contains some special characters.

The characters that need to be escaped in XML can be found here: http://stackoverflow.com/questions/1091945/what-characters-do-i-need-to-escape-in-xml-documents

EapUserFactory contains a "FixPass" function that is partially implemented (only 3 of 5 characters): https://github.com/DigiExam/simplewifi/blob/master/SimpleWifi/EapUserFactory.cs

The ProfileFactory that is used when generating the profile in your case does encode the characters for the password in the same way: https://github.com/DigiExam/simplewifi/blob/master/SimpleWifi/ProfileFactory.cs

Now when I look at it all strings that are being embedded into the Profile XML:s should be encoded for XML, which they currently aren't.

Dirty fix is:

  • Add a function to the ProfileFactory that encodes the special characters in the password for XML (note that this function should not base64 encode as the one in EapUserFactory)

Proper fix:

  • Remove FixPass from EapUserFactory
  • Add a EncodeForXML method that can be reused
  • Run the EncodeForXML method on all strings before they are inserted into the XML

@robinwassen
Copy link
Contributor

A pull request would be nice if you decide to implement the proper fix.

@robinwassen robinwassen added this to the 1.1.0.0 milestone Sep 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants