summaryrefslogtreecommitdiffstats
path: root/usr.bin/openssl/ecparam.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-12-07 14:58:50 +0000
committerjsing <jsing@openbsd.org>2014-12-07 14:58:50 +0000
commitac40fc59ebd943196f6dab632b5dc7907d4ca092 (patch)
treed9a672ef3542b8f9c9d868171da2c5c513f700c5 /usr.bin/openssl/ecparam.c
parentAdd a test for redefining a macro name in the expansion of (diff)
downloadwireguard-openbsd-ac40fc59ebd943196f6dab632b5dc7907d4ca092.tar.xz
wireguard-openbsd-ac40fc59ebd943196f6dab632b5dc7907d4ca092.zip
Handle GF(2^m) EC curves for C code generation.
From Minux Ma.
Diffstat (limited to 'usr.bin/openssl/ecparam.c')
-rw-r--r--usr.bin/openssl/ecparam.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/openssl/ecparam.c b/usr.bin/openssl/ecparam.c
index b4d65ad2e5f..4b2119ee214 100644
--- a/usr.bin/openssl/ecparam.c
+++ b/usr.bin/openssl/ecparam.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ecparam.c,v 1.4 2014/10/13 02:46:14 bcook Exp $ */
+/* $OpenBSD: ecparam.c,v 1.5 2014/12/07 14:58:50 jsing Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
@@ -434,8 +434,9 @@ ecparam_main(int argc, char **argv)
ec_b, NULL))
goto end;
} else {
- /* TODO */
- goto end;
+ if (!EC_GROUP_get_curve_GF2m(group, ec_p, ec_a,
+ ec_b, NULL))
+ goto end;
}
if ((point = EC_GROUP_get0_generator(group)) == NULL)
@@ -504,8 +505,9 @@ ecparam_main(int argc, char **argv)
"GFp(tmp_1, tmp_2, tmp_3, NULL)) == NULL)"
"\n\t\tgoto err;\n\n");
} else {
- /* TODO */
- goto end;
+ BIO_printf(out, "\tif ((group = EC_GROUP_new_curve_"
+ "GF2m(tmp_1, tmp_2, tmp_3, NULL)) == NULL)"
+ "\n\t\tgoto err;\n\n");
}
BIO_printf(out, "\t/* build generator */\n");
BIO_printf(out, "\tif ((tmp_1 = BN_bin2bn(ec_gen_%d, "