Przeglądaj źródła

Remove EC_GROUP_new_arbitrary.

The Conscrypt revert cycled in long ago.

Change-Id: If3cdb211d7347dca88bd70bdc643f80b19a7e528
Reviewed-on: https://boringssl-review.googlesource.com/8306
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 8 lat temu
committed by Adam Langley
rodzic
commit
2f02854c24
3 zmienionych plików z 0 dodań i 73 usunięć
  1. +0
    -33
      crypto/ec/ec.c
  2. +0
    -31
      crypto/ec/ec_test.cc
  3. +0
    -9
      include/openssl/ec.h

+ 0
- 33
crypto/ec/ec.c Wyświetl plik

@@ -404,39 +404,6 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
BN_copy(&group->cofactor, cofactor);
}

EC_GROUP *EC_GROUP_new_arbitrary(const BIGNUM *p, const BIGNUM *a,
const BIGNUM *b, const BIGNUM *gx,
const BIGNUM *gy, const BIGNUM *order,
const BIGNUM *cofactor) {
BN_CTX *ctx = BN_CTX_new();
if (ctx == NULL) {
return NULL;
}

EC_POINT *generator = NULL;
EC_GROUP *ret = EC_GROUP_new_curve_GFp(p, a, b, ctx);
if (ret == NULL) {
goto err;
}

generator = EC_POINT_new(ret);
if (generator == NULL ||
!EC_POINT_set_affine_coordinates_GFp(ret, generator, gx, gy, ctx) ||
!EC_GROUP_set_generator(ret, generator, order, cofactor)) {
goto err;
}

EC_POINT_free(generator);
BN_CTX_free(ctx);
return ret;

err:
EC_POINT_free(generator);
EC_GROUP_free(ret);
BN_CTX_free(ctx);
return NULL;
}

static EC_GROUP *ec_group_new_from_data(unsigned built_in_index) {
const struct built_in_curve *curve = &OPENSSL_built_in_curves[built_in_index];
EC_GROUP *group = NULL;


+ 0
- 31
crypto/ec/ec_test.cc Wyświetl plik

@@ -404,37 +404,6 @@ static bool TestArbitraryCurve() {
return false;
}

// Repeat the process for |EC_GROUP_new_arbitrary|.
group.reset(EC_GROUP_new_arbitrary(p.get(), a.get(), b.get(), gx.get(),
gy.get(), order.get(), cofactor.get()));
if (!group) {
return false;
}

// |group| should not have a curve name.
if (EC_GROUP_get_curve_name(group.get()) != NID_undef) {
return false;
}

// Copy |key| to |key2| using |group|.
key2.reset(EC_KEY_new());
point.reset(EC_POINT_new(group.get()));
if (!key2 || !point ||
!EC_KEY_set_group(key2.get(), group.get()) ||
!EC_KEY_set_private_key(key2.get(), EC_KEY_get0_private_key(key.get())) ||
!EC_POINT_set_affine_coordinates_GFp(group.get(), point.get(), x.get(),
y.get(), nullptr) ||
!EC_KEY_set_public_key(key2.get(), point.get())) {
fprintf(stderr, "Could not copy key.\n");
return false;
}

// The key must be valid according to the new group too.
if (!EC_KEY_check_key(key2.get())) {
fprintf(stderr, "Copied key is not valid.\n");
return false;
}

return true;
}



+ 0
- 9
include/openssl/ec.h Wyświetl plik

@@ -315,15 +315,6 @@ OPENSSL_EXPORT int EC_GROUP_set_generator(EC_GROUP *group,
const BIGNUM *order,
const BIGNUM *cofactor);

/* EC_GROUP_new_arbitrary calls |EC_GROUP_new_curve_GFp| and
* |EC_GROUP_set_generator|.
*
* TODO(davidben): Remove this once
* https://android-review.googlesource.com/#/c/207990/ has cycled in. */
OPENSSL_EXPORT EC_GROUP *EC_GROUP_new_arbitrary(
const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, const BIGNUM *gx,
const BIGNUM *gy, const BIGNUM *order, const BIGNUM *cofactor);

/* EC_GROUP_get_order sets |*order| to the order of |group|, if it's not
* NULL. It returns one on success and zero otherwise. |ctx| is ignored. Use
* |EC_GROUP_get0_order| instead. */


Ładowanie…
Anuluj
Zapisz