mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 12:15:38 +01:00
Add an "SSL" infix to MBEDTLS_EARLY_KEY_COMPUTATION
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
parent
4f5549f595
commit
6b5c9a3744
@ -166,7 +166,7 @@
|
||||
#define MBEDTLS_DELAYED_SERVER_CERT_VERIFICATION
|
||||
#define MBEDTLS_SSL_FREE_SERVER_CERTIFICATE
|
||||
#define MBEDTLS_SSL_IMMEDIATE_TRANSMISSION
|
||||
#define MBEDTLS_EARLY_KEY_COMPUTATION
|
||||
#define MBEDTLS_SSL_EARLY_KEY_COMPUTATION
|
||||
|
||||
#if defined(MBEDTLS_USER_CONFIG_FILE)
|
||||
#include MBEDTLS_USER_CONFIG_FILE
|
||||
|
@ -915,8 +915,8 @@
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(MBEDTLS_EARLY_KEY_COMPUTATION) && !defined(MBEDTLS_USE_TINYCRYPT)
|
||||
#error "MBEDTLS_EARLY_KEY_COMPUTATION can only be used with MBEDTLS_USE_TINYCRYPT"
|
||||
#if defined(MBEDTLS_SSL_EARLY_KEY_COMPUTATION) && !defined(MBEDTLS_USE_TINYCRYPT)
|
||||
#error "MBEDTLS_SSL_EARLY_KEY_COMPUTATION can only be used with MBEDTLS_USE_TINYCRYPT"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -1625,14 +1625,14 @@
|
||||
//#define MBEDTLS_SSL_IMMEDIATE_TRANSMISSION
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_EARLY_KEY_COMPUTATION
|
||||
* \def MBEDTLS_SSL_EARLY_KEY_COMPUTATION
|
||||
*
|
||||
* Create ephemeral Diffie-Hellman key pair after
|
||||
* the ClientHello has been successfully transmitted.
|
||||
*
|
||||
* Requires:
|
||||
*/
|
||||
//#define MBEDTLS_EARLY_KEY_COMPUTATION
|
||||
//#define MBEDTLS_SSL_EARLY_KEY_COMPUTATION
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_SSL_HW_RECORD_ACCEL
|
||||
|
@ -573,10 +573,10 @@ struct mbedtls_ssl_handshake_params
|
||||
|
||||
#if defined(MBEDTLS_USE_TINYCRYPT)
|
||||
uint8_t ecdh_privkey[NUM_ECC_BYTES];
|
||||
#if defined(MBEDTLS_EARLY_KEY_COMPUTATION)
|
||||
#if defined(MBEDTLS_SSL_EARLY_KEY_COMPUTATION)
|
||||
uint8_t ecdhe_computed;
|
||||
uint8_t ecdh_publickey[2*NUM_ECC_BYTES];
|
||||
#endif /* MBEDTLS_EARLY_KEY_COMPUTATION */
|
||||
#endif /* MBEDTLS_SSL_EARLY_KEY_COMPUTATION */
|
||||
uint8_t ecdh_peerkey[2*NUM_ECC_BYTES];
|
||||
#endif /* MBEDTLS_USE_TINYCRYPT */
|
||||
|
||||
|
@ -3667,7 +3667,7 @@ static int ssl_out_client_key_exchange_write( mbedtls_ssl_context *ssl,
|
||||
*p++ = 2 * NUM_ECC_BYTES + 1;
|
||||
*p++ = 0x04; /* uncompressed point presentation */
|
||||
|
||||
#if defined(MBEDTLS_EARLY_KEY_COMPUTATION)
|
||||
#if defined(MBEDTLS_SSL_EARLY_KEY_COMPUTATION)
|
||||
mbedtls_platform_memcpy( p, ssl->handshake->ecdh_publickey,
|
||||
2 * NUM_ECC_BYTES );
|
||||
#else
|
||||
@ -3676,7 +3676,7 @@ static int ssl_out_client_key_exchange_write( mbedtls_ssl_context *ssl,
|
||||
return( MBEDTLS_ERR_PLATFORM_FAULT_DETECTED );
|
||||
if( ret != UECC_SUCCESS )
|
||||
return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED );
|
||||
#endif /* MBEDTLS_EARLY_KEY_COMPUTATION && MBEDTLS_USE_TINYCRYPT */
|
||||
#endif /* MBEDTLS_SSL_EARLY_KEY_COMPUTATION && MBEDTLS_USE_TINYCRYPT */
|
||||
p += 2 * NUM_ECC_BYTES;
|
||||
}
|
||||
else
|
||||
@ -4282,7 +4282,7 @@ int mbedtls_ssl_handshake_client_step( mbedtls_ssl_context *ssl )
|
||||
* ServerHelloDone
|
||||
*/
|
||||
case MBEDTLS_SSL_SERVER_HELLO:
|
||||
#if defined(MBEDTLS_EARLY_KEY_COMPUTATION) && defined(MBEDTLS_USE_TINYCRYPT)
|
||||
#if defined(MBEDTLS_SSL_EARLY_KEY_COMPUTATION) && defined(MBEDTLS_USE_TINYCRYPT)
|
||||
/* Make sure that the ECDHE pre-computation is only done once */
|
||||
if( ssl->handshake->ecdhe_computed == 0 )
|
||||
{
|
||||
@ -4293,7 +4293,7 @@ int mbedtls_ssl_handshake_client_step( mbedtls_ssl_context *ssl )
|
||||
return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED );
|
||||
ssl->handshake->ecdhe_computed = 1;
|
||||
}
|
||||
#endif /* MBEDTLS_EARLY_KEY_COMPUTATION && MBEDTLS_USE_TINYCRYPT */
|
||||
#endif /* MBEDTLS_SSL_EARLY_KEY_COMPUTATION && MBEDTLS_USE_TINYCRYPT */
|
||||
|
||||
ret = ssl_parse_server_hello( ssl );
|
||||
break;
|
||||
|
@ -498,9 +498,9 @@ static const char *features[] = {
|
||||
#if defined(MBEDTLS_SSL_IMMEDIATE_TRANSMISSION)
|
||||
"MBEDTLS_SSL_IMMEDIATE_TRANSMISSION",
|
||||
#endif /* MBEDTLS_SSL_IMMEDIATE_TRANSMISSION */
|
||||
#if defined(MBEDTLS_EARLY_KEY_COMPUTATION)
|
||||
"MBEDTLS_EARLY_KEY_COMPUTATION",
|
||||
#endif /* MBEDTLS_EARLY_KEY_COMPUTATION */
|
||||
#if defined(MBEDTLS_SSL_EARLY_KEY_COMPUTATION)
|
||||
"MBEDTLS_SSL_EARLY_KEY_COMPUTATION",
|
||||
#endif /* MBEDTLS_SSL_EARLY_KEY_COMPUTATION */
|
||||
#if defined(MBEDTLS_SSL_HW_RECORD_ACCEL)
|
||||
"MBEDTLS_SSL_HW_RECORD_ACCEL",
|
||||
#endif /* MBEDTLS_SSL_HW_RECORD_ACCEL */
|
||||
|
@ -1370,13 +1370,13 @@ int query_config( const char *config )
|
||||
}
|
||||
#endif /* MBEDTLS_SSL_IMMEDIATE_TRANSMISSION */
|
||||
|
||||
#if defined(MBEDTLS_EARLY_KEY_COMPUTATION)
|
||||
if( strcmp( "MBEDTLS_EARLY_KEY_COMPUTATION", config ) == 0 )
|
||||
#if defined(MBEDTLS_SSL_EARLY_KEY_COMPUTATION)
|
||||
if( strcmp( "MBEDTLS_SSL_EARLY_KEY_COMPUTATION", config ) == 0 )
|
||||
{
|
||||
MACRO_EXPANSION_TO_STR( MBEDTLS_EARLY_KEY_COMPUTATION );
|
||||
MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_EARLY_KEY_COMPUTATION );
|
||||
return( 0 );
|
||||
}
|
||||
#endif /* MBEDTLS_EARLY_KEY_COMPUTATION */
|
||||
#endif /* MBEDTLS_SSL_EARLY_KEY_COMPUTATION */
|
||||
|
||||
#if defined(MBEDTLS_SSL_HW_RECORD_ACCEL)
|
||||
if( strcmp( "MBEDTLS_SSL_HW_RECORD_ACCEL", config ) == 0 )
|
||||
|
@ -65,7 +65,7 @@
|
||||
# MBEDTLS_DELAYED_SERVER_CERT_VERIFICATION
|
||||
# MBEDTLS_SSL_FREE_SERVER_CERTIFICATE
|
||||
# MBEDTLS_SSL_IMMEDIATE_TRANSMISSION
|
||||
# MBEDTLS_EARLY_KEY_COMPUTATION
|
||||
# MBEDTLS_SSL_EARLY_KEY_COMPUTATION
|
||||
# and any symbol beginning _ALT
|
||||
#
|
||||
# The baremetal configuration excludes options that require a library or
|
||||
@ -157,7 +157,7 @@ MBEDTLS_PLATFORM_FAULT_CALLBACKS
|
||||
MBEDTLS_DELAYED_SERVER_CERT_VERIFICATION
|
||||
MBEDTLS_SSL_FREE_SERVER_CERTIFICATE
|
||||
MBEDTLS_SSL_IMMEDIATE_TRANSMISSION
|
||||
MBEDTLS_EARLY_KEY_COMPUTATION
|
||||
MBEDTLS_SSL_EARLY_KEY_COMPUTATION
|
||||
_ALT\s*$
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user