mirror of https://github.com/oxen-io/lokinet
Merge pull request #1972 from majestrate/happyify-ci-pipelin-2022-08-06
fix ci pipeline
This commit is contained in:
commit
9917daa84d
|
@ -6,13 +6,11 @@ if (BUILD_SHARED_LIBS OR NOT BUILD_STATIC_DEPS OR NOT STATIC_LINK)
|
|||
message(FATAL_ERROR "macOS builds require a full static build; perhaps use the contrib/macos.sh script to build?")
|
||||
endif()
|
||||
|
||||
# god made apple so that man may suffer
|
||||
|
||||
# god (steve jobs) made apple so that man may suffer
|
||||
find_library(FOUNDATION Foundation REQUIRED)
|
||||
find_library(NETEXT NetworkExtension REQUIRED)
|
||||
find_library(COREFOUNDATION CoreFoundation REQUIRED)
|
||||
|
||||
target_sources(lokinet-util PRIVATE apple_logger.cpp)
|
||||
target_link_libraries(lokinet-util PUBLIC ${FOUNDATION})
|
||||
|
||||
target_sources(lokinet-platform PRIVATE vpn_platform.cpp vpn_interface.cpp route_manager.cpp context_wrapper.cpp)
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
#include <llarp/net/ip_packet.hpp>
|
||||
#include <llarp/config/config.hpp>
|
||||
#include <llarp/util/fs.hpp>
|
||||
#include <llarp/util/logging/buffer.hpp>
|
||||
#include <uvw/loop.h>
|
||||
#include <llarp/util/logging/logger.hpp>
|
||||
#include <llarp/util/logging.hpp>
|
||||
#include <llarp/util/logging/buffer.hpp>
|
||||
#include <llarp/util/logging/callback_sink.hpp>
|
||||
#include "vpn_interface.hpp"
|
||||
#include "context_wrapper.h"
|
||||
|
@ -35,10 +35,11 @@ const uint16_t dns_trampoline_port = 1053;
|
|||
void*
|
||||
llarp_apple_init(llarp_apple_config* appleconf)
|
||||
{
|
||||
llarp::log::ReplaceLogger(std::make_shared<llarp::log::CallbackSink_mt>(
|
||||
llarp::log::clear_sinks();
|
||||
llarp::log::add_sink(std::make_shared<llarp::logging::CallbackSink_mt>(
|
||||
[](const char* msg, void* nslog) { reinterpret_cast<ns_logger_callback>(nslog)(msg); },
|
||||
nullptr,
|
||||
appleconf->ns_logger));
|
||||
reinterpret_cast<void*>(appleconf->ns_logger)));
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -57,8 +57,7 @@ namespace llarp
|
|||
llarp_dht_context* ctx, std::vector<std::unique_ptr<IMessage>>& replies) const
|
||||
{
|
||||
const auto now = ctx->impl->Now();
|
||||
const llarp::dht::Key_t addr(introset.derivedSigningKey);
|
||||
const auto keyStr = addr.ToHex();
|
||||
const llarp::dht::Key_t addr{introset.derivedSigningKey.data()};
|
||||
|
||||
auto router = ctx->impl->GetRouter();
|
||||
router->NotifyRouterEvent<tooling::PubIntroReceivedEvent>(
|
||||
|
@ -134,7 +133,7 @@ namespace llarp
|
|||
return true;
|
||||
}
|
||||
|
||||
llarp::LogInfo("Relaying PublishIntroMessage for ", keyStr, ", txid=", txID);
|
||||
llarp::LogInfo("Relaying PublishIntroMessage for ", addr, ", txid=", txID);
|
||||
|
||||
propagateIfNotUs(relayOrder);
|
||||
}
|
||||
|
@ -156,7 +155,7 @@ namespace llarp
|
|||
{
|
||||
LogInfo(
|
||||
"Received PubIntro for ",
|
||||
keyStr,
|
||||
addr,
|
||||
", txid=",
|
||||
txID,
|
||||
" and we are candidate ",
|
||||
|
@ -169,7 +168,7 @@ namespace llarp
|
|||
LogWarn(
|
||||
"!!! Received PubIntro with relayed==false but we aren't"
|
||||
" candidate, intro derived key: ",
|
||||
keyStr,
|
||||
addr,
|
||||
", txid=",
|
||||
txID,
|
||||
", message from: ",
|
||||
|
|
|
@ -209,7 +209,11 @@ namespace llarp
|
|||
bool
|
||||
SockAddr::operator<(const SockAddr& other) const
|
||||
{
|
||||
return (m_addr.sin6_addr.s6_addr < other.m_addr.sin6_addr.s6_addr);
|
||||
return memcmp(
|
||||
m_addr.sin6_addr.s6_addr,
|
||||
other.m_addr.sin6_addr.s6_addr,
|
||||
sizeof(m_addr.sin6_addr.s6_addr))
|
||||
< 0;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -73,23 +73,24 @@ TEST_CASE("test subkey derivation", "[crypto]")
|
|||
}};
|
||||
|
||||
SecretKey root{seed};
|
||||
CHECK(root.toPublic() == PubKey{root_pub_data});
|
||||
CHECK(root.toPublic().as_array() == root_pub_data.as_array());
|
||||
|
||||
PrivateKey root_key;
|
||||
CHECK(root.toPrivate(root_key));
|
||||
CHECK(root_key == PrivateKey{root_key_data});
|
||||
CHECK(root_key.as_array() == root_key_data.as_array());
|
||||
|
||||
auto crypto = CryptoManager::instance();
|
||||
|
||||
PrivateKey aprime; // a'
|
||||
CHECK(crypto->derive_subkey_private(aprime, root, 0, &hash));
|
||||
// We use a different signing hash than Tor, so only the private key value (the first 32 bytes)
|
||||
// will match:
|
||||
CHECK(aprime.ToHex().substr(0, 64) == PrivateKey{derived_key_data}.ToHex().substr(0, 64));
|
||||
|
||||
// We use a different signing hash than Tor
|
||||
// only the private key value (the first 32 bytes) will match:
|
||||
CHECK(std::memcmp(aprime.data(), derived_key_data.data(), 32) == 0);
|
||||
|
||||
PubKey Aprime; // A'
|
||||
CHECK(crypto->derive_subkey(Aprime, root.toPublic(), 0, &hash));
|
||||
CHECK(Aprime == PubKey{derived_pub_data});
|
||||
CHECK(Aprime.as_array() == derived_pub_data.as_array());
|
||||
}
|
||||
|
||||
TEST_CASE("test root key signing" , "[crypto]")
|
||||
|
|
Loading…
Reference in New Issue