summaryrefslogtreecommitdiffstats
path: root/fips
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2011-11-19 17:03:44 +0000
committerDr. Stephen Henson <steve@openssl.org>2011-11-19 17:03:44 +0000
commitf6385248f6dbca423aa7b9a1e1dadadd15cb4f9b (patch)
treeedd1becfac03a912738e4bf012b736eb19632425 /fips
parent52876c3100f4cd38f02b9b4c2b08e2496e96314e (diff)
Add flag to support cofactor ECDH
Diffstat (limited to 'fips')
-rw-r--r--fips/ecdh/fips_ecdh_selftest.c2
-rw-r--r--fips/ecdh/fips_ecdhvs.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/fips/ecdh/fips_ecdh_selftest.c b/fips/ecdh/fips_ecdh_selftest.c
index 2b21ceaf48..0b16c57aae 100644
--- a/fips/ecdh/fips_ecdh_selftest.c
+++ b/fips/ecdh/fips_ecdh_selftest.c
@@ -166,6 +166,7 @@ int FIPS_selftest_ecdh(void)
rv = -1;
goto err;
}
+ EC_KEY_set_flags(ec1, EC_FLAG_COFACTOR_ECDH);
if (!EC_KEY_set_public_key_affine_coordinates(ec1, x, y))
{
@@ -194,6 +195,7 @@ int FIPS_selftest_ecdh(void)
rv = -1;
goto err;
}
+ EC_KEY_set_flags(ec1, EC_FLAG_COFACTOR_ECDH);
if (!EC_KEY_set_public_key_affine_coordinates(ec2, x, y))
{
diff --git a/fips/ecdh/fips_ecdhvs.c b/fips/ecdh/fips_ecdhvs.c
index 099285aac3..61d216d1b7 100644
--- a/fips/ecdh/fips_ecdhvs.c
+++ b/fips/ecdh/fips_ecdhvs.c
@@ -261,6 +261,7 @@ static void ec_output_Zhash(FILE *out, int exout, EC_GROUP *group,
unsigned char chash[EVP_MAX_MD_SIZE];
int Zlen;
ec = EC_KEY_new();
+ EC_KEY_set_flags(ec, EC_FLAG_COFACTOR_ECDH);
EC_KEY_set_group(ec, group);
peerkey = make_peer(group, cx, cy);
if (rhash == NULL)