rename Logic and Crypto functions to GetLogic and GetCrypto

pull/576/head
Jeff Becker 5 years ago
parent a2912ff860
commit 5872573e91
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -237,7 +237,7 @@ namespace llarp
// ... and it's valid
const auto now = self->context->Router()->Now();
if(self->record.nextRC->IsPublicRouter()
&& self->record.nextRC->Verify(self->context->Crypto(), now))
&& self->record.nextRC->Verify(self->context->GetCrypto(), now))
{
llarp_nodedb* n = self->context->Router()->nodedb();
const RouterContact rc = std::move(*self->record.nextRC);
@ -314,7 +314,7 @@ namespace llarp
return;
}
// generate path key as we are in a worker thread
auto crypto = self->context->Crypto();
auto crypto = self->context->GetCrypto();
if(!crypto->dh_server(self->hop->pathKey, self->record.commkey,
self->context->EncryptionSecretKey(),
self->record.tunnelNonce))
@ -366,13 +366,13 @@ namespace llarp
// we are the farthest hop
llarp::LogDebug("We are the farthest hop for ", info);
// send a LRAM down the path
self->context->Logic()->queue_job({self, &SendPathConfirm});
self->context->GetLogic()->queue_job({self, &SendPathConfirm});
}
else
{
// forward upstream
// we are still in the worker thread so post job to logic
self->context->Logic()->queue_job({self, &SendLRCM});
self->context->GetLogic()->queue_job({self, &SendLRCM});
}
}
};
@ -381,7 +381,7 @@ namespace llarp
LR_CommitMessage::AsyncDecrypt(llarp::path::PathContext* context) const
{
LRCMFrameDecrypt::Decrypter* decrypter = new LRCMFrameDecrypt::Decrypter(
context->Crypto(), context->EncryptionSecretKey(),
context->GetCrypto(), context->EncryptionSecretKey(),
&LRCMFrameDecrypt::HandleDecrypted);
// copy frames so we own them
LRCMFrameDecrypt* frames = new LRCMFrameDecrypt(context, decrypter, this);

@ -58,13 +58,13 @@ namespace llarp
}
Crypto*
PathContext::Crypto()
PathContext::GetCrypto()
{
return m_Router->crypto();
}
Logic*
PathContext::Logic()
PathContext::GetLogic()
{
return m_Router->logic();
}

@ -670,10 +670,10 @@ namespace llarp
Worker();
llarp::Crypto*
Crypto();
GetCrypto();
Logic*
Logic();
GetLogic();
AbstractRouter*
Router();

@ -956,7 +956,7 @@ namespace llarp
if(!GetSenderFor(frame.T, si))
return false;
// verify source
if(!frame->Verify(GetCrypto(), si))
if(!frame.Verify(GetCrypto(), si))
return false;
// remove convotag it doesn't exist
LogWarn("remove convotag T=", frame.T);

Loading…
Cancel
Save