Add an "SSL" infix to MBEDTLS_EARLY_KEY_COMPUTATION

Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
Andrzej Kurek 2020-12-21 08:02:59 -05:00
parent 4f5549f595
commit 6b5c9a3744
8 changed files with 20 additions and 20 deletions

View File

@ -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

View 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
/*

View File

@ -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

View File

@ -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 */

View File

@ -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;

View File

@ -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 */

View File

@ -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 )

View File

@ -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*$
);