mirror of https://github.com/oxen-io/lokinet
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <llarp/crypto/types.hpp>
|
|
#include "identity.hpp"
|
|
#include "protocol.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
|