argc = opt_num_rest();
argv = opt_rest();
private = pubin || pubout ? 0 : 1;
- if (text)
+ if (text && !pubin)
private = 1;
if (!app_passwd(passinarg, passoutarg, &passin, &passout)) {
goto end;
}
- if (!app_load_modules(NULL))
- goto end;
-
BIO_printf(bio_err, "read DSA key\n");
{
EVP_PKEY *pkey;
goto end;
if (text) {
- assert(private);
+ assert(pubin || private);
if (!DSA_print(out, dsa, 0)) {
perror(outfile);
ERR_print_errors(bio_err);
pk = EVP_PKEY_new();
EVP_PKEY_set1_DSA(pk, dsa);
if (outformat == FORMAT_PVK) {
+ if (pubin) {
+ BIO_printf(bio_err, "PVK form impossible with public key input\n");
+ EVP_PKEY_free(pk);
+ goto end;
+ }
assert(private);
i = i2b_PVK_bio(out, pk, pvk_encr, 0, passout);
}