diff --git a/library/pk.c b/library/pk.c index 9eddb61ab..9c81ccc4d 100644 --- a/library/pk.c +++ b/library/pk.c @@ -580,7 +580,7 @@ static int uecc_eckey_verify_wrap( void *ctx, mbedtls_md_type_t md_alg, volatile int ret_fi; uint8_t signature[2*NUM_ECC_BYTES]; unsigned char *p; - const struct uECC_Curve_t * uecc_curve = uECC_secp256r1(); + uECC_Curve uecc_curve = uECC_secp256r1(); const mbedtls_uecc_keypair *keypair = (const mbedtls_uecc_keypair *) ctx; ((void) md_alg); @@ -704,7 +704,7 @@ static int uecc_eckey_sign_wrap( void *ctx, mbedtls_md_type_t md_alg, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ) { const mbedtls_uecc_keypair *keypair = (const mbedtls_uecc_keypair *) ctx; - const struct uECC_Curve_t * uecc_curve = uECC_secp256r1(); + uECC_Curve uecc_curve = uECC_secp256r1(); int ret; /* diff --git a/library/ssl_cli.c b/library/ssl_cli.c index f7d331fba..9d2af94e8 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -3567,7 +3567,7 @@ static int ssl_out_client_key_exchange_write( mbedtls_ssl_context *ssl, == MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA ) { - const struct uECC_Curve_t * uecc_curve = uECC_secp256r1(); + uECC_Curve uecc_curve = uECC_secp256r1(); ((void) n); ((void) ret); @@ -3718,7 +3718,7 @@ static int ssl_out_client_key_exchange_write( mbedtls_ssl_context *ssl, == MBEDTLS_KEY_EXCHANGE_ECDHE_PSK ) { #if defined(MBEDTLS_USE_TINYCRYPT) - const struct uECC_Curve_t * uecc_curve = uECC_secp256r1(); + uECC_Curve uecc_curve = uECC_secp256r1(); ((void) n); ((void) ret); diff --git a/library/ssl_srv.c b/library/ssl_srv.c index a9f983ede..d3bcd807a 100644 --- a/library/ssl_srv.c +++ b/library/ssl_srv.c @@ -3280,7 +3280,7 @@ static int ssl_prepare_server_key_exchange( mbedtls_ssl_context *ssl, #endif /* MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED */ #endif /* MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED */ #if defined(MBEDTLS_USE_TINYCRYPT) - const struct uECC_Curve_t * uecc_curve = uECC_secp256r1(); + uECC_Curve uecc_curve = uECC_secp256r1(); #endif (void) ciphersuite_info; /* unused in some configurations */ diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 988c59345..bf24a98ab 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -1973,7 +1973,7 @@ int mbedtls_ssl_build_pms( mbedtls_ssl_context *ssl ) mbedtls_ssl_suite_get_key_exchange( ciphersuite_info ) == MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA ) { - const struct uECC_Curve_t * uecc_curve = uECC_secp256r1(); + uECC_Curve uecc_curve = uECC_secp256r1(); ((void) ret); if( !uECC_shared_secret( ssl->handshake->ecdh_peerkey, @@ -2170,7 +2170,7 @@ int mbedtls_ssl_psk_derive_premaster( mbedtls_ssl_context *ssl, mbedtls_key_exch size_t zlen; #if defined(MBEDTLS_USE_TINYCRYPT) - const struct uECC_Curve_t * uecc_curve = uECC_secp256r1(); + uECC_Curve uecc_curve = uECC_secp256r1(); ((void) ret); if( !uECC_shared_secret( ssl->handshake->ecdh_peerkey, diff --git a/tests/suites/test_suite_tinycrypt.function b/tests/suites/test_suite_tinycrypt.function index 664cd0862..51e3e32d5 100644 --- a/tests/suites/test_suite_tinycrypt.function +++ b/tests/suites/test_suite_tinycrypt.function @@ -21,7 +21,7 @@ void test_ecdh() uint8_t secret1[NUM_ECC_BYTES] = {0}; uint8_t secret2[NUM_ECC_BYTES] = {0}; - const struct uECC_Curve_t * curve = uECC_secp256r1(); + uECC_Curve curve = uECC_secp256r1(); uECC_set_rng( &uecc_rng_wrapper ); @@ -45,7 +45,7 @@ void test_ecdsa() uint8_t hash[NUM_ECC_BYTES] = {0}; uint8_t sig[2*NUM_ECC_BYTES] = {0}; - const struct uECC_Curve_t * curve = uECC_secp256r1(); + uECC_Curve curve = uECC_secp256r1(); uECC_set_rng( &uecc_rng_wrapper ); @@ -64,7 +64,7 @@ void ecdh_primitive_testvec( data_t * private1, data_t * xA_str, data_t * yA_str, data_t * private2, data_t * xB_str, data_t * yB_str, data_t * z_str ) { - const struct uECC_Curve_t * curve = uECC_secp256r1(); + uECC_Curve curve = uECC_secp256r1(); uint8_t public1[2*NUM_ECC_BYTES] = {0}; uint8_t public2[2*NUM_ECC_BYTES] = {0}; uint8_t secret1[NUM_ECC_BYTES] = {0}; @@ -90,7 +90,7 @@ void ecdh_primitive_testvec( data_t * private1, data_t * xA_str, void ecdsa_primitive_testvec( data_t * xQ_str, data_t * yQ_str, data_t * hash, data_t * r_str, data_t * s_str ) { - const struct uECC_Curve_t * curve = uECC_secp256r1(); + uECC_Curve curve = uECC_secp256r1(); uint8_t pub_bytes[2*NUM_ECC_BYTES] = {0}; uint8_t sig_bytes[2*NUM_ECC_BYTES] = {0};