From 4fe788cc172e6c06f40a42ba516a60f21369018c Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Tue, 2 May 2023 08:41:08 +0900 Subject: psk: Add basic support for RFC 9258 external PSK importer interface This adds a minimal, callback-based API to import external PSK, following RFC 9258. The client and the server importing external PSK are supposed to set a callback to retrieve PSK, which returns flags that may indicate the PSK is imported, along with the key: typedef int gnutls_psk_client_credentials_function3( gnutls_session_t session, gnutls_datum_t *username, gnutls_datum_t *key, gnutls_psk_key_flags *flags); typedef int gnutls_psk_server_credentials_function3( gnutls_session_t session, const gnutls_datum_t *username, gnutls_datum_t *key, gnutls_psk_key_flags *flags); Those callbacks are responsible to call gnutls_psk_format_imported_identity() for external PSKs to build a serialized PSK identity, and set GNUTLS_PSK_KEY_EXT in flags if the identity is an imported one. Signed-off-by: Daiki Ueno --- lib/ext/pre_shared_key.h | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'lib/ext/pre_shared_key.h') diff --git a/lib/ext/pre_shared_key.h b/lib/ext/pre_shared_key.h index 496d275a7f..f6a088c614 100644 --- a/lib/ext/pre_shared_key.h +++ b/lib/ext/pre_shared_key.h @@ -9,17 +9,6 @@ extern const hello_ext_entry_st ext_mod_pre_shared_key; -inline static unsigned -_gnutls_have_psk_credentials(const gnutls_psk_client_credentials_t cred, - gnutls_session_t session) -{ - if ((cred->get_function || cred->username.data) && - session->internals.priorities->have_psk) - return 1; - else - return 0; -} - int _gnutls_generate_early_secrets_for_psk(gnutls_session_t session); #endif /* GNUTLS_LIB_EXT_PRE_SHARED_KEY_H */ -- cgit v1.2.1