Added trace messages for category ENTROPY (#75)
Co-authored-by: neelimap <neelimaps@neominds.in> Reviewed-on: http://13.234.246.121:3000/Neominds/ossl35vx69/pulls/75 Co-authored-by: Neelima P S <neelima.ps@neominds.in> Co-committed-by: Neelima P S <neelima.ps@neominds.in>
This commit is contained in:
committed by
neelimap
co-authored by
neelimap
parent
1f8cf8b317
commit
52606ba138
+11
@@ -23,6 +23,8 @@
|
||||
#include "crypto/evp.h"
|
||||
#include "crypto/evp/evp_local.h"
|
||||
#include "internal/provider.h"
|
||||
#include <openssl/trace.h>
|
||||
|
||||
|
||||
static OSSL_FUNC_rand_newctx_fn drbg_ctr_new_wrapper;
|
||||
static OSSL_FUNC_rand_freectx_fn drbg_ctr_free;
|
||||
@@ -345,6 +347,15 @@ static int drbg_ctr_instantiate_wrapper(void *vdrbg, unsigned int strength,
|
||||
goto err;
|
||||
ret = ossl_prov_drbg_instantiate(drbg, strength, prediction_resistance,
|
||||
pstr, pstr_len);
|
||||
OSSL_TRACE_BEGIN(ENTROPY) {
|
||||
BIO_printf(trc_out, "ossl_prov_drbg_instantiate returned: %d\n", ret);
|
||||
if (ret == 1) {
|
||||
BIO_printf(trc_out, "DRBG instantiated successfully: ret = %d\n", ret);
|
||||
} else {
|
||||
BIO_printf(trc_out, "DRBG instantiation failed: ret = %d\n", ret);
|
||||
}
|
||||
} OSSL_TRACE_END(ENTROPY);
|
||||
|
||||
err:
|
||||
if (drbg->lock != NULL)
|
||||
CRYPTO_THREAD_unlock(drbg->lock);
|
||||
|
||||
+4
@@ -21,6 +21,8 @@
|
||||
#include "prov/provider_ctx.h"
|
||||
#include "crypto/rand.h"
|
||||
#include "crypto/rand_pool.h"
|
||||
#include <openssl/trace.h>
|
||||
|
||||
|
||||
static OSSL_FUNC_rand_newctx_fn seed_src_new;
|
||||
static OSSL_FUNC_rand_freectx_fn seed_src_free;
|
||||
@@ -195,6 +197,8 @@ static size_t seed_get_seed(void *vseed, unsigned char **pout,
|
||||
/* Get entropy by polling system entropy sources. */
|
||||
entropy_available = ossl_pool_acquire_entropy(pool);
|
||||
|
||||
OSSL_TRACE1(ENTROPY, "entropy_available = %d\n", entropy_available);
|
||||
|
||||
if (entropy_available > 0
|
||||
&& ossl_rand_pool_adin_mix_in(pool, adin, adin_len)) {
|
||||
ret = ossl_rand_pool_length(pool);
|
||||
|
||||
+4
@@ -17,6 +17,8 @@
|
||||
#include <version.h>
|
||||
#include <taskLib.h>
|
||||
#include "sysLib.h"
|
||||
#include <openssl/trace.h>
|
||||
|
||||
|
||||
extern unsigned char *collectEntropyFromInterruptJitter(void);
|
||||
|
||||
@@ -133,6 +135,8 @@ size_t ossl_pool_acquire_entropy(RAND_POOL *pool)
|
||||
|
||||
bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
|
||||
|
||||
OSSL_TRACE1(ENTROPY, "ossl_rand_pool_bytes_needed(),bytes_needed = %d\n", bytes_needed);
|
||||
|
||||
if (bytes_needed > 0) {
|
||||
int retryCount = 0;
|
||||
STATUS result = ERROR;
|
||||
|
||||
Reference in New Issue
Block a user