From e1bcc578df7b996291606104d3f91a6cb84a3d13 Mon Sep 17 00:00:00 2001 From: heck Date: Tue, 30 Jun 2020 15:30:57 +0200 Subject: [PATCH 1/2] complete engine functions that have to be called with passphrase support - cache.api() --- src/pEp.yml2 | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/pEp.yml2 b/src/pEp.yml2 index 5ac43bd..dfa6cbe 100644 --- a/src/pEp.yml2 +++ b/src/pEp.yml2 @@ -191,7 +191,7 @@ namespace pEp { in bool full ); - method get_message_trustwords( + method cached=true get_message_trustwords( in message msg, in stringlist keylist, in identity receivedby, @@ -210,27 +210,17 @@ namespace pEp { in identity ident ); - // old key_reset function needs to be replaced -/* - method key_reset( - in string fpr, - in identity ident - ); -*/ - - // new key reset API - - method key_reset_identity( + method cached=true key_reset_identity( in identity ident, in string fpr ); - method key_reset_user( + method cached=true key_reset_user( in string userid, in string fpr ); - method key_reset_all_own_keys(); + method cached=true key_reset_all_own_keys(); method deliverHandshakeResult( in SyncHandshakeResult shr, @@ -243,7 +233,7 @@ namespace pEp { in identity ident ); - method disable_identity_for_sync( + method cached=true disable_identity_for_sync( in identity ident ); From 9858091cbcb834cc7ef27f48c24ed8e2d75b2e18 Mon Sep 17 00:00:00 2001 From: heck Date: Tue, 30 Jun 2020 16:02:40 +0200 Subject: [PATCH 2/2] remove debuglog --- src/basic_api.cc | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/basic_api.cc b/src/basic_api.cc index 08c46c7..ff3be92 100644 --- a/src/basic_api.cc +++ b/src/basic_api.cc @@ -463,17 +463,17 @@ JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_Engine__1getMachineD return from_string(env, ::per_machine_directory()); } -void logPassphraseCache() { - try { - while(true) { - pEpLog("Cache: '" << cache.latest_passphrase() << "'"); - } - } catch(pEp::PassphraseCache::Empty e) { - pEpLog(e.what()); - } catch(pEp::PassphraseCache::Exhausted ex) { - pEpLog(ex.what()); - } -} +//void logPassphraseCache() { +// try { +//// while(true) { +// pEpLog("Cache: '" << cache.latest_passphrase() << "'"); +//// } +// } catch(pEp::PassphraseCache::Empty e) { +// pEpLog(e.what()); +// } catch(pEp::PassphraseCache::Exhausted ex) { +// pEpLog(ex.what()); +// } +//} JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1passphrase (JNIEnv * env, @@ -488,7 +488,6 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1passphras } std::lock_guard l(*mutex_local); - logPassphraseCache(); char *_passphrase = to_string(env, passphrase); PEP_STATUS status = ::config_passphrase(session(),cache.add(_passphrase)); @@ -496,7 +495,6 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine__1config_1passphras throw_pEp_Exception(env, status); return; } - logPassphraseCache(); } } // extern "C"