wiced_generic_start_tls_with_ciphers() freeze and reboot

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

cross mob
Anonymous
Not applicable

Hello,

When I'm trying to connect to the Azure IOT hub server with AMQP functions, the program freezes and then restarts (not all the time) when it's calling the following function:

( After reboot, the program no longer has this problem. And it happens again on a new connection on the same device ).

WICED SKD : 5.1.0

wiced_result_t wiced_generic_start_tls_with_ciphers( wiced_tls_context_t* tls_context, void* referee, wiced_tls_endpoint_type_t type, wiced_tls_certificate_verification_t verification, const cipher_suite_t* cipher_list[], tls_transport_protocol_t transport_protocol )

{

}

and more precisely in the loop below :

    do

    {

        uint64_t curr_time;

        if (type == WICED_TLS_AS_SERVER)

        {

result = ssl_handshake_server_async( &tls_context->context );

if ( result != TLS_SUCCESS )

{

WPRINT_SECURITY_INFO(( "Error with TLS server handshake\n" ));

goto exit_with_inited_context;

}

        }

        else

        {

result = ssl_handshake_client_async( &tls_context->context );

if ( result != TLS_SUCCESS )

{

WPRINT_SECURITY_INFO(( "Error with TLS client handshake %u\n", (unsigned int)result ));

goto exit_with_inited_context;

}

        }

        /* break out if stuck */

        curr_time = tls_host_get_time_ms();

        if ( curr_time - start_time > MAX_HANDSHAKE_WAIT )

        {

WPRINT_SECURITY_INFO(( "Timeout in SSL handshake\n" ));

result = TLS_HANDSHAKE_TIMEOUT;

goto exit_with_inited_context;

        }

        /* if no state change then wait on client */

        if ( prev_state == tls_context->context.state )

        {

host_rtos_delay_milliseconds( 10 );

        }

        else /* otherwise process next state with no delay */

        {

prev_state = tls_context->context.state;

        }

    } while ( tls_context->context.state != SSL_HANDSHAKE_OVER );

    return WICED_SUCCESS;

I have an impression that during the different tests of the enumerator below (TLS STATES), the test blocks on number 3:

typedef enum

{

    SSL_HELLO_REQUEST,

    SSL_CLIENT_HELLO,

    SSL_SERVER_HELLO,

    SSL_SERVER_CERTIFICATE,

    SSL_SERVER_KEY_EXCHANGE,

    SSL_CERTIFICATE_REQUEST,

    SSL_SERVER_HELLO_DONE,

    SSL_CLIENT_CERTIFICATE,

    SSL_CLIENT_KEY_EXCHANGE,

    SSL_CERTIFICATE_VERIFY,

    SSL_CLIENT_CHANGE_CIPHER_SPEC,

    SSL_CLIENT_FINISHED,

    SSL_SERVER_CHANGE_CIPHER_SPEC,

    SSL_SERVER_FINISHED,

    SSL_FLUSH_BUFFERS,

    SSL_HANDSHAKE_OVER

} tls_states_t;

Can you explain the reason for this and help me to solve the problem ?

1 Solution
PriyaM_16
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

Hi,

I have tried to connect to Azure IOT hub with AMQP and I was able to connect and maintain the connection without any errors in SDK 6.0. We would recommend you to switch to 6.0 because as already mentioned, the BESL library is now migrated to mbedTLS.

View solution in original post

5 Replies
AxLi_1746341
Level 7
Level 7
10 comments on KBA 5 comments on KBA First comment on KBA

Which SDK version are you testing?

0 Likes
Anonymous
Not applicable

WICED SKD : 5.1.0

0 Likes

The latest SDK switches to use mbedTLS now.

I'm not sure if cypress will provide bug fix for older SDKs.

mifogrsr

0 Likes
PriyaM_16
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

Hi,

I have tried to connect to Azure IOT hub with AMQP and I was able to connect and maintain the connection without any errors in SDK 6.0. We would recommend you to switch to 6.0 because as already mentioned, the BESL library is now migrated to mbedTLS.

Anonymous
Not applicable

I do not have the same behaviour with 6.1, thank you !

0 Likes