[gnutls-devel] GnuTLS | psk: Add basic support for RFC 9258 external PSK importer interface (!1741)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Wed May 3 04:33:37 CEST 2023

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

Project:Branches: dueno/gnutls:wip/dueno/external-psk-importer to gnutls/gnutls:master
Author:   Daiki Ueno

This adds a minimal, callback-based API to import external PSK,
following RFC 9258.  The client is supposed to set a callback to
retrieve PSK with `gnutls_psk_set_client_credentials_function3`, with
the following signature, which returns optional context and flags if
requested, along with the key:

  typedef int gnutls_psk_client_credentials_function3(
          gnutls_session_t, gnutls_datum_t *username, gnutls_datum_t *key,
          gnutls_datum_t *context, gnutls_psk_key_flags *flags);

On the other hand, the server sets a callback to look up PSK based on
the serialized ImportedIdentity:

  typedef int gnutls_psk_server_credentials_function3(
          gnutls_session_t, const gnutls_datum_t *username, gnutls_datum_t *key,
          gnutls_psk_key_flags *flags);

The server may check the serialized identity is actually known to the
server, using a helper function `gnutls_psk_format_imported_identity`
that serializes external identity.

Fixes: #1355

## Checklist
 * [x] 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

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

More information about the Gnutls-devel mailing list