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

ssl_client2 example cannot send request of length 0 #1833

Closed
andresag01 opened this issue Jul 3, 2018 · 2 comments
Closed

ssl_client2 example cannot send request of length 0 #1833

andresag01 opened this issue Jul 3, 2018 · 2 comments

Comments

@andresag01
Copy link
Contributor

andresag01 commented Jul 3, 2018

Description

  • Type: Bug
  • Priority: Minor

Bug

The example at programs/ssl/ssl_client2.c states the following in the help message:

    request_size=%d     default: about 34 (basic request)
                        (minimum: 0, max: 20000 )

However, in practice the application fails to send 0-length application data messages because of the following code:

        for( written = 0, frags = 0; written < len; written += ret, frags++ )
        {
            while( ( ret = mbedtls_ssl_write( &ssl, buf + written,
                                              len - written ) ) <= 0 )
            {

What currently happens is that the message is never actually sent and the ssl_client2 directly moves on to wait for an incoming message from the server to arrive. In fact, the following commands result in a deadlock:

./programs/ssl/ssl_server2 server_port=3344 server_addr=127.0.0.1 force_version=tls1 arc4=1 ca_file=none auth_mode=none crt_file=data_files/server2.crt key_file=data_files/server2.key allow_sha1=1 debug_level=4 etm=1 &
./programs/ssl/ssl_client2 server_port=3344 server_addr=127.0.0.1 force_version=tls1 arc4=1 ca_file=none auth_mode=none allow_sha1=1 debug_level=4 etm=1 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA request_size=0
@ciarmcom
Copy link

ciarmcom commented Jul 5, 2018

ARM Internal Ref: IOTSSL-2390

@RonEld
Copy link
Contributor

RonEld commented Aug 14, 2018

issue was fixed by #1852 which was merged by now, therefore closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants