summaryrefslogtreecommitdiffstats
path: root/fips/ecdh
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2011-03-10 01:00:30 +0000
committerDr. Stephen Henson <steve@openssl.org>2011-03-10 01:00:30 +0000
commit1acc24a8ba4ea461b5e2ae94b7c9b625dc7d4c52 (patch)
treed7c007f9610d7692bb9d3434618ceacd489a6632 /fips/ecdh
parentf52e552a9359eb88a2473ef297e5868cecdb9ab7 (diff)
Make no-ec2m work again.
Diffstat (limited to 'fips/ecdh')
-rw-r--r--fips/ecdh/fips_ecdhvs.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/fips/ecdh/fips_ecdhvs.c b/fips/ecdh/fips_ecdhvs.c
index 3182f6e4ce..c68daf2e94 100644
--- a/fips/ecdh/fips_ecdhvs.c
+++ b/fips/ecdh/fips_ecdhvs.c
@@ -171,10 +171,17 @@ static EC_POINT *make_peer(EC_GROUP *group, BIGNUM *x, BIGNUM *y)
return NULL;
c = BN_CTX_new();
if (EC_METHOD_get_field_type(EC_GROUP_method_of(group))
- == NID_X9_62_characteristic_two_field)
- rv = EC_POINT_set_affine_coordinates_GF2m(group, peer, x, y, c);
- else
+ == NID_X9_62_prime_field)
rv = EC_POINT_set_affine_coordinates_GFp(group, peer, x, y, c);
+ else
+#ifdef OPENSSL_NO_EC2M
+ {
+ fprintf(stderr, "ERROR: GF2m not supported\n");
+ exit(1);
+ }
+#else
+ rv = EC_POINT_set_affine_coordinates_GF2m(group, peer, x, y, c);
+#endif
BN_CTX_free(c);
if (rv)
@@ -204,7 +211,14 @@ static int ec_print_pubkey(FILE *out, EC_KEY *key)
if (EC_METHOD_get_field_type(meth) == NID_X9_62_prime_field)
rv = EC_POINT_get_affine_coordinates_GFp(grp, pt, tx, ty, ctx);
else
+#ifdef OPENSSL_NO_EC2M
+ {
+ fprintf(stderr, "ERROR: GF2m not supported\n");
+ exit(1);
+ }
+#else
rv = EC_POINT_get_affine_coordinates_GF2m(grp, pt, tx, ty, ctx);
+#endif
do_bn_print_name(out, "QeIUTx", tx);
do_bn_print_name(out, "QeIUTy", ty);