gnutls-devel
[Top][All Lists]
Advanced

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

Re: What happens if client is sending data when rehandshake is issued on


From: Nikos Mavrogiannopoulos
Subject: Re: What happens if client is sending data when rehandshake is issued on the server
Date: Mon, 15 Sep 2008 10:37:23 +0300

Hello Sam,
 The behavior I remember is:
The server once calls the rehandshake() will send a handshake request
to the client, nothing more. It is up to the client to ignore this
message (continue sending data), or start a rehandshake (call
gnutls_handshake). Any message received before the actual rehandshake
(gnutls_handshake) is being cached.

regards,
Nikos

On Sat, Sep 13, 2008 at 10:45 PM, Sam Varshavchik <address@hidden> wrote:
> I'm trying to understand the proper usage of gnutls_rehandshake(). I have
> only a vague understanding of the technical details of TLS. The man page for
> gnutls_rehandshake says:
>
> # If this function succeeds (returns 0), you must call the
> # gnutls_handshake() function in order to negotiate the new parameters.
> #
> # If the client does not wish to renegotiate parameters he will should with
> # an alert message, thus the return code will be #
> GNUTLS_E_WARNING_ALERT_RECEIVED and the alert will be #
> GNUTLS_A_NO_RENEGOTIATION. A client may also choose to ignore this
> # message.
>
> So, as I understand this, gnutls_rehandshake() sends a message to the client
> side, and waits for the client to respond.
>
> The man page does not address what happens when the underlying transport is
> non-blocking. I presume what's going to happen is that I'll get a
> GNUTLS_E_INTERRUPTED or GNUTLS_E_AGAIN, I must call
> gnutls_record_get_direction(), wait for the appropriate I/O to be ready,
> then call gnutls_rehandshake() again.
>
> What's not clear to me is what happens when the server calls
> gnutls_rehandshake() while the client is in a middle of sending a record at
> the same time, so instead of receiving the response from the rehandshake
> request, the server receives a data record, that was sent by the client
> before it got the handshake request. What happens to that record, does it
> get discarded, or does gnutls_rehandshake() return an error code that tells
> me that I need to call gnutls_record_recv() to take it
> (GNUTLS_E_UNEXPECTED_PACKET?), then call gnutls_rehandshake() again.
>
> Can this be clarified in the man page?
>
>
> _______________________________________________
> Gnutls-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/gnutls-devel
>
>




reply via email to

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