sigkey = app_keygen(mac_ctx, mac_name, 0, 0 /* not verbose */);
/* Verbose output would make external-tests gost-engine fail */
EVP_PKEY_CTX_free(mac_ctx);
+ if (sigkey == NULL)
+ goto end;
}
if (hmac_key != NULL) {
}
tmppkey = app_paramgen(ctx, alg);
+ if (tmppkey == NULL)
+ goto end;
EVP_PKEY_CTX_free(ctx);
ctx = NULL;
if (dsaparam) {
goto end;
}
pkey = app_keygen(ctx, "DSA", numbits, verbose);
+ if (pkey == NULL)
+ goto end;
assert(private);
if (outformat == FORMAT_ASN1)
i = i2d_PrivateKey_bio(out, pkey);
goto end;
}
pkey = app_keygen(ctx, "DSA", nbits, verbose);
+ if (pkey == NULL)
+ goto end;
assert(private);
if (!PEM_write_bio_PrivateKey(out, pkey, enc, NULL, 0, NULL, passout)) {
pkey = do_param ? app_paramgen(ctx, algname)
: app_keygen(ctx, algname, 0, 0 /* not verbose */);
+ if (pkey == NULL)
+ goto end;
if (do_param) {
rv = PEM_write_bio_Parameters(out, pkey);
goto end;
}
pkey = app_keygen(ctx, "RSA", num, verbose);
+ if (pkey == NULL)
+ goto end;
if (verbose) {
BIGNUM *e = NULL;
BIO_printf(bio_err, "Warning: generating random key material may take a long time\n"
"if the system has a poor entropy source\n");
if (EVP_PKEY_keygen(ctx, &res) <= 0)
- app_bail_out("%s: Error generating %s key\n", opt_getprog(),
- alg != NULL ? alg : "asymmetric");
+ BIO_printf(bio_err, "%s: Error generating %s key\n", opt_getprog(),
+ alg != NULL ? alg : "asymmetric");
return res;
}
BIO_printf(bio_err, "Warning: generating random key parameters may take a long time\n"
"if the system has a poor entropy source\n");
if (EVP_PKEY_paramgen(ctx, &res) <= 0)
- app_bail_out("%s: Generating %s key parameters failed\n",
- opt_getprog(), alg != NULL ? alg : "asymmetric");
+ BIO_printf(bio_err, "%s: Generating %s key parameters failed\n",
+ opt_getprog(), alg != NULL ? alg : "asymmetric");
return res;
}
EVP_PKEY_CTX_set_cb(genctx, progress_cb);
pkey = app_keygen(genctx, keyalgstr, newkey_len, verbose);
+ if (pkey == NULL)
+ goto end;
EVP_PKEY_CTX_free(genctx);
genctx = NULL;