diff options
-rw-r--r-- | src/lib/libcrypto/ecdh/ech_key.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ecdh/ech_key.c b/src/lib/libcrypto/ecdh/ech_key.c index 5c2dc70b63..6911f1e341 100644 --- a/src/lib/libcrypto/ecdh/ech_key.c +++ b/src/lib/libcrypto/ecdh/ech_key.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ech_key.c,v 1.7 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: ech_key.c,v 1.8 2018/09/02 17:20:31 tb Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
4 | * | 4 | * |
@@ -125,6 +125,10 @@ ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, | |||
125 | } | 125 | } |
126 | 126 | ||
127 | group = EC_KEY_get0_group(ecdh); | 127 | group = EC_KEY_get0_group(ecdh); |
128 | |||
129 | if (!EC_POINT_is_on_curve(group, pub_key, ctx)) | ||
130 | goto err; | ||
131 | |||
128 | if ((tmp = EC_POINT_new(group)) == NULL) { | 132 | if ((tmp = EC_POINT_new(group)) == NULL) { |
129 | ECDHerror(ERR_R_MALLOC_FAILURE); | 133 | ECDHerror(ERR_R_MALLOC_FAILURE); |
130 | goto err; | 134 | goto err; |