Simo Sorce <[email protected]> writes:

> Ah you do not need to pass any property for the default provider so you
> can pass "" or even NULL.

Thanks, I now have the RSA code updated (on branch update-openssl-bench,
if anyone wants to see the details). Initialization is now 

  ctx->pkey_ctx = EVP_PKEY_CTX_new_from_name (NULL, "RSA", "");
  if (!ctx->pkey_ctx)
    die ("OpenSSL EVP_PKEY_CTX_new_from_name (\"RSA\") failed.\n");
  if (EVP_PKEY_keygen_init (ctx->pkey_ctx) <= 0)
    die ("OpenSSL EVP_PKEY_keygen_init failed.\n");
  if (EVP_PKEY_CTX_set_rsa_keygen_bits(ctx->pkey_ctx, size) <= 0)
    die ("OpenSSL EVP_PKEY_CTX_set_rsa_keygen_bits failed.\n");
  BIGNUM *e = BN_new();
  BN_set_word(e, 65537);
  EVP_PKEY_CTX_set1_rsa_keygen_pubexp (ctx->pkey_ctx, e);
  EVP_PKEY_keygen (ctx->pkey_ctx, &ctx->key);

However, when I run this under valgrind (to check the corresponding
cleanup code doesn't leak memory), I get an error:

  ==3016684== Conditional jump or move depends on uninitialised value(s)
  ==3016684==    at 0x4B0B824: EVP_PKEY_generate (in 
/usr/lib/x86_64-linux-gnu/libcrypto.so.3)
  ==3016684==    by 0x10F30A: bench_openssl_rsa_init (hogweed-benchmark.c:721)
  ==3016684==    by 0x10D7AE: bench_alg (hogweed-benchmark.c:153)
  ==3016684==    by 0x10D7AE: main (hogweed-benchmark.c:972)
  ==3016684==

I wonder if that my code missing some initialization, or if that's an
openssl problem? It's also unclear to me when the e bignum above can be
deallocated, does EVP_PKEY_CTX_set1_rsa_keygen_pubexp imply a full copy
into the context?

Next is updating the ecdsa benchmarks, since, e.g.,
EC_KEY_new_by_curve_name, generates deprecation warnings.

Regards,
/Niels

-- 
Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677.
Internet email is subject to wholesale government surveillance.
_______________________________________________
nettle-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to