Merge branch 'Release_2.1' into MACOSINST-26

pull/2/head
Andreas Buff 2 years ago
commit c86b0ff086

2
.gitignore vendored

@ -26,6 +26,8 @@ build-windows/libevent/Release/*
build-windows/libevent/Debug/*
build-windows/pEpJSONServerAdapter/Release/*
build-windows/pEpJSONServerAdapter/Debug/*
build-windows/pEp/libpEpwebserver/Release/*
build-windows/pEp/libpEpwebserver/Debug/*
server/pEp-mini-json-adapter

@ -133,9 +133,9 @@
<ClCompile Include="..\..\server\inout.cc" />
<ClCompile Include="..\..\server\json-adapter.cc" />
<ClCompile Include="..\..\server\json_rpc.cc" />
<ClCompile Include="..\..\server\json_spirit\json_spirit_reader.cpp" />
<ClCompile Include="..\..\server\json_spirit\json_spirit_value.cpp" />
<ClCompile Include="..\..\server\json_spirit\json_spirit_writer.cpp" />
<ClCompile Include="..\..\server\json_spirit\json_spirit_reader.cc" />
<ClCompile Include="..\..\server\json_spirit\json_spirit_value.cc" />
<ClCompile Include="..\..\server\json_spirit\json_spirit_writer.cc" />
<ClCompile Include="..\..\server\logger.cc" />
<ClCompile Include="..\..\server\nfc.cc" />
<ClCompile Include="..\..\server\nfc_sets.cc" />

@ -161,13 +161,13 @@
<ClCompile Include="..\..\server\base64.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\server\json_spirit\json_spirit_reader.cpp">
<ClCompile Include="..\..\server\json_spirit\json_spirit_reader.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\server\json_spirit\json_spirit_value.cpp">
<ClCompile Include="..\..\server\json_spirit\json_spirit_value.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\server\json_spirit\json_spirit_writer.cpp">
<ClCompile Include="..\..\server\json_spirit\json_spirit_writer.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\server\prefix-config.cc">

@ -18,9 +18,6 @@ PEP_INCLUDE?=$(PREFIX)/include
# where libs from the packages systems are installed into:
LIBRARY_PATH?=/usr/local/lib
AR?=/usr/bin/ar
CC?=cc
CXX?=c++
CFLAGS+=-std=c14 -fvisibility=hidden
CXXFLAGS+= -I$(PEP_INCLUDE) -std=c++14 -fvisibility=hidden
LDFLAGS+=-std=c++14 -L$(PEP_LIB_PATH) -L$(LIBRARY_PATH)
@ -57,8 +54,9 @@ else
$(error I do not know how to make for $(BUILD_FOR) on $(BUILD_ON))
endif
ifdef NDEBUG
# DEBUG=0 -> release build
# DEBUG=1 or undefined -> debug build
ifeq ($(DEBUG),0)
CFLAGS+=-O3 -DNDEBUG
CXXFLAGS+=-O3 -DNDEBUG
else
@ -66,6 +64,7 @@ else
CXXFLAGS+=-O0 -g -DDEBUG_ENABLED
endif
TARGET=pEp-mini-json-adapter
LIB_TARGET=libjson-adapter.a
@ -82,7 +81,7 @@ else
endif
ALL_SOURCE=$(filter-out parse_mail.cc unittest_%.cc, $(wildcard *.cc))
ALL_SOURCE=$(filter-out parse_mail.cc unittest_%.cc servertest.cc, $(wildcard *.cc))
MA_SOURCE=$(wildcard mini-adapter-*.cc)
LIB_SOURCE=$(filter-out $(MA_SOURCE) $(OMIT_NFC_SOURCE), $(ALL_SOURCE))
@ -93,8 +92,8 @@ ALL_OBJECTS=$(subst .d,.o,$(DEPENDS))
LIB_OBJECTS=$(subst .cc,.o,$(LIB_SOURCE))
MA_OBJECTS=$(subst .cc,.o,$(MA_SOURCE))
SPIRIT_SOURCE=$(wildcard json_spirit/*.cpp)
SPIRIT_OBJECTS=$(subst .cpp,.o,$(SPIRIT_SOURCE))
SPIRIT_SOURCE=$(wildcard json_spirit/*.cc)
SPIRIT_OBJECTS=$(subst .cc,.o,$(SPIRIT_SOURCE))
TEST_SOURCE=$(wildcard unittest_*.cc)
TEST_OBJECTS=$(subst .cc,.o,$(TEST_SOURCE))
@ -117,9 +116,6 @@ endif
%.o: %.cc
$(CXX) $(CXXFLAGS) -c -o $@ $^
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $^
$(LIB_TARGET): $(LIB_OBJECTS)
$(AR) -cr $@ $^
@ -131,7 +127,7 @@ $(TARGET): $(LIB_TARGET) $(MA_OBJECTS) $(SPIRIT_OBJECTS)
unittests: $(TEST_OBJECTS) $(LIB_TARGET) $(SPIRIT_OBJECTS)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS) -lgtest
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS) -lgtest -lgtest_main
parse_mail: parse_mail.o nfc.o $(LIB_TARGET) $(SPIRIT_OBJECTS)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)

@ -143,6 +143,7 @@ const FunctionMap functions = {
FP( "config_cipher_suite", new FuncCache<void, In_Pep_Session, In<PEP_CIPHER_SUITE>>( "config_cipher_suite", &config_cipher_suite) ),
FP( "config_passphrase", new FuncCachePassphrase<void, In_Pep_Session, In<c_string>>( "config_passphrase" ) ),
FP( "config_passphrase_for_new_keys", new FuncCachePassphrase4NewKeys<void, In_Pep_Session, In<bool>, In<c_string>>( "config_passphrase4nk" ) ),
FP( "set_comm_partner_key", new FuncPC<PEP_STATUS, In_Pep_Session, InOut<pEp_identity*>, In<c_string>>( &set_comm_partner_key ) ),
FP( "Identity Management API", new Separator),
FP( "get_identity" , new FuncPC<PEP_STATUS, In_Pep_Session, In<c_string>, In<c_string>, Out<pEp_identity*>>( &get_identity) ),
@ -159,6 +160,7 @@ const FunctionMap functions = {
FP( "generate_keypair", new FuncPC<PEP_STATUS, In_Pep_Session, InOut<pEp_identity*>> ( &generate_keypair) ),
FP( "delete_keypair", new FuncPC<PEP_STATUS, In_Pep_Session, In<c_string>> ( &delete_keypair) ),
FP( "import_key" , new FuncPC<PEP_STATUS, In_Pep_Session, In<binary_string>, InLength<>, Out<identity_list*>> ( &import_key) ),
FP( "import_key_with_fpr_return", new FuncPC<PEP_STATUS, In_Pep_Session, In<binary_string>, InLength<>, Out<identity_list*>, Out<stringlist_t*>, Out<uint64_t>> ( &import_key_with_fpr_return) ),
FP( "export_key" , new FuncPC<PEP_STATUS, In_Pep_Session, In<c_string>, Out<char*>, Out<std::size_t>> ( &export_key) ),
FP( "find_keys" , new FuncPC<PEP_STATUS, In_Pep_Session, In<c_string>, Out<stringlist_t*>> ( &find_keys) ),
FP( "get_trust" , new FuncPC<PEP_STATUS, In_Pep_Session, InOut<pEp_identity*>> ( &get_trust) ),

@ -0,0 +1,21 @@
# This is an Example build config file (local.conf)
# you might not need this file, but if the defaults dont work for you
# You can override them here.
# Tweak the values to your needs and rename it to local.conf
######### C++ Compiler #########
# Should work with clang and g++
# CXX=g++
# You might use /usr/bin/ar on MacOS explicitly if you have GNU ar installed via HomeBrew,
# because it is installed in /usr/local/bin and therefore used by default.
# AR=ar
# DEBUG=1 # DEBUG Build (Default)
# DEBUG=0 # RELEASE Build
############# DIRS #############
# PREFIX=$(HOME)/local
# where the other pEp-specific includes (e.g. pEpEngine, libpEpAdapter) are installed
# PEP_INCLUDE=$(PREFIX)/include

@ -110,9 +110,10 @@ namespace LoggerS // namespace containing all data for the Logger singleton. HA
{
~LogfileCloser()
{
Lock LCK(LoggerS::mut);
if(LoggerS::logfile)
{
LoggerS::log(Logger::Debug, "Shutdown.");
// LoggerS::log(Logger::Debug, "Shutdown.");
fputs("---<shutdown>---\n", LoggerS::logfile);
fclose(LoggerS::logfile);
LoggerS::logfile = nullptr;

@ -79,8 +79,9 @@ static const std::string VersionName =
// "(45) Kreuz Erfurt"; // fix of context-saved function parameters that would cause trouble when >1 request is processed in parallel.
// "(46) Erfurt-West"; // JSON-156: delete client cached values after timeout.
// "(47a) Erfurt-Ost"; // JSON-160, JSON-172, JSON-179.
"(47b) Erfurt-Vieselbach"; // JSON-183: "Provide an API for pEp4Tb to communicate whether the message subject should be hidden (replaced with pEp)"
// "(47b) Erfurt-Vieselbach"; // JSON-183: "Provide an API for pEp4Tb to communicate whether the message subject should be hidden (replaced with pEp)"
"(48) Nohra"; // FPMAIL-412, P4TB-400: add import_key_with_fpr_return()
} // end of anonymous namespace
////////////////////////////////////////////////////////////////////////////
@ -118,7 +119,9 @@ const ServerVersion& server_version()
//static const ServerVersion sv(0,21,1); // wrap _all_ Engine functions with passphrase_cache.api(), except config_*() functions.
//static const ServerVersion sv(0,21,2); // JSON-165 the msg param of re_evaluate_message_rating() is now "inout" and not "in" any more
//static const ServerVersion sv(0,22,0); // JSON-183 "Provide an API for pEp4Tb to communicate whether the message subject should be hidden (replaced with pEp)"
static const ServerVersion sv(0,22,1); // ENGINE-890: add disable_all_sync_channels()
//static const ServerVersion sv(0,22,1); // ENGINE-890: add disable_all_sync_channels()
//static const ServerVersion sv(0,22,2); // JSON-194: add set_comm_partner_key()
static const ServerVersion sv(0,22,3); // FPMAIL-412, P4TB-400: add import_key_with_fpr_return()
return sv;
}

@ -49,7 +49,7 @@ class EncodeDecodeTest : public ::testing::Test
protected:
void SetUp() override
{
init(&session, &dummy_send, &dummy_inject);
init(&session, &dummy_send, &dummy_inject, &dummy_ensure_passphrase);
random_name = gen_random_name();
const std::string address = "encode-decode-test." + random_name + "@peptest.ch";
@ -83,7 +83,10 @@ protected:
static
PEP_STATUS dummy_send(struct _message*) { return PEP_STATUS_OK; }
static
PEP_STATUS dummy_ensure_passphrase(PEP_SESSION, const char* /* fpr */) { return PEP_STATUS_OK; }
PEP_SESSION session = nullptr;
std::string random_name;
pEp_identity* my_identity = nullptr;

Loading…
Cancel
Save