Skip to content
This repository was archived by the owner on Aug 24, 2025. It is now read-only.

Commit 5edeb62

Browse files
Fix ecparam -genkey with point compression or DER outform
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from openssl#5741) (cherry picked from commit 4bdc25b)
1 parent 1bfb786 commit 5edeb62

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

apps/ecparam.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,9 @@ int ecparam_main(int argc, char **argv)
393393
"}\n");
394394
}
395395

396+
if (outformat == FORMAT_ASN1 && genkey)
397+
noout = 1;
398+
396399
if (!noout) {
397400
if (outformat == FORMAT_ASN1)
398401
i = i2d_ECPKParameters_bio(out, group);
@@ -428,6 +431,9 @@ int ecparam_main(int argc, char **argv)
428431
goto end;
429432
}
430433

434+
if (new_form)
435+
EC_KEY_set_conv_form(eckey, form);
436+
431437
if (!EC_KEY_generate_key(eckey)) {
432438
BIO_printf(bio_err, "unable to generate key\n");
433439
EC_KEY_free(eckey);

0 commit comments

Comments
 (0)