Visual Studio和错误C2027:在OpenSSL 1.1.0

时间:2016-12-27 15:59:30

标签: c++ visual-studio visual-studio-2010 openssl

我从使用MinGW的Code :: Blocks切换了我的IDE和编译器,现在我正在使用Visual Studios。我的代码在Code :: Blocks中编译并执行得很好,但现在我在Visual Studio中遇到编译时错误

error C2027: use of undefined type 'rsa_st'

以下是存在错误的代码部分:

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;
}

我相信我正确配置了构建选项以包含include openssl目录。我没有在其他函数调用上遇到任何其他错误,例如EVP_CIPHER_CTX_free

0 个答案:

没有答案