mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-23 00:54:14 +00:00
some cleanup
This commit is contained in:
parent
a8b1a86bd7
commit
3540712517
@ -71,18 +71,17 @@ namespace crypto
|
||||
|
||||
void GenerateKeys ();
|
||||
const uint8_t * GetPublicKey () const { return m_PublicKey; };
|
||||
const uint8_t * GetPrivateKey () const { return m_PrivateKey; }; // TODO: remove
|
||||
void Agree (const uint8_t * pub, uint8_t * shared);
|
||||
|
||||
private:
|
||||
|
||||
uint8_t m_PublicKey[32];
|
||||
uint8_t m_PrivateKey[32]; // TODO: move to #else
|
||||
uint8_t m_PublicKey[32];
|
||||
#if OPENSSL_X25519
|
||||
EVP_PKEY_CTX * m_Ctx;
|
||||
EVP_PKEY * m_Pkey;
|
||||
#else
|
||||
BN_CTX * m_Ctx;
|
||||
uint8_t m_PrivateKey[32];
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "Log.h"
|
||||
#include "I2PEndian.h"
|
||||
#include "Crypto.h"
|
||||
#include "Ed25519.h"
|
||||
#include "Siphash.h"
|
||||
#include "RouterContext.h"
|
||||
#include "Transports.h"
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include <map>
|
||||
#include <array>
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <boost/asio.hpp>
|
||||
#include "Crypto.h"
|
||||
#include "util.h"
|
||||
|
@ -626,7 +626,11 @@ namespace i2p
|
||||
if (!m_StaticKeys)
|
||||
{
|
||||
if (!m_NTCP2Keys) NewNTCP2Keys ();
|
||||
m_StaticKeys.reset (new i2p::crypto::X25519Keys (m_NTCP2Keys->staticPrivateKey, m_NTCP2Keys->staticPublicKey));
|
||||
auto x = new i2p::crypto::X25519Keys (m_NTCP2Keys->staticPrivateKey, m_NTCP2Keys->staticPublicKey);
|
||||
if (!m_StaticKeys)
|
||||
m_StaticKeys.reset (x);
|
||||
else
|
||||
delete x;
|
||||
}
|
||||
return *m_StaticKeys;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user