From a79d123a559cd6f4acc8ecc3a7035b8ae11ee88a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 17 Sep 2013 15:42:35 +0200 Subject: [PATCH] Make ecp_supported_curves constant --- include/polarssl/ecp.h | 2 +- library/ecp.c | 6 +++--- library/ssl_cli.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/polarssl/ecp.h b/include/polarssl/ecp.h index ae45c6e4a5..1d18b1453f 100644 --- a/include/polarssl/ecp.h +++ b/include/polarssl/ecp.h @@ -76,7 +76,7 @@ typedef struct /** * List of supported curves */ -extern ecp_curve_info ecp_supported_curves[]; +extern const ecp_curve_info ecp_supported_curves[]; /** * \brief ECP point structure (jacobian coordinates) diff --git a/library/ecp.c b/library/ecp.c index b62c4be8e1..47216e0341 100644 --- a/library/ecp.c +++ b/library/ecp.c @@ -73,7 +73,7 @@ unsigned long add_count, dbl_count; * - TLS NamedCurve number (RFC 4492 section 5.1.1) * - size in bits */ -ecp_curve_info ecp_supported_curves[] = +const ecp_curve_info ecp_supported_curves[] = { #if defined(POLARSSL_ECP_DP_SECP521R1_ENABLED) { POLARSSL_ECP_DP_SECP521R1, 25, 521, }, @@ -743,7 +743,7 @@ int ecp_tls_write_group( const ecp_group *grp, size_t *olen, */ ecp_group_id ecp_grp_id_from_named_curve( uint16_t name ) { - ecp_curve_info *curve_info; + const ecp_curve_info *curve_info; for( curve_info = ecp_supported_curves; curve_info->grp_id != POLARSSL_ECP_DP_NONE; @@ -761,7 +761,7 @@ ecp_group_id ecp_grp_id_from_named_curve( uint16_t name ) */ uint16_t ecp_named_curve_from_grp_id( ecp_group_id id ) { - ecp_curve_info *curve_info; + const ecp_curve_info *curve_info; for( curve_info = ecp_supported_curves; curve_info->grp_id != POLARSSL_ECP_DP_NONE; diff --git a/library/ssl_cli.c b/library/ssl_cli.c index 4cc28c3543..be4d01106d 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -233,7 +233,7 @@ static void ssl_write_supported_elliptic_curves_ext( ssl_context *ssl, unsigned char *p = buf; unsigned char elliptic_curve_list[20]; size_t elliptic_curve_len = 0; - ecp_curve_info *curve; + const ecp_curve_info *curve; ((void) ssl); *olen = 0;