Skip to content

Wipe session ticket keys before releasing the session structure

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

  • Commits have Signed-off-by: with name/author being identical to the commit author
  • 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)
  • 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
Edited by Daiki Ueno

Merge request reports