X-Git-Url: https://git.syn-net.org/?p=debian%2Fuanytun.git;a=blobdiff_plain;f=src%2Fkey_derivation.c;fp=src%2Fkey_derivation.c;h=c593f313b20035147d3dbf9fb7d778d63fa51ed5;hp=f2d854862653855445e0d199ffe30efb0a3a5bb6;hb=cd587a97e53c5eddf158462a6ff2271351e813e5;hpb=b863f88b972172a865fb257dd18436c36f663e87 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 #include +#include #elif defined(USE_NETTLE) #include #include @@ -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, ¶ms->aes_key_, params->ctr_.buf_, params->ecount_buf_, &num); + memset(params->ecount_buf_, 0, AES_BLOCK_SIZE); + CRYPTO_ctr128_encrypt(key, key, len, ¶ms->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");