* Personalisation string tests
*/
- /* Test detection of too large personlisation string */
+ /* Test detection of too large personalisation string */
if (!init(drbg, td, &t)
|| RAND_DRBG_instantiate(drbg, td->pers, drbg->max_perslen + 1) > 0)
goto err;
static size_t crngt_case, crngt_idx;
-static int crngt_entropy_cb(unsigned char *buf, unsigned char *md,
+static int crngt_entropy_cb(OPENSSL_CTX *ctx, RAND_POOL *pool,
+ unsigned char *buf, unsigned char *md,
unsigned int *md_size)
{
size_t i, z;
size_t ent;
int res = 0;
int expect;
+ OPENSSL_CTX *ctx = OPENSSL_CTX_new();
- if (!TEST_true(rand_crngt_single_init()))
- return 0;
- rand_crngt_cleanup();
-
- if (!TEST_ptr(drbg = RAND_DRBG_new(dt->nid, dt->flags, NULL)))
+ if (!TEST_ptr(ctx))
return 0;
+ if (!TEST_ptr(drbg = RAND_DRBG_new_ex(ctx, dt->nid, dt->flags, NULL)))
+ goto err;
ent = (drbg->min_entropylen + CRNGT_BUFSIZ - 1) / CRNGT_BUFSIZ;
crngt_case = n % crngt_num_cases;
crngt_idx = 0;
crngt_get_entropy = &crngt_entropy_cb;
- if (!TEST_true(rand_crngt_init()))
- goto err;
#ifndef FIPS_MODE
if (!TEST_true(RAND_DRBG_set_callbacks(drbg, &rand_crngt_get_entropy,
&rand_crngt_cleanup_entropy,
uninstantiate(drbg);
RAND_DRBG_free(drbg);
crngt_get_entropy = &rand_crngt_get_entropy_cb;
+ OPENSSL_CTX_free(ctx);
return res;
}