[gnutls-devel] GnuTLS | serv: fix detection of early data reception (!1941)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Mon Mar 17 01:08:30 CET 2025



Daiki Ueno created a merge request: https://gitlab.com/gnutls/gnutls/-/merge_requests/1941

Project:Branches: dueno/gnutls:wip/dueno/nst-data to gnutls/gnutls:master
Author:   Daiki Ueno




<!-- Add a description of the new feature/bug fix. Reference any relevant bugs. -->

* tests: add basic tests for 0-RTT with gnutls-serv and gnutls-cli

* cli: send early data only after session data is set

Now that max_early_data_size is recorded as part of the stored
resumption data, this needs to be read before attempting to send early
data.

* handshake: preserve max_early_data_size across resumption

Previously, max_early_data_size negotiated as part of NewSessionTicket
is reset after a resumption, leading to an error in sending early data
since we changed the default max_early_data_size to 0 in commit
9a7ce5a74cbef069394f677c0c79af2c876546db. This records the value along
with the stored session ticket data.

* serv: fix detection of early data reception

Upon success, gnutls_record_recv_early_data returns the amount of data
received, so the application should treat positive numbers as an
indication of early data reception.

Fixes: #1667 

## Checklist
 * [x] Commits have `Signed-off-by:` with name/author being identical to the commit author
 * [ ] Code modified for feature
 * [x] Test suite updated with functionality tests
 * [ ] Test suite updated with negative tests
 * [ ] Documentation updated / NEWS entry present (for non-trivial changes)
 * [ ] CI timeout is 2h or higher (see Settings/CICD/General pipelines/Timeout)

## Reviewer's checklist:
 * [ ] Any issues marked for closing are addressed
 * [ ] There is a test suite reasonably covering new functionality or modifications
 * [ ] Function naming, parameters, return values, types, etc., are consistent and according to `CONTRIBUTION.md`
 * [ ] This feature/change has adequate documentation added
 * [ ] No obvious mistakes in the code

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1941
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/20250317/06680549/attachment.html>


More information about the Gnutls-devel mailing list