Fix direct use of struct instead of abstract type
diff --git a/library/pk.c b/library/pk.c
index 9eddb61..9c81ccc 100644
--- a/library/pk.c
+++ b/library/pk.c
@@ -580,7 +580,7 @@
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 @@
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 f7d331f..9d2af94 100644
--- a/library/ssl_cli.c
+++ b/library/ssl_cli.c
@@ -3567,7 +3567,7 @@
== 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 @@
== 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 a9f983e..d3bcd80 100644
--- a/library/ssl_srv.c
+++ b/library/ssl_srv.c
@@ -3280,7 +3280,7 @@
#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 988c593..bf24a98 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -1973,7 +1973,7 @@
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 @@
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 664cd08..51e3e32 100644
--- a/tests/suites/test_suite_tinycrypt.function
+++ b/tests/suites/test_suite_tinycrypt.function
@@ -21,7 +21,7 @@
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 @@
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 @@
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 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};