mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Merge pull request #4552 from hanno-arm/mbedtls_3_0_key_export
Implement modified key export API for Mbed TLS 3.0
This commit is contained in:
@ -1723,27 +1723,6 @@ int main( int argc, char *argv[] )
|
||||
mbedtls_ssl_conf_encrypt_then_mac( &conf, opt.etm );
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_SSL_EXPORT_KEYS)
|
||||
if( opt.eap_tls != 0 )
|
||||
{
|
||||
mbedtls_ssl_conf_export_keys_ext_cb( &conf, eap_tls_key_derivation,
|
||||
&eap_tls_keying );
|
||||
}
|
||||
else if( opt.nss_keylog != 0 )
|
||||
{
|
||||
mbedtls_ssl_conf_export_keys_ext_cb( &conf,
|
||||
nss_keylog_export,
|
||||
NULL );
|
||||
}
|
||||
#if defined( MBEDTLS_SSL_DTLS_SRTP )
|
||||
else if( opt.use_srtp != 0 )
|
||||
{
|
||||
mbedtls_ssl_conf_export_keys_ext_cb( &conf, dtls_srtp_key_derivation,
|
||||
&dtls_srtp_keying );
|
||||
}
|
||||
#endif /* MBEDTLS_SSL_DTLS_SRTP */
|
||||
#endif /* MBEDTLS_SSL_EXPORT_KEYS */
|
||||
|
||||
#if defined(MBEDTLS_DHM_C)
|
||||
if( opt.dhmlen != DFL_DHMLEN )
|
||||
mbedtls_ssl_conf_dhm_min_bitlen( &conf, opt.dhmlen );
|
||||
@ -1873,6 +1852,27 @@ int main( int argc, char *argv[] )
|
||||
goto exit;
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_SSL_EXPORT_KEYS)
|
||||
if( opt.eap_tls != 0 )
|
||||
{
|
||||
mbedtls_ssl_set_export_keys_cb( &ssl, eap_tls_key_derivation,
|
||||
&eap_tls_keying );
|
||||
}
|
||||
else if( opt.nss_keylog != 0 )
|
||||
{
|
||||
mbedtls_ssl_set_export_keys_cb( &ssl,
|
||||
nss_keylog_export,
|
||||
NULL );
|
||||
}
|
||||
#if defined( MBEDTLS_SSL_DTLS_SRTP )
|
||||
else if( opt.use_srtp != 0 )
|
||||
{
|
||||
mbedtls_ssl_set_export_keys_cb( &ssl, dtls_srtp_key_derivation,
|
||||
&dtls_srtp_keying );
|
||||
}
|
||||
#endif /* MBEDTLS_SSL_DTLS_SRTP */
|
||||
#endif /* MBEDTLS_SSL_EXPORT_KEYS */
|
||||
|
||||
#if defined(MBEDTLS_X509_CRT_PARSE_C)
|
||||
if( ( ret = mbedtls_ssl_set_hostname( &ssl, opt.server_name ) ) != 0 )
|
||||
{
|
||||
|
Reference in New Issue
Block a user