PEAP-MSCHAPV2 -- How to connect?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
NiCr_4063401
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted

Hi,

I'm having issues connecting to a basic PEAP-MSCHAPv2 configuration. My Android phone can connect just fine using PEAP and MSCHAPv2 as the inner type.

However, with both the command console demo and writing raw code in WICED, I am unable to get anything except for return code 1007. I think I have tried every single combination of parameters in the wiced command console demo.

I am not seeing any connection attempts at all on my FreeRadius server. I feel like I must just be passing in some incorrect parameters:

Note: I use find_ap to scan for my desired access point, with the results being stored in ap_info.

memset(&conn_info, 0x0, sizeof(conn_info));

conn_info.interface = WWD_STA_INTERFACE;

conn_info.tls_identity = &identity;

conn_info.tls_session = &tls_session;

conn_info.context = &context;

conn_info.trusted_ca_certificates = NULL;

conn_info.root_ca_cert_length = 0;

conn_info.eap_type = EAP_TYPE_PEAP;

conn_info.inner_eap_type = EAP_TYPE_MSCHAPV2;

conn_info.auth_type = ap_info.security;

conn_info.eap_identity = eap_identity;

conn_info.user_name = "MY_USERNAME";

conn_info.password = "MY_PASSWORD";

wiced_log_printf("# Root CA Certs: %d\r\n", conn_info.root_ca_cert_length);

wiced_log_printf("EAP Type: %d\r\n", conn_info.eap_type);

wiced_log_printf("Inner EAP Type: %d\r\n", conn_info.inner_eap_type);

wiced_log_printf("Auth Type: %d\r\n", conn_info.auth_type);

wiced_log_printf("Username: %s\r\n", conn_info.user_name);

wiced_log_printf("Password: %s\r\n", conn_info.password);

if (fs_res == WICED_SUCCESS)

{

    wiced_log_printf("Initializing BESL supplicant\r\n");

    res = besl_supplicant_init(&supplicant_workspace, &conn_info);

    if (res == BESL_SUCCESS)

    {

        wiced_log_printf("Starting BESL supplicant\r\n");

        if (besl_supplicant_start(&supplicant_workspace) == BESL_SUCCESS)

        {

            wiced_log_printf("Initiating WiFi Join\r\n");

            wiced_result_t wifi_join_res = wwd_wifi_join_specific(&ap_info, NULL, 0, NULL, WWD_STA_INTERFACE);

            wiced_log_printf("WiFi Join Result: %d\r\n", wifi_join_res);

            if (wifi_join_res == WICED_SUCCESS)

            {

                wiced_log_printf("Retrieving TLS session information\r\n");

                int ret;

                if ((ret = mbedtls_ssl_get_session(

                        &supplicant_workspace.tls_context->context,

                        &tls_session)) != 0)

                {

                    wiced_log_printf(

                            " Failed to retrieve the session information %d \r\n",

                            ret);

                }

                else

                {

                    wiced_log_printf(

                            " Successfully retrieved the session information %d \r\n",

                            ret);

                }

            }

            else

            {

                res = besl_supplicant_stop(&supplicant_workspace);

                if (res != BESL_SUCCESS)

                {

                    wiced_log_printf(

                            "supplicant Stop failed with error = [%d]\r\n",

                            res);

                }

                wiced_log_printf("De-init supplicant\r\n");

                besl_supplicant_deinit(&supplicant_workspace);

                res = wifi_join_res;

            }

        }

    }

    else

    {

        wiced_log_printf("Unable to initialize supplicant. Error = [%d]\r\n",

                res);

    }

}

else

{

    res = WICED_ERROR;

}

0 Likes
8 Replies