[gnutls-devel] GnuTLS | Support post-handshake reauthentication in the Guile bindings (!1026)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Wed Jun 12 14:57:41 CEST 2019




Tim Rühsen started a new discussion on guile/src/core.c: https://gitlab.com/gnutls/gnutls/merge_requests/1026#note_180530266

>    const fill_port_data_t *args = (fill_port_data_t *) data;
>  
>    c_port = args->c_port;
> -  result = gnutls_record_recv (args->c_session,
> -                               c_port->read_buf, c_port->read_buf_size);
> +
> +  do
> +    result = gnutls_record_recv (args->c_session,
> +				 c_port->read_buf, c_port->read_buf_size);
> +  while (result == GNUTLS_E_AGAIN || result == GNUTLS_E_INTERRUPTED);

This may be very CPU intensive when e.g. when socket readability isn't given. To not waste CPU / energy (and prevent possible DOS attacks), the thread could release CPU in case of GNUTLS_E_AGAIN. The POSIX function is sched_yield(), an alternative is a short sleep (which has it's caveats, e.g. unwantedly limiting bandwidth).

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/1026#note_180530266
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20190612/93dc2d46/attachment-0001.html>


More information about the Gnutls-devel mailing list