Compare commits

...

10 Commits

Author SHA1 Message Date
positron c57e041ba4 remove keyserver lookup functionality
11 months ago
positron bc43ac57c3 remove uses of no longer existing key blacklisting functionality
11 months ago
positron 6cb0c04f59 build system fix
11 months ago
positron 268e361f95 build system fix: make uninstall now does not break the source directory
11 months ago
Andreas Buff da52514547 removes -lsqlite3 from mac build. sqlite3 provided by pEpEngine is used now.
1 year ago
positron 4552cd23e0 build system: when linking with libetpan also link with libz
1 year ago
positron a22b847a37 LDLIBS: link with -ldl
1 year ago
Andreas Buff 62d5d17a41 Merge branch 'MACOSINST-26' into Release_2.1
2 years ago
Andreas Buff 41ae98b8c1 Merge branch 'Release_2.1' into MACOSINST-26
2 years ago
Andreas Buff 8736d445e5 MACOSINST-26 rm ASAN dependency, uses dynamic lib which we miust not and which causes crashes on several systems.
2 years ago

@ -114,12 +114,6 @@ Start Key Synchronization for the current session.
##### stopKeySync()
Stop Key Synchronization for the current session.
##### startKeyserverLookup()
Start a global thread for Keyserver Lookup. This thread handles all keyserver communication for all sessions.
##### stopKeyserverLookup()
Stop the global thread for Keyserver Lookup.
##### encrypt_message(Message src, StringList extra_keys, Message⇑ dst, PEP_enc_format enc_format, Integer flags)
encrypt message in memory
@ -749,12 +743,5 @@ JSON Adapter version etc.
##### version()
Returns a codename for the current JSON Server Adapter's version.
##### getGpgEnvironment()
Returns a struct holding 3 members
* gnupg_path
* gnupg_home environment variable, if set
* gpg_agent_info environment variable, if set.
##### shutdown()
shutdown the JSON Adapter

