Fix EVP_RAND-SEED-SRC documentation example

Fixes #22810

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22857)
This commit is contained in:
Jamie Cui 2023-11-29 01:28:58 +00:00 committed by Tomas Mraz
parent 6b7a11d8aa
commit 58d926213f
1 changed files with 2 additions and 1 deletions

View File

@ -49,9 +49,10 @@ A context for the seed source can be obtained by calling:
OSSL_PARAM params[2], *p = params;
unsigned int strength = 128;
/* Create a seed source */
/* Create and instantiate a seed source */
rand = EVP_RAND_fetch(NULL, "SEED-SRC", NULL);
seed = EVP_RAND_CTX_new(rand, NULL);
EVP_RAND_instantiate(seed, strength, 0, NULL, 0, NULL);
EVP_RAND_free(rand);
/* Feed this into a DRBG */