From 7eff6aa0d627c2bdbce0493bdb029e477a8caf1e Mon Sep 17 00:00:00 2001 From: Viktor Dukhovni Date: Sun, 13 Dec 2015 02:51:44 -0500 Subject: Avoid erroneous "assert(private)" failures. When processing a public key input via "-pubin", "private" was sometimes erroneously set, or else not set and incorrectly asserted. Reviewed-by: Rich salz --- apps/ec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/ec.c') diff --git a/apps/ec.c b/apps/ec.c index 3c38e6157b..8800cdf58d 100644 --- a/apps/ec.c +++ b/apps/ec.c @@ -194,7 +194,7 @@ int ec_main(int argc, char **argv) argc = opt_num_rest(); argv = opt_rest(); private = param_out || pubin || pubout ? 0 : 1; - if (text) + if (text && !pubin) private = 1; if (!app_passwd(passinarg, passoutarg, &passin, &passout)) { @@ -237,7 +237,7 @@ int ec_main(int argc, char **argv) EC_KEY_set_asn1_flag(eckey, asn1_flag); if (text) { - assert(private); + assert(pubin || private); if (!EC_KEY_print(out, eckey, 0)) { perror(outfile); ERR_print_errors(bio_err); -- cgit v1.2.3