error: aggregate ‘EVP_CIPHER_CTX ctx’ has incomplete type and cannot be defined
OpenSSL 1.1.0以降、EVP_CIPHER_CTXに関する文法が変更されている。
- 初期化
更新前 (1.0.0)
EVP_CIPHER_CTX ctx;
EVP_CIPHER_CTX_init(&ctx);
更新後 (1.1.0)
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
EVP_CIPHER_CTX_init(ctx);
- 後処理
更新前 (1.0.0)
EVP_CIPHER_CTX_cleanup(&ctx);
更新後 (1.1.0)
EVP_CIPHER_CTX_free(ctx);
(参考) - https://stackoverflow.com/questions/26345175/correct-way-to-free-allocate-the-context-in-the-openssl