diff options
Diffstat (limited to 'src/lib/libcrypto/ecdh/ech_key.c')
-rw-r--r-- | src/lib/libcrypto/ecdh/ech_key.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/lib/libcrypto/ecdh/ech_key.c b/src/lib/libcrypto/ecdh/ech_key.c index c82002ea46..e59ce8bc3c 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.10 2021/04/20 17:16:38 tb Exp $ */ | 1 | /* $OpenBSD: ech_key.c,v 1.11 2021/04/20 17:23:37 tb Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
4 | * | 4 | * |
@@ -140,21 +140,10 @@ ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, | |||
140 | goto err; | 140 | goto err; |
141 | } | 141 | } |
142 | 142 | ||
143 | if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == | 143 | if (!EC_POINT_get_affine_coordinates(group, tmp, x, y, ctx)) { |
144 | NID_X9_62_prime_field) { | 144 | ECDHerror(ECDH_R_POINT_ARITHMETIC_FAILURE); |
145 | if (!EC_POINT_get_affine_coordinates(group, tmp, x, y, ctx)) { | 145 | goto err; |
146 | ECDHerror(ECDH_R_POINT_ARITHMETIC_FAILURE); | ||
147 | goto err; | ||
148 | } | ||
149 | } | ||
150 | #ifndef OPENSSL_NO_EC2M | ||
151 | else { | ||
152 | if (!EC_POINT_get_affine_coordinates(group, tmp, x, y, ctx)) { | ||
153 | ECDHerror(ECDH_R_POINT_ARITHMETIC_FAILURE); | ||
154 | goto err; | ||
155 | } | ||
156 | } | 146 | } |
157 | #endif | ||
158 | 147 | ||
159 | buflen = ECDH_size(ecdh); | 148 | buflen = ECDH_size(ecdh); |
160 | len = BN_num_bytes(x); | 149 | len = BN_num_bytes(x); |