[gnutls-devel] GnuTLS | mbuffer_st.type is not preserved when linearized (#1319)
Read-only notification of GnuTLS library development activities
gnutls-devel at lists.gnutls.org
Mon Jan 31 11:38:48 CET 2022
Tatsuhiro Tsujikawa created an issue: https://gitlab.com/gnutls/gnutls/-/issues/1319
## Description of problem:
When received data is too short to contain a message header, they are temporarily buffered in somewhere and when the next segment is arrived, they are gathered into one buffer (linearized). I'm specifically looking at this code:
https://gitlab.com/gnutls/gnutls/-/blob/7f3ea9acc2a2da1d697d423514dfa9c3b56acb15/lib/buffers.c#L1259
The problem is, when the buffers are linearized, mbuffer_st type is cleared. Next time we hit https://gitlab.com/gnutls/gnutls/-/blob/7f3ea9acc2a2da1d697d423514dfa9c3b56acb15/lib/buffers.c#L1217, the check fails, and the endpoint sends fatal alert with unexpected message.
## Version of gnutls used:
3.7.3
## Distributor of gnutls (e.g., Ubuntu, Fedora, RHEL)
## How reproducible:
Steps to Reproduce:
I think feeding data ends in the middle of a message header to gnutls_session_t via gnutls_handshake_write would trigger this bug.
For myself, I discovered it when testing client certificate authentication as QUIC client.
## Actual results:
## Expected results:
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1319
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/20220131/a56d2ddc/attachment.html>
More information about the Gnutls-devel
mailing list