-
Notifications
You must be signed in to change notification settings - Fork 13.3k
WPA2 Enterprise authorization fail #2595
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
Comments
I confirm it with a ESP8266-07. I uploaded the last firmware + patch and I'm using 2.0.0 branch. load 0x4010f000, len 1384, room |
@Gidrix Could you please share your working user_main.c? I tried to code something with the SDK2 but eduroam doesn't work and I can't figure out If I'm putting functions in wrong place. |
HI, The default identifier is [email protected] , but I don't know the password. |
The file libwpa2.a is exactly the same, How can we progress in this issue ? Where should we look ? |
The linking order doesn't matter. @gorghino's code above should work just fine, but it depends on the particular wifi setup. Note that the default identifier "[email protected]" is not used for authentication but for routing. /There is no password./ There is currently no API for changing this, but unless you are trying to connect to a roaming network (such as eduroam) you probably don't need to. Check the radius logs if you can to see why you cannot connect. My experiences in a lab setup are:
However, outside the lab authentication often fails, for various reasons. |
@Gidrix said, that the same code works in NONOS SDK 2.0.0. I assume this was the same AP, correct? My Radius Log unfortunately does not show any useful information for me, besides that my request was Rejected (user/password were marric/marric):
Full log of one authentication attempt: https://gist.github.com/pepe79/fa753973e7d932bfa16ddde6b5b476eb |
Finally I got an IP! The problem is in your code: Instead of using sizeof(ent_username) and sizeof(ent_password) you have to get the string lengthes. So I replaced this code with strlen((char*)ent_username)) and strlen((char*)ent_password)). After this change I could authorize with my WPA2 PEAP AP and got an IP. |
When debugging, it may also help to use the sdk directly and monitor the debug messages on the serial console. Example code: https://github.com/joostd/esp8266-eduroam/blob/master/wpa2e-v20/user/user_main.c |
Hi, that sounds good. |
OK, I found out, that you just modified the sketch above. |
Follow these instructions to use the sdk 2.0.0 in Arduino IDE: #2304 (comment) |
Beware though, that at the moment both EAP-TTLS and EAP-PEAP only work with MS-CHAPv2 user authentication. PAP is not supported yet. So YMMV: it all depends on the configuration of the RADIUS backend. |
I finally managed the download. But "[email protected]" was not the user I put into the variable. What can I do? |
You can try editing the binary libwpa2 to make the outer identity equal to the inner identity. For instance using a tool like |
Thank you for your fast reply. |
Just Google for "binary editor windows" or use this port |
@joostd I'm trying to connect to UPC Wi-Free with esp8266-eduroam/wpa2e-v20/
At one point I got 2 additonal messages (pm open, pm close)
|
See the SDK API reference section 7.2.4:
This means authentication fails. UPC Wi_Free probably uses PEAP by default, which should be supported. Not having access to the RADIUS logs will make this very difficult to debug. I don't know UPC Wi_Free, but I can imagine they make use of the outer identity. You may need to edit libwpa2.a to make the outer identity ("[email protected]") identical to your username. |
@joostd Thanks a lot for your answer. I tried to edit the outer identity as well but same result for now. |
I'm using esp-open-sdk rather than the Arduino base. I added some of the enterprise functions to the basic_example and linked with wpa2, but I'm getting what sounds like an out of memory error "Method private structure allocated failure" even with this minimal program that claims 45KB free. This is with ESP8266_NONOS_SDK_V2.0.0_16_08_10, any ideas? I have the same error if I try a PEM client certificate and private key. Added functions:
output:
Full program here. |
I am having similar problems connecting to WPA2-PEAP networks with MSCHAPv2 authentication. I'm using SDK 2.0 and Gidrix's code from above as modified by pepe79. I am not getting any explicit error messages, just this from the Serial debug output:
I have tried this both with the unmodified version of libwpa2.a, and a version that I attempted to edit to swap the [email protected] outer identity for my own. It doesn't seem to make a difference (If anyone has a good explanation of exactly how to edit the file without corrupting it -- e.g. should I pad the email address with 0x00s before or after the data? -- that would be a big help). I have tried this on two different PEAP networks (eduroam and my institution's own network) and neither one works. Does anyone have any suggestions? I feel like this shouldn't be as hard as it is... |
It seems like development of the esp8266 SDK has stalled. Similar problems with esp32 have been resolved with improvements of its version of libwpa2, where you call the library to set the outer identity. For the esp8266, it is still needed to binary edit the file Change your working directory to where your version of libwpa2.a is located, for instance
The v2.0.0 version of the SDK will contain the hardcoded string
Make a backup of this file
Use a binary editor like bbe (osx brew users can install with
Verify that the only bytes that were updated are in the outer identity string
|
@alviso Did you manage to get it working? |
No. I did the same but no luck.
…On May 19, 2017 12:59, "Robert Klauco" ***@***.***> wrote:
@alviso <https://github.com/alviso> Did you manage to get it working?
I also try to connect to UPC Wi-Free, I edited the libwpa2.a binary file,
but I still fail to connect...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2595 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALQrahCR2tHQROhaFxcyKCLkqeO4YRx1ks5r7XYZgaJpZM4KTlgZ>
.
|
For me it acts a bit strange. |
Does anybody have an idea how to proceed here? I used the sdk 2.1.0 with arduino ide and so far I have no luck. The problem here is I do not control the radius server, so I can't debug the login messages. But it would be nice to get some help on how to debug the behavior and get some more info from esp if possible. |
I tried following the instructions in the link to connect to a WPA2-Enterprise network with PEAP and MSCHAPV2 for authorization. I am unable to get an IP. I do not have access to my server, can someone point out how to print some helpful debugmessages in the serial output. |
I believe that PR #3215 introduces an api to change the outer identity. Please test with that and report back here. |
Closing in favor of #3842 . |
@marcelkottmann, can you share your code snippet. I have connected esp8266 to wpa2 at my university but after some random time (around 10-15 mins, sometimes earlier and sometimes 30 mins also), the esp crashes and restarts itself. |
Basic Infos
Hardware
Hardware: ESP-12
Core Version: using git branch update_sdk_2.0.0
Description
I have AP with configured PEAP WPA2 Enterprise, it only asks log/pass, certificates not required. Authorization work properly, I can connect with my android phone.
When esp tries to connect to AP, in AP log esp status is only "associated", which means esp actually connected to AP. BUT esp never get an ip (status will be "authorized"). Basically wpa2 enterprise part of code dont do anything.
Same code in NONOS SDK 2.0.0 works fine, but I already have pretty big project on arduino, so it would be hard to transfer to sdk.
Settings in IDE
Module: Generic ESP8266 Module
Flash Size: 4MB
CPU Frequency: 80Mhz
Flash Mode: qio
Flash Frequency: 40Mhz
Upload Using: SERIAL
Reset Method: ck
Sketch
The text was updated successfully, but these errors were encountered: