From a2bc96acb7f42035a4920ae0a46b266cb60f0c7e Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 5 Jan 2019 20:20:17 -0800 Subject: [PATCH] Fix compilation under OpenSSL 1.1 without ChaCha20 or Poly1305 --- libi2pd/Crypto.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libi2pd/Crypto.cpp b/libi2pd/Crypto.cpp index 4a97e003..c0ae337a 100644 --- a/libi2pd/Crypto.cpp +++ b/libi2pd/Crypto.cpp @@ -9,7 +9,7 @@ #include "TunnelBase.h" #include #include "Crypto.h" -#if LEGACY_OPENSSL +#if LEGACY_OPENSSL || defined(OPENSSL_NO_CHACHA) || defined(OPENSSL_NO_POLY1305) #include #include "ChaCha20.h" #include "Poly1305.h" @@ -1091,7 +1091,7 @@ namespace crypto if (len < msgLen) return false; if (encrypt && len < msgLen + 16) return false; bool ret = true; -#if LEGACY_OPENSSL +#if LEGACY_OPENSSL || defined(OPENSSL_NO_CHACHA) || defined(OPENSSL_NO_POLY1305) chacha::Chacha20State state; // generate one time poly key chacha::Chacha20Init (state, nonce, key, 0); @@ -1182,7 +1182,7 @@ namespace crypto void AEADChaCha20Poly1305Encrypt (const std::vector >& bufs, const uint8_t * key, const uint8_t * nonce, uint8_t * mac) { if (bufs.empty ()) return; -#if LEGACY_OPENSSL +#if LEGACY_OPENSSL || defined(OPENSSL_NO_CHACHA) || defined(OPENSSL_NO_POLY1305) chacha::Chacha20State state; // generate one time poly key chacha::Chacha20Init (state, nonce, key, 0);