|
|
|
@ -536,7 +536,7 @@ namespace llarp
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Exception: {}", e.what());
|
|
|
|
|
respond(serialize_response({{messages::STATUS_KEY, FindNameMessage::EXCEPTION}}));
|
|
|
|
|
respond(messages::status::ERROR_RESPONSE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_router.rpc_client()->lookup_ons_hash(
|
|
|
|
@ -546,7 +546,8 @@ namespace llarp
|
|
|
|
|
if (maybe)
|
|
|
|
|
respond(serialize_response({{"NAME", maybe->ciphertext}}));
|
|
|
|
|
else
|
|
|
|
|
respond(serialize_response({{messages::STATUS_KEY, FindNameMessage::NOT_FOUND}}));
|
|
|
|
|
respond(
|
|
|
|
|
serialize_response({{messages::status::STATUS_KEY, FindNameMessage::NOT_FOUND}}));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -564,7 +565,7 @@ namespace llarp
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
oxenc::bt_dict_consumer btdc{m.body()};
|
|
|
|
|
payload = btdc.require<std::string>(m ? "NAME" : messages::STATUS_KEY);
|
|
|
|
|
payload = btdc.require<std::string>(m ? "NAME" : messages::status::STATUS_KEY);
|
|
|
|
|
}
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
@ -578,7 +579,7 @@ namespace llarp
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (payload == FindNameMessage::EXCEPTION)
|
|
|
|
|
if (payload == "ERROR")
|
|
|
|
|
{
|
|
|
|
|
log::info(link_cat, "FindNameMessage failed with unkown error!");
|
|
|
|
|
|
|
|
|
@ -611,8 +612,7 @@ namespace llarp
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Exception: {}", e.what());
|
|
|
|
|
respond(serialize_response(
|
|
|
|
|
{{messages::STATUS_KEY, FindRouterMessage::EXCEPTION}, {"TARGET", ""}}));
|
|
|
|
|
respond(messages::status::ERROR_RESPONSE);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -643,7 +643,7 @@ namespace llarp
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
respond(serialize_response(
|
|
|
|
|
{{messages::STATUS_KEY, FindRouterMessage::RETRY_EXP}, {"TARGET", neighbors}}));
|
|
|
|
|
{{messages::status::STATUS_KEY, FindRouterMessage::RETRY_EXP}, {"TARGET", neighbors}}));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -683,14 +683,14 @@ namespace llarp
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
respond(serialize_response(
|
|
|
|
|
{{messages::STATUS_KEY, FindRouterMessage::RETRY_ITER},
|
|
|
|
|
{{messages::status::STATUS_KEY, FindRouterMessage::RETRY_ITER},
|
|
|
|
|
{"TARGET", reinterpret_cast<const char*>(target_addr.data())}}));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
respond(serialize_response(
|
|
|
|
|
{{messages::STATUS_KEY, FindRouterMessage::RETRY_NEW},
|
|
|
|
|
{{messages::status::STATUS_KEY, FindRouterMessage::RETRY_NEW},
|
|
|
|
|
{"TARGET", reinterpret_cast<const char*>(closest_rid.data())}}));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -731,7 +731,7 @@ namespace llarp
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (status == FindRouterMessage::EXCEPTION)
|
|
|
|
|
if (status == "ERROR")
|
|
|
|
|
{
|
|
|
|
|
log::info(link_cat, "FindRouterMessage failed with remote exception!");
|
|
|
|
|
// Do something smart here probably
|
|
|
|
@ -785,7 +785,7 @@ namespace llarp
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (status == FindRouterMessage::EXCEPTION)
|
|
|
|
|
if (status == "ERROR")
|
|
|
|
|
{
|
|
|
|
|
log::info(link_cat, "FindRouterMessage failed with remote exception!");
|
|
|
|
|
// Do something smart here probably
|
|
|
|
@ -840,7 +840,7 @@ namespace llarp
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Exception: {}", e.what());
|
|
|
|
|
respond(serialize_response({{messages::STATUS_KEY, PublishIntroMessage::EXCEPTION}}));
|
|
|
|
|
respond(messages::status::ERROR_RESPONSE);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -851,14 +851,15 @@ namespace llarp
|
|
|
|
|
if (not service::EncryptedIntroSet::verify(introset, derived_signing_key, sig))
|
|
|
|
|
{
|
|
|
|
|
log::error(link_cat, "Received PublishIntroMessage with invalid introset: {}", introset);
|
|
|
|
|
respond(serialize_response({{messages::STATUS_KEY, PublishIntroMessage::INVALID_INTROSET}}));
|
|
|
|
|
respond(serialize_response(
|
|
|
|
|
{{messages::status::STATUS_KEY, PublishIntroMessage::INVALID_INTROSET}}));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (now + service::MAX_INTROSET_TIME_DELTA > signed_at + path::DEFAULT_LIFETIME)
|
|
|
|
|
{
|
|
|
|
|
log::error(link_cat, "Received PublishIntroMessage with expired introset: {}", introset);
|
|
|
|
|
respond(serialize_response({{messages::STATUS_KEY, PublishIntroMessage::EXPIRED}}));
|
|
|
|
|
respond(serialize_response({{messages::status::STATUS_KEY, PublishIntroMessage::EXPIRED}}));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -868,7 +869,8 @@ namespace llarp
|
|
|
|
|
{
|
|
|
|
|
log::error(
|
|
|
|
|
link_cat, "Received PublishIntroMessage but only know {} nodes", closest_rcs.size());
|
|
|
|
|
respond(serialize_response({{messages::STATUS_KEY, PublishIntroMessage::INSUFFICIENT}}));
|
|
|
|
|
respond(
|
|
|
|
|
serialize_response({{messages::status::STATUS_KEY, PublishIntroMessage::INSUFFICIENT}}));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -880,7 +882,8 @@ namespace llarp
|
|
|
|
|
{
|
|
|
|
|
log::error(
|
|
|
|
|
link_cat, "Received PublishIntroMessage with invalide relay order: {}", relay_order);
|
|
|
|
|
respond(serialize_response({{messages::STATUS_KEY, PublishIntroMessage::INVALID_ORDER}}));
|
|
|
|
|
respond(serialize_response(
|
|
|
|
|
{{messages::status::STATUS_KEY, PublishIntroMessage::INVALID_ORDER}}));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -897,7 +900,7 @@ namespace llarp
|
|
|
|
|
relay_order);
|
|
|
|
|
|
|
|
|
|
_router.contacts()->services()->PutNode(dht::ISNode{std::move(enc)});
|
|
|
|
|
respond(serialize_response({{messages::STATUS_KEY, ""}}));
|
|
|
|
|
respond(serialize_response({{messages::status::STATUS_KEY, ""}}));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -935,7 +938,7 @@ namespace llarp
|
|
|
|
|
log::info(link_cat, "Received PublishIntroMessage for {} (TXID: {}); we are candidate {}");
|
|
|
|
|
|
|
|
|
|
_router.contacts()->services()->PutNode(dht::ISNode{std::move(enc)});
|
|
|
|
|
respond(serialize_response({{messages::STATUS_KEY, ""}}));
|
|
|
|
|
respond(serialize_response({{messages::status::STATUS_KEY, ""}}));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
log::warning(
|
|
|
|
@ -958,7 +961,7 @@ namespace llarp
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
oxenc::bt_dict_consumer btdc{m.body()};
|
|
|
|
|
payload = btdc.require<std::string>(messages::STATUS_KEY);
|
|
|
|
|
payload = btdc.require<std::string>(messages::status::STATUS_KEY);
|
|
|
|
|
}
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
@ -972,7 +975,7 @@ namespace llarp
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (payload == PublishIntroMessage::EXCEPTION)
|
|
|
|
|
if (payload == "ERROR")
|
|
|
|
|
{
|
|
|
|
|
log::info(link_cat, "PublishIntroMessage failed with remote exception!");
|
|
|
|
|
// Do something smart here probably
|
|
|
|
@ -1009,7 +1012,7 @@ namespace llarp
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Exception: {}", e.what());
|
|
|
|
|
respond(serialize_response({{messages::STATUS_KEY, FindIntroMessage::EXCEPTION}}));
|
|
|
|
|
respond(messages::status::ERROR_RESPONSE);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1021,7 +1024,8 @@ namespace llarp
|
|
|
|
|
{
|
|
|
|
|
log::warning(
|
|
|
|
|
link_cat, "Received FindIntroMessage with invalid relay order: {}", relay_order);
|
|
|
|
|
respond(serialize_response({{messages::STATUS_KEY, FindIntroMessage::INVALID_ORDER}}));
|
|
|
|
|
respond(
|
|
|
|
|
serialize_response({{messages::status::STATUS_KEY, FindIntroMessage::INVALID_ORDER}}));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1031,7 +1035,8 @@ namespace llarp
|
|
|
|
|
{
|
|
|
|
|
log::error(
|
|
|
|
|
link_cat, "Received FindIntroMessage but only know {} nodes", closest_rcs.size());
|
|
|
|
|
respond(serialize_response({{messages::STATUS_KEY, FindIntroMessage::INSUFFICIENT_NODES}}));
|
|
|
|
|
respond(serialize_response(
|
|
|
|
|
{{messages::status::STATUS_KEY, FindIntroMessage::INSUFFICIENT_NODES}}));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1069,7 +1074,7 @@ namespace llarp
|
|
|
|
|
log::warning(
|
|
|
|
|
link_cat,
|
|
|
|
|
"Received FindIntroMessage with relayed == false and no local introset entry");
|
|
|
|
|
respond(serialize_response({{messages::STATUS_KEY, FindIntroMessage::NOT_FOUND}}));
|
|
|
|
|
respond(serialize_response({{messages::status::STATUS_KEY, FindIntroMessage::NOT_FOUND}}));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1088,7 +1093,7 @@ namespace llarp
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
oxenc::bt_dict_consumer btdc{m.body()};
|
|
|
|
|
payload = btdc.require<std::string>((m) ? "INTROSET" : messages::STATUS_KEY);
|
|
|
|
|
payload = btdc.require<std::string>((m) ? "INTROSET" : messages::status::STATUS_KEY);
|
|
|
|
|
}
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
@ -1115,7 +1120,8 @@ namespace llarp
|
|
|
|
|
if (!_router.path_context().AllowingTransit())
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "got path build request when not permitting transit");
|
|
|
|
|
m.respond(serialize_response({{messages::STATUS_KEY, PathBuildMessage::NO_TRANSIT}}), true);
|
|
|
|
|
m.respond(
|
|
|
|
|
serialize_response({{messages::status::STATUS_KEY, PathBuildMessage::NO_TRANSIT}}), true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try
|
|
|
|
@ -1146,7 +1152,8 @@ namespace llarp
|
|
|
|
|
{
|
|
|
|
|
log::info(link_cat, "DH server initialization failed during path build");
|
|
|
|
|
m.respond(
|
|
|
|
|
serialize_response({{messages::STATUS_KEY, PathBuildMessage::BAD_CRYPTO}}), true);
|
|
|
|
|
serialize_response({{messages::status::STATUS_KEY, PathBuildMessage::BAD_CRYPTO}}),
|
|
|
|
|
true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1160,7 +1167,8 @@ namespace llarp
|
|
|
|
|
{
|
|
|
|
|
log::error(link_cat, "HMAC failed on path build request");
|
|
|
|
|
m.respond(
|
|
|
|
|
serialize_response({{messages::STATUS_KEY, PathBuildMessage::BAD_CRYPTO}}), true);
|
|
|
|
|
serialize_response({{messages::status::STATUS_KEY, PathBuildMessage::BAD_CRYPTO}}),
|
|
|
|
|
true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!std::equal(
|
|
|
|
@ -1168,7 +1176,8 @@ namespace llarp
|
|
|
|
|
{
|
|
|
|
|
log::info(link_cat, "HMAC mismatch on path build request");
|
|
|
|
|
m.respond(
|
|
|
|
|
serialize_response({{messages::STATUS_KEY, PathBuildMessage::BAD_CRYPTO}}), true);
|
|
|
|
|
serialize_response({{messages::status::STATUS_KEY, PathBuildMessage::BAD_CRYPTO}}),
|
|
|
|
|
true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1181,7 +1190,8 @@ namespace llarp
|
|
|
|
|
{
|
|
|
|
|
log::info(link_cat, "Decrypt failed on path build request");
|
|
|
|
|
m.respond(
|
|
|
|
|
serialize_response({{messages::STATUS_KEY, PathBuildMessage::BAD_CRYPTO}}), true);
|
|
|
|
|
serialize_response({{messages::status::STATUS_KEY, PathBuildMessage::BAD_CRYPTO}}),
|
|
|
|
|
true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1202,7 +1212,9 @@ namespace llarp
|
|
|
|
|
if (frame.empty())
|
|
|
|
|
{
|
|
|
|
|
log::info(link_cat, "Path build request received invalid frame");
|
|
|
|
|
m.respond(serialize_response({{messages::STATUS_KEY, PathBuildMessage::BAD_FRAMES}}), true);
|
|
|
|
|
m.respond(
|
|
|
|
|
serialize_response({{messages::status::STATUS_KEY, PathBuildMessage::BAD_FRAMES}}),
|
|
|
|
|
true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1219,7 +1231,9 @@ namespace llarp
|
|
|
|
|
if (hop_info.txID.IsZero() || hop_info.rxID.IsZero())
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Invalid PathID; PathIDs must be non-zero");
|
|
|
|
|
m.respond(serialize_response({{messages::STATUS_KEY, PathBuildMessage::BAD_PATHID}}), true);
|
|
|
|
|
m.respond(
|
|
|
|
|
serialize_response({{messages::status::STATUS_KEY, PathBuildMessage::BAD_PATHID}}),
|
|
|
|
|
true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1228,7 +1242,9 @@ namespace llarp
|
|
|
|
|
if (_router.path_context().HasTransitHop(hop_info))
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Invalid PathID; PathIDs must be unique");
|
|
|
|
|
m.respond(serialize_response({{messages::STATUS_KEY, PathBuildMessage::BAD_PATHID}}), true);
|
|
|
|
|
m.respond(
|
|
|
|
|
serialize_response({{messages::status::STATUS_KEY, PathBuildMessage::BAD_PATHID}}),
|
|
|
|
|
true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1236,7 +1252,9 @@ namespace llarp
|
|
|
|
|
hop->pathKey.data(), other_pubkey.data(), _router.pubkey(), inner_nonce.data()))
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "DH failed during path build.");
|
|
|
|
|
m.respond(serialize_response({{messages::STATUS_KEY, PathBuildMessage::BAD_CRYPTO}}), true);
|
|
|
|
|
m.respond(
|
|
|
|
|
serialize_response({{messages::status::STATUS_KEY, PathBuildMessage::BAD_CRYPTO}}),
|
|
|
|
|
true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// generate hash of hop key for nonce mutation
|
|
|
|
@ -1251,7 +1269,8 @@ namespace llarp
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Path build attempt with too long of a lifetime.");
|
|
|
|
|
m.respond(
|
|
|
|
|
serialize_response({{messages::STATUS_KEY, PathBuildMessage::BAD_LIFETIME}}), true);
|
|
|
|
|
serialize_response({{messages::status::STATUS_KEY, PathBuildMessage::BAD_LIFETIME}}),
|
|
|
|
|
true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1263,7 +1282,7 @@ namespace llarp
|
|
|
|
|
hop->terminal_hop = true;
|
|
|
|
|
// we are terminal hop and everything is okay
|
|
|
|
|
_router.path_context().PutTransitHop(hop);
|
|
|
|
|
m.respond(serialize_response({{messages::STATUS_KEY, PathBuildMessage::OK}}), false);
|
|
|
|
|
m.respond(messages::status::OK_RESPONSE, false);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1295,7 +1314,7 @@ namespace llarp
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Exception: {}", e.what());
|
|
|
|
|
m.respond(serialize_response({{messages::STATUS_KEY, PathBuildMessage::EXCEPTION}}), true);
|
|
|
|
|
m.respond(messages::status::ERROR_RESPONSE, true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1310,7 +1329,7 @@ namespace llarp
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Exception: {}", e.what());
|
|
|
|
|
// m.respond(serialize_response({{messages::STATUS_KEY, "EXCEPTION"}}), true);
|
|
|
|
|
// m.respond(serialize_response({{messages::status::STATUS_KEY, "EXCEPTION"}}), true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1325,7 +1344,7 @@ namespace llarp
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Exception: {}", e.what());
|
|
|
|
|
m.respond(serialize_response({{messages::STATUS_KEY, "EXCEPTION"}}), true);
|
|
|
|
|
m.respond(messages::status::ERROR_RESPONSE, true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1340,7 +1359,7 @@ namespace llarp
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Exception: {}", e.what());
|
|
|
|
|
// m.respond(serialize_response({{messages::STATUS_KEY, "EXCEPTION"}}), true);
|
|
|
|
|
// m.respond(serialize_response({{messages::status::STATUS_KEY, "EXCEPTION"}}), true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1355,7 +1374,7 @@ namespace llarp
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Exception: {}", e.what());
|
|
|
|
|
m.respond(serialize_response({{messages::STATUS_KEY, "EXCEPTION"}}), true);
|
|
|
|
|
m.respond(messages::status::ERROR_RESPONSE, true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1370,7 +1389,7 @@ namespace llarp
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Exception: {}", e.what());
|
|
|
|
|
// m.respond(serialize_response({{messages::STATUS_KEY, "EXCEPTION"}}), true);
|
|
|
|
|
// m.respond(serialize_response({{messages::status::STATUS_KEY, "EXCEPTION"}}), true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1385,7 +1404,7 @@ namespace llarp
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Exception: {}", e.what());
|
|
|
|
|
m.respond(serialize_response({{messages::STATUS_KEY, "EXCEPTION"}}), true);
|
|
|
|
|
m.respond(messages::status::ERROR_RESPONSE, true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1400,7 +1419,7 @@ namespace llarp
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Exception: {}", e.what());
|
|
|
|
|
m.respond(serialize_response({{messages::STATUS_KEY, "EXCEPTION"}}), true);
|
|
|
|
|
m.respond(messages::status::ERROR_RESPONSE, true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1439,7 +1458,7 @@ namespace llarp
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Exception: {}", e.what());
|
|
|
|
|
m.respond(serialize_response({{messages::STATUS_KEY, ObtainExitMessage::EXCEPTION}}), true);
|
|
|
|
|
m.respond(messages::status::ERROR_RESPONSE, true);
|
|
|
|
|
throw;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1508,7 +1527,8 @@ namespace llarp
|
|
|
|
|
(exit_ep->UpdateLocalPath(transit_hop->info.rxID))
|
|
|
|
|
? m.respond(UpdateExitMessage::sign_and_serialize_response(_router.identity(), tx_id))
|
|
|
|
|
: m.respond(
|
|
|
|
|
serialize_response({{messages::STATUS_KEY, UpdateExitMessage::UPDATE_FAILED}}),
|
|
|
|
|
serialize_response(
|
|
|
|
|
{{messages::status::STATUS_KEY, UpdateExitMessage::UPDATE_FAILED}}),
|
|
|
|
|
true);
|
|
|
|
|
}
|
|
|
|
|
// If we fail to verify the message, no-op
|
|
|
|
@ -1517,7 +1537,7 @@ namespace llarp
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Exception: {}", e.what());
|
|
|
|
|
m.respond(serialize_response({{messages::STATUS_KEY, UpdateExitMessage::EXCEPTION}}), true);
|
|
|
|
|
m.respond(messages::status::ERROR_RESPONSE, true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1597,12 +1617,13 @@ namespace llarp
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m.respond(
|
|
|
|
|
serialize_response({{messages::STATUS_KEY, CloseExitMessage::UPDATE_FAILED}}), true);
|
|
|
|
|
serialize_response({{messages::status::STATUS_KEY, CloseExitMessage::UPDATE_FAILED}}),
|
|
|
|
|
true);
|
|
|
|
|
}
|
|
|
|
|
catch (const std::exception& e)
|
|
|
|
|
{
|
|
|
|
|
log::warning(link_cat, "Exception: {}", e.what());
|
|
|
|
|
m.respond(serialize_response({{messages::STATUS_KEY, CloseExitMessage::EXCEPTION}}), true);
|
|
|
|
|
m.respond(messages::status::ERROR_RESPONSE, true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|