X-Git-Url: https://git.syn-net.org/debian/?a=blobdiff_plain;f=src%2FkeyDerivation.cpp;h=812dc4414853f40d8dfc658c3ff9a6f04bb07add;hb=74b165bb1a2b001b52ee01eb56ee3ea59a81d10f;hp=780a51c1854aed6fbc3a29cd7b8461284079832a;hpb=65944fb7a518dc659bacaf80cf235a0352fc6a7e;p=anytun.git diff --git a/src/keyDerivation.cpp b/src/keyDerivation.cpp index 780a51c..812dc44 100644 --- a/src/keyDerivation.cpp +++ b/src/keyDerivation.cpp @@ -61,7 +61,9 @@ #ifndef NO_PASSPHRASE #if defined(USE_SSL_CRYPTO) +#include #include +#include #elif defined(USE_NETTLE) #include #include @@ -363,9 +365,9 @@ bool AesIcmKeyDerivation::generate(kd_dir_t dir, satp_prf_label_t label, seq_nr_ return false; } unsigned int num = 0; - std::memset(ecount_buf_[dir], 0, AES_BLOCK_SIZE); std::memset(key.getBuf(), 0, key.getLength()); - AES_ctr128_encrypt(key.getBuf(), key.getBuf(), key.getLength(), &aes_key_[dir], ctr_[dir].buf_, ecount_buf_[dir], &num); + std::memset(ecount_buf_[dir], 0, AES_BLOCK_SIZE); + CRYPTO_ctr128_encrypt(key.getBuf(), key.getBuf(), key.getLength(), &aes_key_[dir], ctr_[dir].buf_, ecount_buf_[dir], &num, (block128_f)AES_encrypt); #elif defined(USE_NETTLE) if(CTR_LENGTH != AES_BLOCK_SIZE) { cLog.msg(Log::PRIO_ERROR) << "AesIcmCipher: Failed to set cipher CTR: size doesn't fit";