Hi all,
Does anybody have an example code (Native WiFI) or xml profile for connecting to EAP networks?
Our product uses Native WiFi for connecting to Wireless Networks and so far have been limited to supporting WPAPSK, WPA2PSK and Open networks. With these network types, we have been successfully connecting to the Access Points, but now we wish to add support for EAP-Authentication methods.
For testing I have set up a freeRadius (freeRadius.net v1.1.7-r0.0.2) and to keep things simple, I am running it almost “as-is”. The only modification I did was to set the “shared-secret” in the clients.conf file. For authentication, we have been using the example credentials of freeRadius.net:
username: testuser
password: testpw
I followed the steps in
to manually create a Wireless profile on my PC, then used WlanGetProfile to extract the XML-Profile. This XML-Profile works when I use it on the Win32 port of our application but not on the “Toradex_CE7-target” build.
On the iMX6-build, the return value of WlanSetProfile is ERROR_BAD_PROFILE(0x4b6) while the pdwReasonCode=0x057. Unfortunately, WlanReasonCodeToString could not provide the text-equivalent for this reason code but in general 0x057 means ERROR_INVALID_PARAMETER.
I have tried modifying the XML-Profile, removing elements one-by-one but I keep getting the same result from WlanSetProfile everytime.
Below is the original XML profile I used.
<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
<name>FireFox</name>
<SSIDConfig>
<SSID>
<hex>46697265466F78</hex>
<name>FireFox</name>
</SSID>
<nonBroadcast>true</nonBroadcast>
</SSIDConfig>
<connectionType>ESS</connectionType>
<connectionMode>manual</connectionMode>
<autoSwitch>false</autoSwitch>
<MSM>
<security>
<authEncryption>
<authentication>WPA2</authentication>
<encryption>AES</encryption>
<useOneX>true</useOneX>
</authEncryption>
<OneX xmlns="http://www.microsoft.com/networking/OneX/v1">
<cacheUserData>true</cacheUserData>
<authMode>user</authMode>
<EAPConfig>
<EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
<EapMethod>
<Type xmlns="http://www.microsoft.com/provisioning/EapCommon">25</Type>
<VendorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorId>
<VendorType xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorType>
<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</AuthorId>
</EapMethod>
<Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
<Eap xmlns="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1">
<Type>25</Type>
<EapType xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV1">
<ServerValidation>
<DisableUserPromptForServerValidation>false</DisableUserPromptForServerValidation>
<ServerNames></ServerNames>
</ServerValidation>
<FastReconnect>true</FastReconnect>
<InnerEapOptional>false</InnerEapOptional>
<Eap xmlns="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1">
<Type>26</Type>
<EapType xmlns="http://www.microsoft.com/provisioning/MsChapV2ConnectionPropertiesV1">
<UseWinLogonCredentials>false</UseWinLogonCredentials>
</EapType>
</Eap>
<EnableQuarantineChecks>false</EnableQuarantineChecks>
<RequireCryptoBinding>false</RequireCryptoBinding>
<PeapExtensions>
<PerformServerValidation xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV2">false</PerformServerValidation>
<AcceptServerName xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV2">false</AcceptServerName>
</PeapExtensions>
</EapType>
</Eap>
</Config>
</EapHostConfig>
</EAPConfig>
</OneX>
</security>
</MSM>
</WLANProfile>
Regards