Make ecp_supported_curves constant

This commit is contained in:
Manuel Pégourié-Gonnard 2013-09-17 15:42:35 +02:00 committed by Paul Bakker
parent ed7cbe92d5
commit a79d123a55
3 changed files with 5 additions and 5 deletions

View File

@ -76,7 +76,7 @@ typedef struct
/** /**
* List of supported curves * 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) * \brief ECP point structure (jacobian coordinates)

View File

@ -73,7 +73,7 @@ unsigned long add_count, dbl_count;
* - TLS NamedCurve number (RFC 4492 section 5.1.1) * - TLS NamedCurve number (RFC 4492 section 5.1.1)
* - size in bits * - size in bits
*/ */
ecp_curve_info ecp_supported_curves[] = const ecp_curve_info ecp_supported_curves[] =
{ {
#if defined(POLARSSL_ECP_DP_SECP521R1_ENABLED) #if defined(POLARSSL_ECP_DP_SECP521R1_ENABLED)
{ POLARSSL_ECP_DP_SECP521R1, 25, 521, }, { 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_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; for( curve_info = ecp_supported_curves;
curve_info->grp_id != POLARSSL_ECP_DP_NONE; 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 ) 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; for( curve_info = ecp_supported_curves;
curve_info->grp_id != POLARSSL_ECP_DP_NONE; curve_info->grp_id != POLARSSL_ECP_DP_NONE;

View File

@ -233,7 +233,7 @@ static void ssl_write_supported_elliptic_curves_ext( ssl_context *ssl,
unsigned char *p = buf; unsigned char *p = buf;
unsigned char elliptic_curve_list[20]; unsigned char elliptic_curve_list[20];
size_t elliptic_curve_len = 0; size_t elliptic_curve_len = 0;
ecp_curve_info *curve; const ecp_curve_info *curve;
((void) ssl); ((void) ssl);
*olen = 0; *olen = 0;