Skip to content

Commit

Permalink
APPS/pkey: fix case where infile and outfile are the same
Browse files Browse the repository at this point in the history
  • Loading branch information
DDvO committed Sep 28, 2024
1 parent f8587cb commit ce0c508
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/pkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,17 @@ int pkey_main(int argc, char **argv)
goto end;
}

out = bio_open_owner(outfile, outformat, private);
if (out == NULL)
goto end;

if (pubin)
pkey = load_pubkey(infile, informat, 1, passin, e, "Public Key");
else
pkey = load_key(infile, informat, 1, passin, e, "key");
if (pkey == NULL)
goto end;

out = bio_open_owner(outfile, outformat, private);
if (out == NULL)
goto end;

#ifndef OPENSSL_NO_EC
if (asn1_encoding != NULL || point_format != NULL) {
OSSL_PARAM params[3], *p = params;
Expand Down

0 comments on commit ce0c508

Please sign in to comment.