Commit 4b9ffde5 authored by Nikos Mavrogiannopoulos's avatar Nikos Mavrogiannopoulos Committed by Niels Möller

hogweed-benchmark: do not abort() if an openssl algorithm isn't available

parent 2a22cbdc
......@@ -146,6 +146,11 @@ bench_alg (const struct alg *alg)
void *ctx;
ctx = alg->init(alg->size);
if (ctx == NULL)
{
printf("%15s %4d N/A\n", alg->name, alg->size);
return;
}
sign = time_function (alg->sign, ctx);
verify = time_function (alg->verify, ctx);
......@@ -604,7 +609,10 @@ bench_openssl_ecdsa_init (unsigned size)
default:
die ("Internal error.\n");
}
assert (ctx->key);
/* This curve isn't supported in this build of openssl */
if (ctx->key == NULL)
return NULL;
if (!EC_KEY_generate_key( ctx->key))
die ("Openssl EC_KEY_generate_key failed.\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment