Encryption 有没有办法在openssl v1.1.0或更高版本中设置不透明结构的成员?

Encryption 有没有办法在openssl v1.1.0或更高版本中设置不透明结构的成员?,encryption,openssl,crypto++,crypt,evp-cipher,Encryption,Openssl,Crypto++,Crypt,Evp Cipher,我正在重组一个遗留代码,使其与OpenSSL 1.1.1兼容。在从1.0.2->1.1.1升级OpenSSL的过程中,服务器结构变得不透明,无法直接访问成员 我需要将EVP_CIPHER_CTX的buf_len设置为0。有没有办法做到这一点 EVP_CIPHER_CTX* p_ctx; p_ctx = EVP_CIPHER_CTX_new(); ... p_ctx->buf_len = 0; 我是用c语言中最肮脏的黑客手段做到这一点的++ int buf_len = 0; //Off

我正在重组一个遗留代码,使其与OpenSSL 1.1.1兼容。在从1.0.2->1.1.1升级OpenSSL的过程中,服务器结构变得不透明,无法直接访问成员

我需要将EVP_CIPHER_CTX的buf_len设置为0。有没有办法做到这一点

EVP_CIPHER_CTX* p_ctx;
p_ctx = EVP_CIPHER_CTX_new();
...

p_ctx->buf_len = 0;

我是用c语言中最肮脏的黑客手段做到这一点的++

int buf_len = 0;

//Offset of buf_len in EVP_CIPHER_CTX is 20
int* buf_len_pointer = (int*)((char*)p_ctx + 20); 

memcpy(buf_len_pointer,&buf_len ,sizeof(buf_len));