summaryrefslogtreecommitdiff
path: root/src/key_derivation.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2018-06-08 19:31:26 +0200
committerChristian Pointner <equinox@anytun.org>2018-06-08 19:45:54 +0200
commit1f1df7c948267c8939ffe47a9e15ec03b3805a04 (patch)
tree2debab03f6152cbd00c8e1c21768bcbdf7b9bfed /src/key_derivation.c
parentfix missing include in linux/tun.c (diff)
Add support for openssl 1.1.0.
Thanks to Eneas U de Queiroz <cote2004-github@yahoo.com>
Diffstat (limited to 'src/key_derivation.c')
-rw-r--r--src/key_derivation.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/key_derivation.c b/src/key_derivation.c
index f2d8548..c593f31 100644
--- a/src/key_derivation.c
+++ b/src/key_derivation.c
@@ -51,7 +51,9 @@
#include "key_derivation.h"
#if defined(USE_SSL_CRYPTO)
+#include <openssl/crypto.h>
#include <openssl/sha.h>
+#include <openssl/modes.h>
#elif defined(USE_NETTLE)
#include <nettle/sha1.h>
#include <nettle/sha2.h>
@@ -467,13 +469,13 @@ int key_derivation_aesctr_generate(key_derivation_t* kd, key_derivation_dir_t di
#if defined(USE_SSL_CRYPTO)
if(KD_AESCTR_CTR_LENGTH != AES_BLOCK_SIZE) {
- log_printf(ERROR, "failed to set key derivation CTR: size don't fits");
+ log_printf(ERROR, "failed to set key derivation CTR: size doesn't fit");
return -1;
}
u_int32_t num = 0;
- memset(params->ecount_buf_, 0, AES_BLOCK_SIZE);
memset(key, 0, len);
- AES_ctr128_encrypt(key, key, len, &params->aes_key_, params->ctr_.buf_, params->ecount_buf_, &num);
+ memset(params->ecount_buf_, 0, AES_BLOCK_SIZE);
+ CRYPTO_ctr128_encrypt(key, key, len, &params->aes_key_, params->ctr_.buf_, params->ecount_buf_, &num, (block128_f)AES_encrypt);
#elif defined(USE_NETTLE)
if(KD_AESCTR_CTR_LENGTH != AES_BLOCK_SIZE) {
log_printf(ERROR, "failed to set cipher CTR: size doesn't fit");