@ -22,8 +22,8 @@ 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)
LDLIBS+= -lpEpEngine -lpEpAdapter -lpEpwebserver -lasn1 \
-lsequoia_openpgp_ffi -lhogweed -lnettle -lgmp \
-lz -lsqlite3
-lsequoia_openpgp_ffi -ldl -lhogweed -lnettle -lgmp \
-lz
# Boost naming postfix
BOOST_MT?=-mt
@ -35,17 +35,13 @@ ifeq ($(BUILD_ON),Darwin)
ifeq ($(BUILD_FOR),Darwin)
LDLIBS+= -liconv -lobjc -framework Foundation -framework Security
LDLIBS+= -lboost_filesystem$(BOOST_MT) -lboost_program_options$(BOOST_MT) -lboost_system$(BOOST_MT) -lboost_thread$(BOOST_MT) -lboost_regex$(BOOST_MT)
# ASAN is not strictly a MacOS/clang feature, but won't work with musl.
CXXFLAGS+= -fsanitize=address
LDFLAGS+= -fsanitize=address
else
$(error I do not know how to make for $(BUILD_FOR) on $(BUILD_ON))
endif
else ifeq ($(BUILD_ON),Linux)
ifeq ($(BUILD_FOR),Linux)
LDLIBS+= -luuid \
-lboost_filesystem -lboost_program_options -lboost_system -lboost_thread -lboost_regex
-lboost_filesystem -lboost_program_options -lboost_system -lboost_thread -lboost_regex -lsqlite3 -ldl
else
$(error I do not know how to make for $(BUILD_FOR) on $(BUILD_ON))
@ -69,7 +65,7 @@ TARGET=pEp-mini-json-adapter
LIB_TARGET=libjson-adapter.a
ifeq ($(MIME_LIB),etpan)
LDLIBS+=-letpan
LDLIBS+=-letpan -lz
OMIT_NFC_SOURCE=
else ifeq ($(MIME_LIB),pEpMIME)
LDLIBS+=-lpEpMIME
@ -146,7 +142,7 @@ install: $(TARGET)
cp -v $(TARGET) $(DESTDIR)$(PREFIX)/bin/
uninstall:
rm -f $(DESTDIR)$(PREFIX)/include/pEP/$(wildcard *.hh)
rm -f $(addprefix $(DESTDIR)$(PREFIX)/include/pEp/,$(wildcard *.hh))
clean:
rm -vf *.a *.o */*.o *.d *.d.* $(TARGET) $(TESTS) encode_decode

@ -12,7 +12,6 @@
#include "server_version.hh"
#include <pEp/message_api.h>
#include <pEp/blacklist.h>
#include <pEp/key_reset.h>
#include <pEp/openpgp_compat.h>
#include <pEp/message_api.h> // for get_binary_path()
@ -186,10 +185,6 @@ const FunctionMap functions = {
FP( "key_expired" , new FuncPC<PEP_STATUS, In_Pep_Session, In<c_string>, In<time_t>, Out<bool>> ( &key_expired) ),
FP( "from blacklist.h & OpenPGP_compat.h", new Separator),
FP( "blacklist_add" , new FuncPC<PEP_STATUS, In_Pep_Session, In<c_string>> ( &blacklist_add) ),
FP( "blacklist_delete", new FuncPC<PEP_STATUS, In_Pep_Session, In<c_string>> ( &blacklist_delete) ),
FP( "blacklist_is_listed", new FuncPC<PEP_STATUS, In_Pep_Session, In<c_string>, Out<bool>> ( &blacklist_is_listed) ),
FP( "blacklist_retrieve" , new FuncPC<PEP_STATUS, In_Pep_Session, Out<stringlist_t*>> ( &blacklist_retrieve) ),
FP( "OpenPGP_list_keyinfo", new FuncPC<PEP_STATUS, In_Pep_Session, In<c_string>, Out<stringpair_list_t*>> ( &OpenPGP_list_keyinfo) ),
FP( "Event Listener & Results", new Separator ),

@ -2,38 +2,13 @@
#include "json-adapter.hh"
#include <thread>
#include <pEp/keymanagement.h>
#include <pEp/call_with_lock.hh>
#include <pEp/status_to_string.hh> // from libpEpAdapter.
#include <pEp/locked_queue.hh>
#include <pEp/Adapter.hh>
#include <pEp/callback_dispatcher.hh>
namespace pEp {
namespace mini {
typedef std::unique_ptr<std::thread> ThreadPtr;
// keyserver lookup
utility::locked_queue< pEp_identity*, &free_identity> keyserver_lookup_queue;
PEP_SESSION keyserver_lookup_session = nullptr; // FIXME: what if another adapter started it already?
ThreadPtr keyserver_lookup_thread;
int injectIdentity(pEp_identity* idy)
{
keyserver_lookup_queue.push_back(idy);
return 0;
}
pEp_identity* retrieveNextIdentity(void* /*userdata*/)
{
return keyserver_lookup_queue.pop_front();
}
struct dummy_t{};
dummy_t dummy{};
void startSync()
{
pEp::callback_dispatcher.start_sync();
@ -46,63 +21,6 @@ void stopSync()
}
void startKeyserverLookup()
{
if(keyserver_lookup_session)
throw std::runtime_error("KeyserverLookup already started.");
PEP_STATUS status = pEp::call_with_lock(&init, &keyserver_lookup_session, pEp::CallbackDispatcher::messageToSend, ::pEp::Adapter::_inject_sync_event, pEp::Adapter::_ensure_passphrase);
if(status != PEP_STATUS_OK || keyserver_lookup_session==nullptr)
{
throw std::runtime_error("Cannot create keyserver lookup session! status: " + ::pEp::status_to_string(status));
}
keyserver_lookup_queue.clear();
status = register_examine_function(keyserver_lookup_session,
examineIdentity,
&keyserver_lookup_session // nullptr is not accepted, so any dummy ptr is used here
);
if (status != PEP_STATUS_OK)
throw std::runtime_error("Cannot register keyserver lookup callbacks! status: " + ::pEp::status_to_string(status));
keyserver_lookup_thread.reset( new std::thread( &keyserverLookupThreadRoutine, &keyserver_lookup_session /* just a dummy */ ) );
}
void stopKeyserverLookup()
{
// No keyserver lookup session active
if(keyserver_lookup_session == nullptr)
return;
keyserver_lookup_queue.push_front(NULL);
keyserver_lookup_thread->join();
// there is no unregister_examine_callback() function. hum...
keyserver_lookup_queue.clear();
pEp::call_with_lock(&release, keyserver_lookup_session);
keyserver_lookup_session = nullptr;
}
int examineIdentity(pEp_identity* idy, void* obj)
{
// JsonAdapter* ja = static_cast<JsonAdapter*>(obj);
return injectIdentity(idy);
}
void* keyserverLookupThreadRoutine(void* arg)
{
PEP_STATUS status = do_keymanagement(
&retrieveNextIdentity,
arg); // does the whole work
keyserver_lookup_queue.clear();
return (void*) status;
}
Adapter& Adapter::createInstance()
{
return dynamic_cast<Adapter&>(JsonAdapter::createInstance( new Adapter() ));

@ -1,30 +1,16 @@
#ifndef MINI_ADAPTER_IMPL_HH
#define MINI_ADAPTER_IMPL_HH
#include <pEp/keymanagement.h>
#include <pEp/sync_api.h>
#include "json-adapter.hh"
#include <pEp/passphrase_cache.hh>
#include <pEp/Adapter.hh>
namespace pEp{
namespace mini {
int injectIdentity(pEp_identity* idy);
pEp_identity* retrieveNextIdentity( void* /*management*/);
void startSync();
void stopSync();
void startKeyserverLookup();
void stopKeyserverLookup();
int examineIdentity(pEp_identity* idy, void* obj);
void* keyserverLookupThreadRoutine(void* arg);
class Adapter : public JsonAdapter
{
public:

Loading…
Cancel
Save