summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2018-03-24 15:17:11 +0100
committerBernd Edlinger <bernd.edlinger@hotmail.de>2018-03-25 11:14:57 +0200
commitd591f300f9dfec4f8345b25714bdc85f0b30dfa1 (patch)
treeb9cd3363a7e136a8ac26b63db08b621317f75104 /apps
parent42b291f30be846f50ad5a36dc9d7cbb3ad9c67e1 (diff)
downloadopenssl-new-d591f300f9dfec4f8345b25714bdc85f0b30dfa1.tar.gz
Fix ecparam -genkey with point compression or DER outform
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5741) (cherry picked from commit 4bdc25b07f007d9c383fbad159f81543f2e95965)
Diffstat (limited to 'apps')
-rw-r--r--apps/ecparam.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/ecparam.c b/apps/ecparam.c
index a9bf489cdd..deb6705503 100644
--- a/apps/ecparam.c
+++ b/apps/ecparam.c
@@ -546,6 +546,9 @@ int MAIN(int argc, char **argv)
BIO_printf(out, "\treturn(group);\n\t}\n");
}
+ if (outformat == FORMAT_ASN1 && genkey)
+ noout = 1;
+
if (!noout) {
if (outformat == FORMAT_ASN1)
i = i2d_ECPKParameters_bio(out, group);
@@ -582,6 +585,9 @@ int MAIN(int argc, char **argv)
if (EC_KEY_set_group(eckey, group) == 0)
goto end;
+ if (new_form)
+ EC_KEY_set_conv_form(eckey, form);
+
if (!EC_KEY_generate_key(eckey)) {
EC_KEY_free(eckey);
goto end;