size_t rand_drbg_get_additional_data(unsigned char **pout, size_t max_len)
{
    size_t ret = 0;
    RAND_POOL *pool;

    pool = rand_pool_new(0, 0, max_len);
    if (pool == NULL)
        return 0;

    if (rand_pool_add_additional_data(pool) == 0)
        goto err;

    ret = rand_pool_length(pool);
    *pout = rand_pool_detach(pool);

 err:
    rand_pool_free(pool);

    return ret;
}