Skip to content

Commit

Permalink
lanplus: Fix compile with deprecated APIs disabled.
Browse files Browse the repository at this point in the history
From the man page:

EVP_CIPHER_CTX was made opaque in OpenSSL 1.1.0. As a result,
EVP_CIPHER_CTX_reset() appeared and EVP_CIPHER_CTX_cleanup() disappeared.
EVP_CIPHER_CTX_init() remains as an alias for EVP_CIPHER_CTX_reset().

Signed-off-by: Rosen Penev <rosenp@gmail.com>
  • Loading branch information
neheb authored and AlexanderAmelkin committed Oct 31, 2018
1 parent 081bde8 commit a8862d7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/plugins/lanplus/lanplus_crypt_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed");
return;
}
#if OPENSSL_VERSION_NUMBER < 0x10100000L
EVP_CIPHER_CTX_init(ctx);
#else
EVP_CIPHER_CTX_reset(ctx);
#endif
EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
EVP_CIPHER_CTX_set_padding(ctx, 0);

Expand Down Expand Up @@ -262,7 +266,11 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed");
return;
}
#if OPENSSL_VERSION_NUMBER < 0x10100000L
EVP_CIPHER_CTX_init(ctx);
#else
EVP_CIPHER_CTX_reset(ctx);
#endif
EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
EVP_CIPHER_CTX_set_padding(ctx, 0);

Expand Down

0 comments on commit a8862d7

Please sign in to comment.