mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
Fix compilation under OpenSSL 1.1 without ChaCha20 or Poly1305
This commit is contained in:
parent
e8db36558c
commit
a2bc96acb7
1 changed files with 3 additions and 3 deletions
|
@ -9,7 +9,7 @@
|
||||||
#include "TunnelBase.h"
|
#include "TunnelBase.h"
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
#include "Crypto.h"
|
#include "Crypto.h"
|
||||||
#if LEGACY_OPENSSL
|
#if LEGACY_OPENSSL || defined(OPENSSL_NO_CHACHA) || defined(OPENSSL_NO_POLY1305)
|
||||||
#include <openssl/conf.h>
|
#include <openssl/conf.h>
|
||||||
#include "ChaCha20.h"
|
#include "ChaCha20.h"
|
||||||
#include "Poly1305.h"
|
#include "Poly1305.h"
|
||||||
|
@ -1091,7 +1091,7 @@ namespace crypto
|
||||||
if (len < msgLen) return false;
|
if (len < msgLen) return false;
|
||||||
if (encrypt && len < msgLen + 16) return false;
|
if (encrypt && len < msgLen + 16) return false;
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
#if LEGACY_OPENSSL
|
#if LEGACY_OPENSSL || defined(OPENSSL_NO_CHACHA) || defined(OPENSSL_NO_POLY1305)
|
||||||
chacha::Chacha20State state;
|
chacha::Chacha20State state;
|
||||||
// generate one time poly key
|
// generate one time poly key
|
||||||
chacha::Chacha20Init (state, nonce, key, 0);
|
chacha::Chacha20Init (state, nonce, key, 0);
|
||||||
|
@ -1182,7 +1182,7 @@ namespace crypto
|
||||||
void AEADChaCha20Poly1305Encrypt (const std::vector<std::pair<uint8_t *, size_t> >& bufs, const uint8_t * key, const uint8_t * nonce, uint8_t * mac)
|
void AEADChaCha20Poly1305Encrypt (const std::vector<std::pair<uint8_t *, size_t> >& bufs, const uint8_t * key, const uint8_t * nonce, uint8_t * mac)
|
||||||
{
|
{
|
||||||
if (bufs.empty ()) return;
|
if (bufs.empty ()) return;
|
||||||
#if LEGACY_OPENSSL
|
#if LEGACY_OPENSSL || defined(OPENSSL_NO_CHACHA) || defined(OPENSSL_NO_POLY1305)
|
||||||
chacha::Chacha20State state;
|
chacha::Chacha20State state;
|
||||||
// generate one time poly key
|
// generate one time poly key
|
||||||
chacha::Chacha20Init (state, nonce, key, 0);
|
chacha::Chacha20Init (state, nonce, key, 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue