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_DELAYED_SERVER_CERT_VERIFICATION
#define MBEDTLS_SSL_FREE_SERVER_CERTIFICATE #define MBEDTLS_SSL_FREE_SERVER_CERTIFICATE
#define MBEDTLS_SSL_IMMEDIATE_TRANSMISSION #define MBEDTLS_SSL_IMMEDIATE_TRANSMISSION
#define MBEDTLS_EARLY_KEY_COMPUTATION #define MBEDTLS_SSL_EARLY_KEY_COMPUTATION
#if defined(MBEDTLS_USER_CONFIG_FILE) #if defined(MBEDTLS_USER_CONFIG_FILE)
#include MBEDTLS_USER_CONFIG_FILE #include MBEDTLS_USER_CONFIG_FILE

View file

@ -915,8 +915,8 @@
#endif #endif
#if defined(MBEDTLS_EARLY_KEY_COMPUTATION) && !defined(MBEDTLS_USE_TINYCRYPT) #if defined(MBEDTLS_SSL_EARLY_KEY_COMPUTATION) && !defined(MBEDTLS_USE_TINYCRYPT)
#error "MBEDTLS_EARLY_KEY_COMPUTATION can only be used with MBEDTLS_USE_TINYCRYPT" #error "MBEDTLS_SSL_EARLY_KEY_COMPUTATION can only be used with MBEDTLS_USE_TINYCRYPT"
#endif #endif
/* /*

View file

@ -1625,14 +1625,14 @@
//#define MBEDTLS_SSL_IMMEDIATE_TRANSMISSION //#define MBEDTLS_SSL_IMMEDIATE_TRANSMISSION
/** /**
* \def MBEDTLS_EARLY_KEY_COMPUTATION * \def MBEDTLS_SSL_EARLY_KEY_COMPUTATION
* *
* Create ephemeral Diffie-Hellman key pair after * Create ephemeral Diffie-Hellman key pair after
* the ClientHello has been successfully transmitted. * the ClientHello has been successfully transmitted.
* *
* Requires: * Requires:
*/ */
//#define MBEDTLS_EARLY_KEY_COMPUTATION //#define MBEDTLS_SSL_EARLY_KEY_COMPUTATION
/** /**
* \def MBEDTLS_SSL_HW_RECORD_ACCEL * \def MBEDTLS_SSL_HW_RECORD_ACCEL

View file

@ -573,10 +573,10 @@ struct mbedtls_ssl_handshake_params
#if defined(MBEDTLS_USE_TINYCRYPT) #if defined(MBEDTLS_USE_TINYCRYPT)
uint8_t ecdh_privkey[NUM_ECC_BYTES]; 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 ecdhe_computed;
uint8_t ecdh_publickey[2*NUM_ECC_BYTES]; 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]; uint8_t ecdh_peerkey[2*NUM_ECC_BYTES];
#endif /* MBEDTLS_USE_TINYCRYPT */ #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++ = 2 * NUM_ECC_BYTES + 1;
*p++ = 0x04; /* uncompressed point presentation */ *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, mbedtls_platform_memcpy( p, ssl->handshake->ecdh_publickey,
2 * NUM_ECC_BYTES ); 2 * NUM_ECC_BYTES );
#else #else
@ -3676,7 +3676,7 @@ static int ssl_out_client_key_exchange_write( mbedtls_ssl_context *ssl,
return( MBEDTLS_ERR_PLATFORM_FAULT_DETECTED ); return( MBEDTLS_ERR_PLATFORM_FAULT_DETECTED );
if( ret != UECC_SUCCESS ) if( ret != UECC_SUCCESS )
return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED ); 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; p += 2 * NUM_ECC_BYTES;
} }
else else
@ -4282,7 +4282,7 @@ int mbedtls_ssl_handshake_client_step( mbedtls_ssl_context *ssl )
* ServerHelloDone * ServerHelloDone
*/ */
case MBEDTLS_SSL_SERVER_HELLO: 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 */ /* Make sure that the ECDHE pre-computation is only done once */
if( ssl->handshake->ecdhe_computed == 0 ) 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 ); return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED );
ssl->handshake->ecdhe_computed = 1; 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 ); ret = ssl_parse_server_hello( ssl );
break; break;

