From b72fc6a648bfd1af6b4c49a66bdb8dc1ffffab32 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Wed, 24 Jul 2019 15:23:37 +0100 Subject: [PATCH] Don't use const var in initialization of another const var ARM Compiler doesn't like it. --- library/ssl_cli.c | 5 ++--- library/ssl_srv.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/library/ssl_cli.c b/library/ssl_cli.c index f7a05495e..be83f53d6 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -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_KEY_EXCHANGE_ECDHE_RSA ) { - static const uint16_t secp256r1_tls_id = 23; static const unsigned char ecdh_group[] = { MBEDTLS_ECP_TLS_NAMED_CURVE, - ( secp256r1_tls_id >> 8 ) & 0xFF, - ( secp256r1_tls_id >> 0 ) & 0xFF, + 0 /* high bits of secp256r1 TLS ID */, + 23 /* low bits of secp256r1 TLS ID */, }; /* Check for fixed ECDH parameter preamble. */ diff --git a/library/ssl_srv.c b/library/ssl_srv.c index 4afb27ccf..559c88153 100644 --- a/library/ssl_srv.c +++ b/library/ssl_srv.c @@ -3389,11 +3389,10 @@ static int ssl_prepare_server_key_exchange( mbedtls_ssl_context *ssl, mbedtls_ssl_suite_get_key_exchange( ciphersuite_info ) == MBEDTLS_KEY_EXCHANGE_ECDHE_RSA ) { - static const uint16_t secp256r1_tls_id = 23; static const unsigned char ecdh_param_hdr[] = { MBEDTLS_ECP_TLS_NAMED_CURVE, - ( secp256r1_tls_id >> 8 ) & 0xFF, - ( secp256r1_tls_id >> 0 ) & 0xFF, + 0 /* high bits of secp256r1 TLS ID */, + 23 /* low bits of secp256r1 TLS ID */, 2 * NUM_ECC_BYTES + 1, 0x04 /* Uncompressed */ };