Hello Openssl-Users,
I would like to know if my use of RAND_status() like below is correct:
int MyInitFunc(void) {
char* pathOfProviders;
pathOfProviders = getenv("PATH_OF_PROVIDERS");
DbgMsg("MyInitFunc() START\n");
OSSL_PROVIDER_set_default_search_path (NULL, pathOfProviders);
provider_legacy = OSSL_PROVIDER_load(NULL, "legacy");
if (NULL == provider_legacy) {
DbgMsg("MyInitFunc() provider_legacy is NULL\n");
}
if (RAND_status() != 1) {
RAND_seed(rnd_seed, sizeof rnd_seed);
}
DbgMsg("MyInitFunc() END\n");
return CRY_OK;
}
char* pathOfProviders;
pathOfProviders = getenv("PATH_OF_PROVIDERS");
DbgMsg("MyInitFunc() START\n");
OSSL_PROVIDER_set_default_search_path (NULL, pathOfProviders);
provider_legacy = OSSL_PROVIDER_load(NULL, "legacy");
if (NULL == provider_legacy) {
DbgMsg("MyInitFunc() provider_legacy is NULL\n");
}
if (RAND_status() != 1) {
RAND_seed(rnd_seed, sizeof rnd_seed);
}
DbgMsg("MyInitFunc() END\n");
return CRY_OK;
}
I called RAND_status immediately after OSSL_PROVIDER_load.
Is there anything I have to do before calling RAND_status()?
Thank you for your time.
Regards,
Jayme