I switched over my IDE and compiler from Code::Blocks which was using MinGW, and I am now using Visual Studios. My code compiled and executed fine in Code::Blocks, but now I am getting a compile time error in Visual Studio saying
error C2027: use of undefined type 'rsa_st'
Here is the code section where the error exists:
uint8_t* getAESKey(RSAKeypair* keys, Fileinformation* encrypted)
{
RSA *rsa = RSA_new();
rsa->n = BN_bin2bn(keys->mod,128,0);
rsa->e = BN_bin2bn(keys->pub_key,4,0);
rsa->d = BN_bin2bn(keys->priv_key,128,0);
unsigned char* dest = new unsigned char[32];
int numbytes = RSA_private_decrypt(128,(const unsigned char*)encrypted->aeskey,dest,rsa,RSA_PKCS1_PADDING);
return (uint8_t*)dest;
}
I believe I correctly configured the build options to include the include openssl directory. I am not getting any other errors on other function calls such as EVP_CIPHER_CTX_free