366 |
|
BN_CTX *ctx = NULL; |
367 |
|
BIGNUM *tx, *ty; |
368 |
|
EC_POINT *point = NULL; |
369 |
< |
int ok = 0, tmp_nid, is_char_two = 0; |
369 |
> |
int ok = 0; |
370 |
> |
#ifndef OPENSSL_NO_EC2M |
371 |
> |
int tmp_nid, is_char_two = 0; |
372 |
> |
#endif |
373 |
|
|
374 |
|
if (!key || !key->group || !x || !y) { |
375 |
|
ECerr(EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES, |
385 |
|
if (!point) |
386 |
|
goto err; |
387 |
|
|
388 |
+ |
tx = BN_CTX_get(ctx); |
389 |
+ |
ty = BN_CTX_get(ctx); |
390 |
+ |
|
391 |
+ |
#ifndef OPENSSL_NO_EC2M |
392 |
|
tmp_nid = EC_METHOD_get_field_type(EC_GROUP_method_of(key->group)); |
393 |
|
|
394 |
|
if (tmp_nid == NID_X9_62_characteristic_two_field) |
395 |
|
is_char_two = 1; |
396 |
|
|
390 |
– |
tx = BN_CTX_get(ctx); |
391 |
– |
ty = BN_CTX_get(ctx); |
392 |
– |
#ifndef OPENSSL_NO_EC2M |
397 |
|
if (is_char_two) { |
398 |
|
if (!EC_POINT_set_affine_coordinates_GF2m(key->group, point, |
399 |
|
x, y, ctx)) |