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)
Bernd Edlinger
6 years ago
545 | 545 | BIO_printf(out, "\treturn(group);\n\t}\n"); |
546 | 546 | } |
547 | 547 | |
548 | if (outformat == FORMAT_ASN1 && genkey) | |
549 | noout = 1; | |
550 | ||
548 | 551 | if (!noout) { |
549 | 552 | if (outformat == FORMAT_ASN1) |
550 | 553 | i = i2d_ECPKParameters_bio(out, group); |
580 | 583 | |
581 | 584 | if (EC_KEY_set_group(eckey, group) == 0) |
582 | 585 | goto end; |
586 | ||
587 | if (new_form) | |
588 | EC_KEY_set_conv_form(eckey, form); | |
583 | 589 | |
584 | 590 | if (!EC_KEY_generate_key(eckey)) { |
585 | 591 | EC_KEY_free(eckey); |