summaryrefslogtreecommitdiff
path: root/src/plugins/lanplus/lanplus_crypt_impl.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2022-09-10 15:44:42 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2022-09-10 15:44:42 +0200
commitd83fb6dd0cdb8d4509fda0c6e77bbeb0fcd018a8 (patch)
tree2599d2b8a9e660bff139cbd2a32d777ad30e0c9d /src/plugins/lanplus/lanplus_crypt_impl.c
parent36a24e9032591da8cc7688f69e7e9f5f41ffe4ab (diff)
parenta9ee361f27e0439530387765924574e5358c8a5c (diff)
Update upstream source from tag 'upstream/1.8.19'
Update to upstream version '1.8.19' with Debian dir 820184ee2ea8eb8c4a7769d0a89d5236e5775134
Diffstat (limited to 'src/plugins/lanplus/lanplus_crypt_impl.c')
-rw-r--r--src/plugins/lanplus/lanplus_crypt_impl.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/plugins/lanplus/lanplus_crypt_impl.c b/src/plugins/lanplus/lanplus_crypt_impl.c
index 9652a5e..7603e6d 100644
--- a/src/plugins/lanplus/lanplus_crypt_impl.c
+++ b/src/plugins/lanplus/lanplus_crypt_impl.c
@@ -102,7 +102,7 @@ lanplus_rand(uint8_t * buffer, uint32_t num_bytes)
* param mac specifies the algorithm to be used, currently SHA1, SHA256 and MD5
* are supported
* param key is the key used for HMAC generation
- * param key_len is the lenght of key
+ * param key_len is the length of key
* param d is the data to be MAC'd
* param n is the length of the data at d
* param md is the result of the HMAC algorithm
@@ -179,11 +179,15 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
}
ctx = EVP_CIPHER_CTX_new();
- if (ctx == NULL) {
+ if (!ctx) {
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);
@@ -258,11 +262,15 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
return;
ctx = EVP_CIPHER_CTX_new();
- if (ctx == NULL) {
+ if (!ctx) {
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);