From 2b20ff62fc8c5fbb73d0c796f69edd063edccf33 Mon Sep 17 00:00:00 2001 From: PiotrBzdrega Date: Sun, 11 Feb 2024 01:56:45 +0100 Subject: [PATCH] move entropy init prior arguments number recognition Signed-off-by: PiotrBzdrega --- programs/pkey/gen_key.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/programs/pkey/gen_key.c b/programs/pkey/gen_key.c index 6914c9390d..26453cc955 100644 --- a/programs/pkey/gen_key.c +++ b/programs/pkey/gen_key.c @@ -248,7 +248,7 @@ int main(int argc, char *argv[]) mbedtls_mpi_init(&D); mbedtls_mpi_init(&E); mbedtls_mpi_init(&DP); mbedtls_mpi_init(&DQ); mbedtls_mpi_init(&QP); #endif /* MBEDTLS_RSA_C */ - + mbedtls_entropy_init(&entropy); mbedtls_pk_init(&key); mbedtls_ctr_drbg_init(&ctr_drbg); memset(buf, 0, sizeof(buf)); @@ -336,7 +336,6 @@ usage: mbedtls_printf("\n . Seeding the random number generator..."); fflush(stdout); - mbedtls_entropy_init(&entropy); #if !defined(_WIN32) && defined(MBEDTLS_FS_IO) if (opt.use_dev_random) { if ((ret = mbedtls_entropy_add_source(&entropy, dev_random_entropy_poll,