Update pre9
This commit is contained in:
+4
-25
@@ -341,9 +341,6 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
|
||||
BIGNUM *tx, *ty;
|
||||
EC_POINT *point = NULL;
|
||||
int ok = 0;
|
||||
#ifndef OPENSSL_NO_EC2M
|
||||
int tmp_nid, is_char_two = 0;
|
||||
#endif
|
||||
|
||||
if (key == NULL || key->group == NULL || x == NULL || y == NULL) {
|
||||
ECerr(EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES,
|
||||
@@ -365,29 +362,11 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
|
||||
if (ty == NULL)
|
||||
goto err;
|
||||
|
||||
#ifndef OPENSSL_NO_EC2M
|
||||
tmp_nid = EC_METHOD_get_field_type(EC_GROUP_method_of(key->group));
|
||||
if (!EC_POINT_set_affine_coordinates(key->group, point, x, y, ctx))
|
||||
goto err;
|
||||
if (!EC_POINT_get_affine_coordinates(key->group, point, tx, ty, ctx))
|
||||
goto err;
|
||||
|
||||
if (tmp_nid == NID_X9_62_characteristic_two_field)
|
||||
is_char_two = 1;
|
||||
|
||||
if (is_char_two) {
|
||||
if (!EC_POINT_set_affine_coordinates_GF2m(key->group, point,
|
||||
x, y, ctx))
|
||||
goto err;
|
||||
if (!EC_POINT_get_affine_coordinates_GF2m(key->group, point,
|
||||
tx, ty, ctx))
|
||||
goto err;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
if (!EC_POINT_set_affine_coordinates_GFp(key->group, point,
|
||||
x, y, ctx))
|
||||
goto err;
|
||||
if (!EC_POINT_get_affine_coordinates_GFp(key->group, point,
|
||||
tx, ty, ctx))
|
||||
goto err;
|
||||
}
|
||||
/*
|
||||
* Check if retrieved coordinates match originals and are less than field
|
||||
* order: if not values are out of range.
|
||||
|
||||
Reference in New Issue
Block a user