View file

@ -498,9 +498,9 @@ static const char *features[] = {
#if defined(MBEDTLS_SSL_IMMEDIATE_TRANSMISSION) #if defined(MBEDTLS_SSL_IMMEDIATE_TRANSMISSION)
"MBEDTLS_SSL_IMMEDIATE_TRANSMISSION", "MBEDTLS_SSL_IMMEDIATE_TRANSMISSION",
#endif /* MBEDTLS_SSL_IMMEDIATE_TRANSMISSION */ #endif /* MBEDTLS_SSL_IMMEDIATE_TRANSMISSION */
#if defined(MBEDTLS_EARLY_KEY_COMPUTATION) #if defined(MBEDTLS_SSL_EARLY_KEY_COMPUTATION)
"MBEDTLS_EARLY_KEY_COMPUTATION", "MBEDTLS_SSL_EARLY_KEY_COMPUTATION",
#endif /* MBEDTLS_EARLY_KEY_COMPUTATION */ #endif /* MBEDTLS_SSL_EARLY_KEY_COMPUTATION */
#if defined(MBEDTLS_SSL_HW_RECORD_ACCEL) #if defined(MBEDTLS_SSL_HW_RECORD_ACCEL)
"MBEDTLS_SSL_HW_RECORD_ACCEL", "MBEDTLS_SSL_HW_RECORD_ACCEL",
#endif /* 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 */ #endif /* MBEDTLS_SSL_IMMEDIATE_TRANSMISSION */
#if defined(MBEDTLS_EARLY_KEY_COMPUTATION) #if defined(MBEDTLS_SSL_EARLY_KEY_COMPUTATION)
if( strcmp( "MBEDTLS_EARLY_KEY_COMPUTATION", config ) == 0 ) 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 ); return( 0 );
} }
#endif /* MBEDTLS_EARLY_KEY_COMPUTATION */ #endif /* MBEDTLS_SSL_EARLY_KEY_COMPUTATION */
#if defined(MBEDTLS_SSL_HW_RECORD_ACCEL) #if defined(MBEDTLS_SSL_HW_RECORD_ACCEL)
if( strcmp( "MBEDTLS_SSL_HW_RECORD_ACCEL", config ) == 0 ) if( strcmp( "MBEDTLS_SSL_HW_RECORD_ACCEL", config ) == 0 )

View file

@ -65,7 +65,7 @@
# MBEDTLS_DELAYED_SERVER_CERT_VERIFICATION # MBEDTLS_DELAYED_SERVER_CERT_VERIFICATION
# MBEDTLS_SSL_FREE_SERVER_CERTIFICATE # MBEDTLS_SSL_FREE_SERVER_CERTIFICATE
# MBEDTLS_SSL_IMMEDIATE_TRANSMISSION # MBEDTLS_SSL_IMMEDIATE_TRANSMISSION
# MBEDTLS_EARLY_KEY_COMPUTATION # MBEDTLS_SSL_EARLY_KEY_COMPUTATION
# and any symbol beginning _ALT # and any symbol beginning _ALT
# #
# The baremetal configuration excludes options that require a library or # The baremetal configuration excludes options that require a library or
@ -157,7 +157,7 @@ MBEDTLS_PLATFORM_FAULT_CALLBACKS
MBEDTLS_DELAYED_SERVER_CERT_VERIFICATION MBEDTLS_DELAYED_SERVER_CERT_VERIFICATION
MBEDTLS_SSL_FREE_SERVER_CERTIFICATE MBEDTLS_SSL_FREE_SERVER_CERTIFICATE
MBEDTLS_SSL_IMMEDIATE_TRANSMISSION MBEDTLS_SSL_IMMEDIATE_TRANSMISSION
MBEDTLS_EARLY_KEY_COMPUTATION MBEDTLS_SSL_EARLY_KEY_COMPUTATION
_ALT\s*$ _ALT\s*$
); );