/*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
#include "crypto/rand_pool.h"
#include "crypto/rand.h"
#include "internal/cryptlib.h"
-#include "seeding.h"
+#include "prov/seeding.h"
#include <version.h>
#include <taskLib.h>
* empty implementation
* vxworks does not need to init/cleanup or keep open the random lib
*/
-int rand_pool_init(void)
+int ossl_rand_pool_init(void)
{
return 1;
}
-void rand_pool_cleanup(void)
+void ossl_rand_pool_cleanup(void)
{
}
-void rand_pool_keep_random_devices_open(int keep)
+void ossl_rand_pool_keep_random_devices_open(int keep)
{
}
-int rand_pool_add_additional_data(RAND_POOL *pool)
+int ossl_rand_pool_add_additional_data(RAND_POOL *pool)
{
struct {
CRYPTO_THREAD_ID tid;
data.tid = CRYPTO_THREAD_get_current_id();
data.time = get_timer_bits();
- return rand_pool_add(pool, (unsigned char *)&data, sizeof(data), 0);
+ return ossl_rand_pool_add(pool, (unsigned char *)&data, sizeof(data), 0);
}
-int prov_pool_add_nonce_data(RAND_POOL *pool)
+int ossl_pool_add_nonce_data(RAND_POOL *pool)
{
struct {
pid_t pid;
data.tid = CRYPTO_THREAD_get_current_id();
data.time = get_time_stamp();
- return rand_pool_add(pool, (unsigned char *)&data, sizeof(data), 0);
+ return ossl_rand_pool_add(pool, (unsigned char *)&data, sizeof(data), 0);
}
-size_t prov_pool_acquire_entropy(RAND_POOL *pool)
+size_t ossl_pool_acquire_entropy(RAND_POOL *pool)
{
#if defined(RAND_SEED_VXRANDLIB)
/* vxRandLib based entropy method */
size_t bytes_needed;
- bytes_needed = rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
+ bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
if (bytes_needed > 0)
{
int retryCount = 0;
STATUS result = ERROR;
unsigned char *buffer;
- buffer = rand_pool_add_begin(pool, bytes_needed);
+ buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
while ((result != OK) && (retryCount < 10)) {
RANDOM_NUM_GEN_STATUS status = randStatus();
|| (status == RANDOM_NUM_GEN_MAX_ENTROPY) ) {
result = randBytes(buffer, bytes_needed);
if (result == OK)
- rand_pool_add_end(pool, bytes_needed, 8 * bytes_needed);
+ ossl_rand_pool_add_end(pool, bytes_needed, 8 * bytes_needed);
/*
* no else here: randStatus said ok, if randBytes failed
* it will result in another loop or no entropy
retryCount++;
}
}
- return rand_pool_entropy_available(pool);
+ return ossl_rand_pool_entropy_available(pool);
#else
/*
* SEED_NONE means none, without randlib we dont have entropy and
* rely on it being added externally
*/
- return rand_pool_entropy_available(pool);
+ return ossl_rand_pool_entropy_available(pool);
#endif /* defined(RAND_SEED_VXRANDLIB) */
}