X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=ssl%2Fs3_clnt.c;h=11ffabb460c335791c00483defad9326c4479717;hp=b6345b5fa82b596022d889fa75728711d19714b1;hb=d18b716d259d6d3b68ff7f49d154b9158b98df65;hpb=1e4cb467e1a6ea6925a4f4f2781f864e547ea032 diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index b6345b5fa8..11ffabb460 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -1647,9 +1647,17 @@ int ssl3_get_key_exchange(SSL *s) * and the ECParameters in this case is just three bytes. */ param_len=3; - if ((param_len > n) || - (*p != NAMED_CURVE_TYPE) || - ((curve_nid = tls1_ec_curve_id2nid(*(p + 2))) == 0)) + /* Check curve is one of our prefrences, if not server has + * sent an invalid curve. + */ + if (!tls1_check_curve(s, p, param_len)) + { + al=SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,SSL_R_WRONG_CURVE); + goto f_err; + } + + if ((curve_nid = tls1_ec_curve_id2nid(*(p + 2))) == 0) { al=SSL_AD_INTERNAL_ERROR; SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS);