lokinet/llarp/service/async_key_exchange.hpp
dr7ana 46ad8d4058 Clang format include sorting + CMake
- includes are now sorted in consistent, logical order; first step in an attempt to fix the tomfoolery (no relation to Tom) brought in by include-what-you-use
- shuffled around some cmake linking to simplify dependency graph
- superfluous files removed
2023-10-24 12:11:51 -07:00

42 lines
1.1 KiB
C++

#pragma once
#include "identity.hpp"
#include "protocol.hpp"
#include <llarp/crypto/types.hpp>
namespace llarp::service
{
struct AsyncKeyExchange : public std::enable_shared_from_this<AsyncKeyExchange>
{
EventLoop_ptr loop;
SharedSecret sharedKey;
ServiceInfo m_remote;
const Identity& m_LocalIdentity;
ProtocolMessage msg;
Introduction intro;
const PQPubKey introPubKey;
Introduction remoteIntro;
std::function<void(std::shared_ptr<ProtocolFrameMessage>)> hook;
Endpoint* handler;
ConvoTag tag;
AsyncKeyExchange(
EventLoop_ptr l,
ServiceInfo r,
const Identity& localident,
const PQPubKey& introsetPubKey,
const Introduction& remote,
Endpoint* h,
const ConvoTag& t);
static void
Result(std::shared_ptr<AsyncKeyExchange> user, std::shared_ptr<ProtocolFrameMessage> frame);
/// given protocol message make protocol frame
static void
Encrypt(std::shared_ptr<AsyncKeyExchange> user, std::shared_ptr<ProtocolFrameMessage> frame);
};
} // namespace llarp::service