diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2017-09-24 21:58:58 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2017-09-26 13:00:26 +0100 |
commit | 5ce5f787e3b03c33297b1480ec138938a4ff5e8e (patch) | |
tree | 646321c67a168bc71016bfe953688448c817ee49 /ssl | |
parent | 34e5292c578321b80d8e474db4be6d90519d8f33 (diff) | |
download | openssl-5ce5f787e3b03c33297b1480ec138938a4ff5e8e.tar.gz |
Use tls1_group_id_lookup in tls1_curve_allowed
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/=4412)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/t1_lib.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 78e42fe239..196466bd98 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -254,13 +254,11 @@ void tls1_get_grouplist(SSL *s, int sess, const uint16_t **pcurves, /* See if curve is allowed by security callback */ int tls_curve_allowed(SSL *s, uint16_t curve, int op) { - const TLS_GROUP_INFO *cinfo; + const TLS_GROUP_INFO *cinfo = tls1_group_id_lookup(curve); unsigned char ctmp[2]; - if (curve > 0xff) - return 1; - if (curve < 1 || curve > OSSL_NELEM(nid_list)) + + if (cinfo == NULL) return 0; - cinfo = &nid_list[curve - 1]; # ifdef OPENSSL_NO_EC2M if (cinfo->flags & TLS_CURVE_CHAR2) return 0; |