summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/crypto/ec/ec_key.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-12-10 17:01:14 -0200
committerRenato Botelho <renato@netgate.com>2015-12-10 17:01:14 -0200
commita7ed3b08bcfc9de3d1e75679fe9292e5b09aea82 (patch)
tree71acee51f11c433be4c4a51635ce1ea4302ca4b6 /crypto/openssl/crypto/ec/ec_key.c
parent54cf5d1b6607c1e6f2cbf32784c33720517bce49 (diff)
parent3bc7f4d78d27696df85e118c07aa5a2630188922 (diff)
downloadFreeBSD-src-a7ed3b08bcfc9de3d1e75679fe9292e5b09aea82.zip
FreeBSD-src-a7ed3b08bcfc9de3d1e75679fe9292e5b09aea82.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'crypto/openssl/crypto/ec/ec_key.c')
-rw-r--r--crypto/openssl/crypto/ec/ec_key.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/crypto/openssl/crypto/ec/ec_key.c b/crypto/openssl/crypto/ec/ec_key.c
index 55ce3fe..c784b6f 100644
--- a/crypto/openssl/crypto/ec/ec_key.c
+++ b/crypto/openssl/crypto/ec/ec_key.c
@@ -366,7 +366,10 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
BN_CTX *ctx = NULL;
BIGNUM *tx, *ty;
EC_POINT *point = NULL;
- int ok = 0, tmp_nid, is_char_two = 0;
+ int ok = 0;
+#ifndef OPENSSL_NO_EC2M
+ int tmp_nid, is_char_two = 0;
+#endif
if (!key || !key->group || !x || !y) {
ECerr(EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES,
@@ -382,14 +385,15 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
if (!point)
goto err;
+ tx = BN_CTX_get(ctx);
+ ty = BN_CTX_get(ctx);
+
+#ifndef OPENSSL_NO_EC2M
tmp_nid = EC_METHOD_get_field_type(EC_GROUP_method_of(key->group));
if (tmp_nid == NID_X9_62_characteristic_two_field)
is_char_two = 1;
- tx = BN_CTX_get(ctx);
- ty = BN_CTX_get(ctx);
-#ifndef OPENSSL_NO_EC2M
if (is_char_two) {
if (!EC_POINT_set_affine_coordinates_GF2m(key->group, point,
x, y, ctx))
OpenPOWER on IntegriCloud