mardi 25 juillet 2023

Can't find OPENSSL_cpuid_setup() to load custom engine for OpenSSL in C/C++

I'm trying to force OpenSSL's random number generator to use RDRAND, as described in the OpenSSL wiki here and also cited in this Stackoverflow post.

However, when I try to call this function OPENSSL_cpuid_setup();, I get the following error:

error: ‘OPENSSL_cpuid_setup’ was not declared in this scope

I've imported the following files, neither of which contain the function:

#include <openssl/evp.h>
#include <openssl/engine.h>

I've done some digging and it appears the function is present in cryptlib.h of OpenSSL, but I can't import that file.

This Stackoverflow answer seems to suggest that I don't need to call that function; indeed, when I comment that function out, the remainder of the code runs without error. Does anyone know what file I'm supposed to import, and whether the function call is necessary?




Aucun commentaire:

Enregistrer un commentaire