mirror of
https://github.com/openssl/openssl.git
synced 2025-02-05 14:10:53 +08:00
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)
This commit is contained in:
parent
161ff6c5fa
commit
4bdc25b07f
@ -384,6 +384,9 @@ int ecparam_main(int argc, char **argv)
|
|||||||
"}\n");
|
"}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (outformat == FORMAT_ASN1 && genkey)
|
||||||
|
noout = 1;
|
||||||
|
|
||||||
if (!noout) {
|
if (!noout) {
|
||||||
if (outformat == FORMAT_ASN1)
|
if (outformat == FORMAT_ASN1)
|
||||||
i = i2d_ECPKParameters_bio(out, group);
|
i = i2d_ECPKParameters_bio(out, group);
|
||||||
@ -410,6 +413,9 @@ int ecparam_main(int argc, char **argv)
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (new_form)
|
||||||
|
EC_KEY_set_conv_form(eckey, form);
|
||||||
|
|
||||||
if (!EC_KEY_generate_key(eckey)) {
|
if (!EC_KEY_generate_key(eckey)) {
|
||||||
BIO_printf(bio_err, "unable to generate key\n");
|
BIO_printf(bio_err, "unable to generate key\n");
|
||||||
EC_KEY_free(eckey);
|
EC_KEY_free(eckey);
|
||||||
|
Loading…
Reference in New Issue
Block a user