[gnutls-devel] GnuTLS | ktls: Do not return GNUTLS_E_INTERRUPTED/AGAIN from short writes (!1723)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Mon Apr 24 18:22:13 CEST 2023

Alexander Sosedkin commented: https://gitlab.com/gnutls/gnutls/-/merge_requests/1723#note_1364872945

I see the following pattern in our examples (copy-pasted from doc/examples/ex-client-anon.c):
#define LOOP_CHECK(rval, cmd) \
        do { \
                rval = cmd; \
        } while(rval == GNUTLS_E_AGAIN || rval == GNUTLS_E_INTERRUPTED); \
        assert(rval >= 0)
LOOP_CHECK(ret, gnutls_record_send(session, MSG, strlen(MSG)));

Do I understand correctly that

1. as short writes used to return GNUTLS_E_INTERRUPTED/AGAIN even if something is written, our examples used to be incorrect when KTLS is used because they over-sent on interruption?
2. as short writes started suppressing GNUTLS_E_INTERRUPTED/AGAIN and reporting a partial write, our examples became uniformly incorrect with and without KTLS, because now they're going to under-send on interruption?

Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1723#note_1364872945
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/20230424/3cf70552/attachment.html>

More information about the Gnutls-devel mailing list