[gnutls-devel] GnuTLS | Wipe session ticket keys before releasing the session structure (!1289)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Sun Jun 14 15:53:28 CEST 2020

Airtower created a merge request: https://gitlab.com/gnutls/gnutls/-/merge_requests/1289

Project:Branches: airtower-luna/gnutls:tmp-clear-session-ticket-keys to gnutls/gnutls:master
Author:    Airtower

When calling `gnutls_session_ticket_enable_server()` the key is copied into `session->key.initial_stek`, and then derived keys created from that as needed. The copy is good for applications that implement their own key rotation (because with just a pointer they'd have to keep the old key around). However the copied and derived keys are not safely wiped before the session structure is released, contrary to what the documentation for `gnutls_session_ticket_enable_server()` recommends. This merge request fixes that.

I see one alternative approach here, and that would be to simply wipe the _whole_ `session->key` structure after releasing all contained data. Let me know if that's preferred, but I think the specific `gnutls_memset()` calls (like the existing one for `session->key.proto`) are easier to understand.

## Checklist
 * [x] Commits have `Signed-off-by:` with name/author being identical to the commit author
 * [x] Code modified for feature
 * [ ] Test suite updated with functionality tests
 * [ ] Test suite updated with negative tests
 * [ ] Documentation updated / NEWS entry present (for non-trivial changes)
 * [x] 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/1289
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/20200614/1b799c2e/attachment.html>

More information about the Gnutls-devel mailing list