Don't use const var in initialization of another const var

ARM Compiler doesn't like it.
This commit is contained in:
Hanno Becker 2019-07-24 15:23:37 +01:00
parent 8295ff0b04
commit b72fc6a648
2 changed files with 4 additions and 6 deletions

View File

@ -2808,11 +2808,10 @@ static int ssl_in_server_key_exchange_parse( mbedtls_ssl_context *ssl,
mbedtls_ssl_suite_get_key_exchange( ciphersuite_info ) mbedtls_ssl_suite_get_key_exchange( ciphersuite_info )
== MBEDTLS_KEY_EXCHANGE_ECDHE_RSA ) == MBEDTLS_KEY_EXCHANGE_ECDHE_RSA )
{ {
static const uint16_t secp256r1_tls_id = 23;
static const unsigned char ecdh_group[] = { static const unsigned char ecdh_group[] = {
MBEDTLS_ECP_TLS_NAMED_CURVE, MBEDTLS_ECP_TLS_NAMED_CURVE,
( secp256r1_tls_id >> 8 ) & 0xFF, 0 /* high bits of secp256r1 TLS ID */,
( secp256r1_tls_id >> 0 ) & 0xFF, 23 /* low bits of secp256r1 TLS ID */,
}; };
/* Check for fixed ECDH parameter preamble. */ /* Check for fixed ECDH parameter preamble. */

View File

@ -3389,11 +3389,10 @@ static int ssl_prepare_server_key_exchange( mbedtls_ssl_context *ssl,
mbedtls_ssl_suite_get_key_exchange( ciphersuite_info ) mbedtls_ssl_suite_get_key_exchange( ciphersuite_info )
== MBEDTLS_KEY_EXCHANGE_ECDHE_RSA ) == MBEDTLS_KEY_EXCHANGE_ECDHE_RSA )
{ {
static const uint16_t secp256r1_tls_id = 23;
static const unsigned char ecdh_param_hdr[] = { static const unsigned char ecdh_param_hdr[] = {
MBEDTLS_ECP_TLS_NAMED_CURVE, MBEDTLS_ECP_TLS_NAMED_CURVE,
( secp256r1_tls_id >> 8 ) & 0xFF, 0 /* high bits of secp256r1 TLS ID */,
( secp256r1_tls_id >> 0 ) & 0xFF, 23 /* low bits of secp256r1 TLS ID */,
2 * NUM_ECC_BYTES + 1, 2 * NUM_ECC_BYTES + 1,
0x04 /* Uncompressed */ 0x04 /* Uncompressed */
}; };