summaryrefslogtreecommitdiffstats
path: root/crypto/ec/ecdh_ossl.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-07-30 16:40:18 +0100
committerMatt Caswell <matt@openssl.org>2018-07-31 09:08:38 +0100
commit9cc570d4c419e2ca97e2173dc14c484195502dd4 (patch)
treec5ca35dd93fa1305ce979ff094e1755fb5b03c13 /crypto/ec/ecdh_ossl.c
parentde34e45a64f0865264b826255adbe7aee7470780 (diff)
Use the new non-curve type specific EC functions internally
Fixes #6646 Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6815)
Diffstat (limited to 'crypto/ec/ecdh_ossl.c')
-rw-r--r--crypto/ec/ecdh_ossl.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/crypto/ec/ecdh_ossl.c b/crypto/ec/ecdh_ossl.c
index 1c5db2212c..bd93793a18 100644
--- a/crypto/ec/ecdh_ossl.c
+++ b/crypto/ec/ecdh_ossl.c
@@ -83,21 +83,10 @@ int ecdh_simple_compute_key(unsigned char **pout, size_t *poutlen,
goto err;
}
- if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) ==
- NID_X9_62_prime_field) {
- if (!EC_POINT_get_affine_coordinates_GFp(group, tmp, x, NULL, ctx)) {
- ECerr(EC_F_ECDH_SIMPLE_COMPUTE_KEY, EC_R_POINT_ARITHMETIC_FAILURE);
- goto err;
- }
- }
-#ifndef OPENSSL_NO_EC2M
- else {
- if (!EC_POINT_get_affine_coordinates_GF2m(group, tmp, x, NULL, ctx)) {
- ECerr(EC_F_ECDH_SIMPLE_COMPUTE_KEY, EC_R_POINT_ARITHMETIC_FAILURE);
- goto err;
- }
+ if (!EC_POINT_get_affine_coordinates(group, tmp, x, NULL, ctx)) {
+ ECerr(EC_F_ECDH_SIMPLE_COMPUTE_KEY, EC_R_POINT_ARITHMETIC_FAILURE);
+ goto err;
}
-#endif
buflen = (EC_GROUP_get_degree(group) + 7) / 8;
len = BN_num_bytes(x);