From 5734b2d35889f8b2b2e6b93742e090164047e610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 15 Aug 2013 19:04:02 +0200 Subject: [PATCH] Actually use the point format selected for ECDH --- include/polarssl/ssl.h | 3 --- library/ecdh.c | 2 -- library/ssl_cli.c | 2 +- library/ssl_srv.c | 2 +- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/include/polarssl/ssl.h b/include/polarssl/ssl.h index 8f7271081..0e3047fea 100644 --- a/include/polarssl/ssl.h +++ b/include/polarssl/ssl.h @@ -429,9 +429,6 @@ struct _ssl_handshake_params ecdh_context ecdh_ctx; /*!< ECDH key exchange */ #endif int ec_curve; /*!< Selected elliptic curve */ -#if defined(POLARSSL_ECP_C) - int ec_point_format; /*!< Client supported format */ -#endif /* * Checksum contexts diff --git a/library/ecdh.c b/library/ecdh.c index 301275aa2..d76596eb2 100644 --- a/library/ecdh.c +++ b/library/ecdh.c @@ -155,8 +155,6 @@ int ecdh_read_params( ecdh_context *ctx, { int ret; - ecdh_init( ctx ); - if( ( ret = ecp_tls_read_group( &ctx->grp, buf, end - *buf ) ) != 0 ) return( ret ); diff --git a/library/ssl_cli.c b/library/ssl_cli.c index 4b7e4b5f2..16d49f3ad 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -707,7 +707,7 @@ static int ssl_parse_supported_point_formats_ext( ssl_context *ssl, if( p[0] == POLARSSL_ECP_PF_UNCOMPRESSED || p[0] == POLARSSL_ECP_PF_COMPRESSED ) { - ssl->handshake->ec_point_format = p[0]; + ssl->handshake->ecdh_ctx.point_format = p[0]; SSL_DEBUG_MSG( 4, ( "point format selected: %d", p[0] ) ); return( 0 ); } diff --git a/library/ssl_srv.c b/library/ssl_srv.c index 85820a54d..7559bb90d 100644 --- a/library/ssl_srv.c +++ b/library/ssl_srv.c @@ -552,7 +552,7 @@ static int ssl_parse_supported_point_formats( ssl_context *ssl, if( p[0] == POLARSSL_ECP_PF_UNCOMPRESSED || p[0] == POLARSSL_ECP_PF_COMPRESSED ) { - ssl->handshake->ec_point_format = p[0]; + ssl->handshake->ecdh_ctx.point_format = p[0]; SSL_DEBUG_MSG( 4, ( "point format selected: %d", p[0] ) ); return( 0 ); }