lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] PolarSSL and mbedTLS


From: Dr. Jan Menzel
Subject: Re: [lwip-users] PolarSSL and mbedTLS
Date: Tue, 14 Mar 2017 15:42:35 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

I'd suggest you go back a little in this thread. In one of my previous
e-mails I've tried to point out, that - at least for me - EWOULDBLOCK is
especially captured in the interface layer between mbedtls and lwip and
translated into some other error code. You reported earlier, that
mbedtls reads the socket in a loop to capture all data. It would make
sense to me if this loop stops once EWOULDBLOCK is received. If that
happens on my system the mbedtls read function returns something like
WONT_READ. All this sounds to me as if the interpretation of errno does
not work for you. (BTW: I'm using the same setup, my socket is also
configured to not block and I also use an external select to wait for
new data)

        Jan

On 11.03.2017 21:50, Noam Weissman wrote:
> Hi Simon,
> 
> 
> In my first mail regarding this situation I wrote the errno but hear it
> is again. It is EWOULDBLOCK
> 
> 
> From checking again the net_socket.c file from mbedTLS I see that they
> have two function:
> 
> mbedtls_net_recv
> <https://tls.mbed.org/api/net_8h.html#a03af351ec420bbeb5e91357abcfb3663>
> and mbedtls_net_recv_timeout
> <https://tls.mbed.org/api/net_8h.html#a67810154d2328a80b146155d8cdecfd9>
> 
> 
> The difference is that mbedtls_net_recv_timeout
> <https://tls.mbed.org/api/net_8h.html#a67810154d2328a80b146155d8cdecfd9>
> use select to block for a timeout and then
> 
> call mbedtls_net_recv function.
> 
> 
> I use select in my own code and set the socket for no blocking before
> calling the underlaying
> 
> mbed_ssl_read that down the calling sequence calls the mbed_net_recv
> function ... that
> 
> eventually calls lwip_recvfrom
> 
> 
> I am planing to play with the socket option tomorrow (bloc, not blocking
> etc...) but I wonder
> 
> if the fact that I am setting the socket to none blocking can cause the
> read error I have.
> 
> Do remember that I only call the reading function after select returns
> with 1 .. meaning there is
> 
> data to read.
> 
> 
> BR,
> 
> Noam.
> 
> 
> 
> 
> ------------------------------------------------------------------------
> *From:* lwip-users <address@hidden> on
> behalf of address@hidden <address@hidden>
> *Sent:* Saturday, March 11, 2017 9:34 PM
> *To:* Mailing list for lwIP users
> *Subject:* Re: [lwip-users] PolarSSL and mbedTLS
>  
> Noam Weissman wrote:
>> I am not ignoring the fact that it may be the driver or definitions
>> but I am simply asking
>>
>> for leads...
>>
> 
> That's what I thought I gave in the last mail. OTOH, for getting the
> errno set by recvfrom, you don't have to be an lwIP developer...
> 
> Simon
> 
> 
> _______________________________________________
> lwip-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-users
> 

-- 
peperoni
Dr. Jan Menzel
Wiesenrautenstieg 42
22607 HAMBURG
GERMANY

Tel: +49 / 40 / 600 877 -51
Fax: +49 / 40 / 600 877 -53
http://www.peperoni-light.de
mailto:address@hidden
fingerprint: 0E46 05D8 7EF2 588E FD27 45B5 079A 400E 976D 6FA1

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]