Remove '_ext' suffix from SSL key exporter API

Signed-off-by: Hanno Becker <hanno.becker@arm.com>
This commit is contained in:
Hanno Becker 2021-05-24 10:58:31 +01:00 committed by Dave Rodgman
parent 78ba2af7c2
commit 2d6e6f8fec
5 changed files with 18 additions and 18 deletions
include/mbedtls
library
programs/ssl

@ -1556,7 +1556,7 @@
* (see Section 5 of RFC 5764), are not handled by this feature. * (see Section 5 of RFC 5764), are not handled by this feature.
* Instead, after successful completion of a handshake negotiating * Instead, after successful completion of a handshake negotiating
* the use of DTLS-SRTP, the extended key exporter API * the use of DTLS-SRTP, the extended key exporter API
* mbedtls_ssl_conf_export_keys_ext_cb() should be used to implement * mbedtls_ssl_conf_export_keys_cb() should be used to implement
* the key exporter described in Section 4.2 of RFC 5764 and RFC 5705 * the key exporter described in Section 4.2 of RFC 5764 and RFC 5705
* (this is implemented in the SSL example programs). * (this is implemented in the SSL example programs).
* The resulting key should then be passed to an SRTP stack. * The resulting key should then be passed to an SRTP stack.

@ -1035,7 +1035,7 @@ struct mbedtls_ssl_config
#if defined(MBEDTLS_SSL_EXPORT_KEYS) #if defined(MBEDTLS_SSL_EXPORT_KEYS)
/** Callback to export key block, master secret, /** Callback to export key block, master secret,
* tls_prf and random bytes. Should replace f_export_keys */ * tls_prf and random bytes. Should replace f_export_keys */
int (*MBEDTLS_PRIVATE(f_export_keys_ext))( void *, const unsigned char *, int (*MBEDTLS_PRIVATE(f_export_keys))( void *, const unsigned char *,
const unsigned char *, size_t, size_t, size_t, const unsigned char *, size_t, size_t, size_t,
const unsigned char[32], const unsigned char[32], const unsigned char[32], const unsigned char[32],
mbedtls_tls_prf_types ); mbedtls_tls_prf_types );
@ -1941,7 +1941,7 @@ typedef int mbedtls_ssl_ticket_write_t( void *p_ticket,
* \return 0 if successful, or * \return 0 if successful, or
* a specific MBEDTLS_ERR_XXX code. * a specific MBEDTLS_ERR_XXX code.
*/ */
typedef int mbedtls_ssl_export_keys_ext_t( void *p_expkey, typedef int mbedtls_ssl_export_keys_t( void *p_expkey,
const unsigned char *ms, const unsigned char *ms,
const unsigned char *kb, const unsigned char *kb,
size_t maclen, size_t maclen,
@ -2020,16 +2020,16 @@ void mbedtls_ssl_conf_export_keys_cb( mbedtls_ssl_config *conf,
* \brief Configure extended key export callback. * \brief Configure extended key export callback.
* (Default: none.) * (Default: none.)
* *
* \note See \c mbedtls_ssl_export_keys_ext_t. * \note See \c mbedtls_ssl_export_keys_t.
* \warning Exported key material must not be used for any purpose * \warning Exported key material must not be used for any purpose
* before the (D)TLS handshake is completed * before the (D)TLS handshake is completed
* *
* \param conf SSL configuration context * \param conf SSL configuration context
* \param f_export_keys_ext Callback for exporting keys * \param f_export_keys Callback for exporting keys
* \param p_export_keys Context for the callback * \param p_export_keys Context for the callback
*/ */
void mbedtls_ssl_conf_export_keys_ext_cb( mbedtls_ssl_config *conf, void mbedtls_ssl_conf_export_keys_cb( mbedtls_ssl_config *conf,
mbedtls_ssl_export_keys_ext_t *f_export_keys_ext, mbedtls_ssl_export_keys_t *f_export_keys,
void *p_export_keys ); void *p_export_keys );
#endif /* MBEDTLS_SSL_EXPORT_KEYS */ #endif /* MBEDTLS_SSL_EXPORT_KEYS */

@ -986,9 +986,9 @@ static int ssl_populate_transform( mbedtls_ssl_transform *transform,
((void) mac_enc); ((void) mac_enc);
#if defined(MBEDTLS_SSL_EXPORT_KEYS) #if defined(MBEDTLS_SSL_EXPORT_KEYS)
if( ssl->conf->f_export_keys_ext != NULL ) if( ssl->conf->f_export_keys != NULL )
{ {
ssl->conf->f_export_keys_ext( ssl->conf->p_export_keys, ssl->conf->f_export_keys( ssl->conf->p_export_keys,
master, keyblk, master, keyblk,
mac_key_len, keylen, mac_key_len, keylen,
iv_copy_len, iv_copy_len,
@ -4185,11 +4185,11 @@ void mbedtls_ssl_conf_session_tickets_cb( mbedtls_ssl_config *conf,
#endif /* MBEDTLS_SSL_SESSION_TICKETS */ #endif /* MBEDTLS_SSL_SESSION_TICKETS */
#if defined(MBEDTLS_SSL_EXPORT_KEYS) #if defined(MBEDTLS_SSL_EXPORT_KEYS)
void mbedtls_ssl_conf_export_keys_ext_cb( mbedtls_ssl_config *conf, void mbedtls_ssl_conf_export_keys_cb( mbedtls_ssl_config *conf,
mbedtls_ssl_export_keys_ext_t *f_export_keys_ext, mbedtls_ssl_export_keys_t *f_export_keys,
void *p_export_keys ) void *p_export_keys )
{ {
conf->f_export_keys_ext = f_export_keys_ext; conf->f_export_keys = f_export_keys;
conf->p_export_keys = p_export_keys; conf->p_export_keys = p_export_keys;
} }
#endif #endif

@ -1739,19 +1739,19 @@ int main( int argc, char *argv[] )
#if defined(MBEDTLS_SSL_EXPORT_KEYS) #if defined(MBEDTLS_SSL_EXPORT_KEYS)
if( opt.eap_tls != 0 ) if( opt.eap_tls != 0 )
{ {
mbedtls_ssl_conf_export_keys_ext_cb( &conf, eap_tls_key_derivation, mbedtls_ssl_conf_export_keys_cb( &conf, eap_tls_key_derivation,
&eap_tls_keying ); &eap_tls_keying );
} }
else if( opt.nss_keylog != 0 ) else if( opt.nss_keylog != 0 )
{ {
mbedtls_ssl_conf_export_keys_ext_cb( &conf, mbedtls_ssl_conf_export_keys_cb( &conf,
nss_keylog_export, nss_keylog_export,
NULL ); NULL );
} }
#if defined( MBEDTLS_SSL_DTLS_SRTP ) #if defined( MBEDTLS_SSL_DTLS_SRTP )
else if( opt.use_srtp != 0 ) else if( opt.use_srtp != 0 )
{ {
mbedtls_ssl_conf_export_keys_ext_cb( &conf, dtls_srtp_key_derivation, mbedtls_ssl_conf_export_keys_cb( &conf, dtls_srtp_key_derivation,
&dtls_srtp_keying ); &dtls_srtp_keying );
} }
#endif /* MBEDTLS_SSL_DTLS_SRTP */ #endif /* MBEDTLS_SSL_DTLS_SRTP */

@ -2528,19 +2528,19 @@ int main( int argc, char *argv[] )
#if defined(MBEDTLS_SSL_EXPORT_KEYS) #if defined(MBEDTLS_SSL_EXPORT_KEYS)
if( opt.eap_tls != 0 ) if( opt.eap_tls != 0 )
{ {
mbedtls_ssl_conf_export_keys_ext_cb( &conf, eap_tls_key_derivation, mbedtls_ssl_conf_export_keys_cb( &conf, eap_tls_key_derivation,
&eap_tls_keying ); &eap_tls_keying );
} }
else if( opt.nss_keylog != 0 ) else if( opt.nss_keylog != 0 )
{ {
mbedtls_ssl_conf_export_keys_ext_cb( &conf, mbedtls_ssl_conf_export_keys_cb( &conf,
nss_keylog_export, nss_keylog_export,
NULL ); NULL );
} }
#if defined( MBEDTLS_SSL_DTLS_SRTP ) #if defined( MBEDTLS_SSL_DTLS_SRTP )
else if( opt.use_srtp != 0 ) else if( opt.use_srtp != 0 )
{ {
mbedtls_ssl_conf_export_keys_ext_cb( &conf, dtls_srtp_key_derivation, mbedtls_ssl_conf_export_keys_cb( &conf, dtls_srtp_key_derivation,
&dtls_srtp_keying ); &dtls_srtp_keying );
} }
#endif /* MBEDTLS_SSL_DTLS_SRTP */ #endif /* MBEDTLS_SSL_DTLS_SRTP */