[gnutls-help] Asynchronous transport

Nikos Mavrogiannopoulos nmav at gnutls.org
Thu Apr 30 18:53:03 CEST 2015


On Thu, 2015-04-30 at 18:04 +0300, Yury Shvedov wrote:
> Yes... I mean.. partly. Gnutls stopped using pull_timeout as
> synchronous timeout, but I still have problems:
> I used 
>     gnutls_dtls_set_timeouts(m_session, 1000, 60*1000);
> it helped, but from man pages:
>     If the retransmission timeout is zero then the handshake will
> operate in a non-blocking way, i.e., return GNUTLS_E_AGAIN.

I'll have to check it. However, the documentation seems wrong for that.
Does the version with a second of retransmissions work? That should be
the correct choice for blocking or non-blocking.

> If I set retrnasmission timeout to zero, the gnutls_dtls_get_timeout
> returns me zero every time. But according to man pages:
>     This function is useful when DTLS is used in non-blocking mode.
> And gnutls_handshake() doesn't perform any sending after receiving
> server_hello. The problem is then I set retrnasmission timeout to
> zero, it returns me 0 again after 3 timeouts. What I have to do, when
> gnutls_dtls_get_timeout  returns zero?

When gnutls_dtls_get_timeout is zero, you call gnutls_handshake().

> P.S. I have another several question. 
>      1. What I have to do when gnutls pass me to pull function the
>         buffer of smaller size than one, I have the first in queue (in
>         DTLS mode!)? Divide buffer? If not, return the size of
>         requested buffer or size of full buffer?

I'm not sure I understand the question.

>      1. Does gnutls supports the exchange without encryption? What if
>         I want only fragmentation and authentication feature from this
>         library?

You have to enable the null cipher. E.g., use the priority string
"NORMAL:-CIPHER-ALL:+NULL" to both peers.

>      1. The valgrind tells me that the buffer, gnutls_dtls_cookie_send
>         passes to my push function (44 bytes), have an uninitialized
>         values after first 0xa bytes. The buffer allocated on the
>         stack.

Could you reproduce that with gnutls' tests/mini-dtls-hello-verify.c?

regards,
Nikos





More information about the Gnutls-help mailing list