break;
case OPT_REV:
rev = 1;
+ break;
case OPT_ENCRYPT:
pkey_op = EVP_PKEY_OP_ENCRYPT;
break;
if (ctx == NULL)
goto opthelp;
+ if (!app_load_modules(NULL))
+ goto end;
+
if (sigfile && (pkey_op != EVP_PKEY_OP_VERIFY)) {
BIO_printf(bio_err,
"%s: Signature file specified for non verify\n", prog);
app_RAND_load_file(NULL, 0);
if (pkey_op != EVP_PKEY_OP_DERIVE) {
- in = bio_open_default(infile, "rb");
+ in = bio_open_default(infile, 'r', FORMAT_BINARY);
if (in == NULL)
goto end;
}
- out = bio_open_default(outfile, "wb");
+ out = bio_open_default(outfile, 'w', FORMAT_BINARY);
if (out == NULL)
goto end;
EVP_PKEY_CTX_free(ctx);
BIO_free(in);
BIO_free_all(out);
- if (buf_in)
- OPENSSL_free(buf_in);
- if (buf_out)
- OPENSSL_free(buf_out);
- if (sig)
- OPENSSL_free(sig);
+ OPENSSL_free(buf_in);
+ OPENSSL_free(buf_out);
+ OPENSSL_free(sig);
return ret;
}
}
end:
-
- if (passin)
- OPENSSL_free(passin);
-
+ OPENSSL_free(passin);
return ctx;
}