diff options
author | Viktor Dukhovni <openssl-users@dukhovni.org> | 2015-12-13 02:51:44 -0500 |
---|---|---|
committer | Viktor Dukhovni <openssl-users@dukhovni.org> | 2015-12-13 20:13:49 -0500 |
commit | 7eff6aa0d627c2bdbce0493bdb029e477a8caf1e (patch) | |
tree | ec211202a6ba2bc4079bef4a9b5168d2d83a7f86 /apps/ec.c | |
parent | b9749432346f69b29d82070041e71b237d718ce7 (diff) |
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 <rsalz@openssl.org>
Diffstat (limited to 'apps/ec.c')
-rw-r--r-- | apps/ec.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |