lokinet/llarp/service/async_key_exchange.hpp

49 lines
1.4 KiB
C++
Raw Normal View History

#ifndef LLARP_SERVICE_ASYNC_KEY_EXCHANGE_HPP
#define LLARP_SERVICE_ASYNC_KEY_EXCHANGE_HPP
#include <crypto/types.hpp>
#include <service/identity.hpp>
#include <service/protocol.hpp>
namespace llarp
{
class Logic;
namespace service
{
struct AsyncKeyExchange
: public std::enable_shared_from_this< AsyncKeyExchange >
{
2019-05-22 16:20:50 +00:00
std::shared_ptr< Logic > logic;
SharedSecret sharedKey;
2019-08-02 09:27:27 +00:00
ServiceInfo m_remote;
const Identity& m_LocalIdentity;
ProtocolMessage msg;
Introduction intro;
const PQPubKey introPubKey;
Introduction remoteIntro;
std::function< void(std::shared_ptr< ProtocolFrame >) > hook;
IDataHandler* handler;
ConvoTag tag;
2019-07-30 23:42:13 +00:00
AsyncKeyExchange(std::shared_ptr< Logic > l, ServiceInfo r,
const Identity& localident,
const PQPubKey& introsetPubKey,
const Introduction& remote, IDataHandler* h,
2019-06-11 16:44:05 +00:00
const ConvoTag& t, ProtocolType proto);
static void
2019-11-27 15:59:36 +00:00
Result(std::shared_ptr< AsyncKeyExchange > user,
std::shared_ptr< ProtocolFrame > frame);
/// given protocol message make protocol frame
static void
2019-11-27 15:59:36 +00:00
Encrypt(std::shared_ptr< AsyncKeyExchange > user,
std::shared_ptr< ProtocolFrame > frame);
};
} // namespace service
} // namespace llarp
#endif