Browse Source

just cosmetics

JNI-114
heck 2 years ago
parent
commit
5f85c064a1
4 changed files with 12 additions and 12 deletions
  1. +1
    -0
      .hgignore
  2. +1
    -1
      src/foundation_pEp_jniadapter_AbstractEngine.cc
  3. +4
    -5
      src/passphrase_callback.hh
  4. +6
    -6
      src/passphrase_callback.hxx

+ 1
- 0
.hgignore View File

@ -39,6 +39,7 @@ IdentityFlags.java
SyncHandshakeSignal.java
CipherSuite.java
passphrase_status_list.yml2
status_list.yml2
ndk*/


+ 1
- 1
src/foundation_pEp_jniadapter_AbstractEngine.cc View File

@ -131,7 +131,7 @@ char* JNIAdapter::passphraseRequiredCallback(const PEP_STATUS status) {
status_ = element;
break;
}
JNISync::env() -> DeleteLocalRef(element);
JNISync::env()->DeleteLocalRef(element);
}
}
assert(objj && passphraseRequiredMethodID);


+ 4
- 5
src/passphrase_callback.hh View File

@ -5,11 +5,10 @@
namespace pEp {
namespace JNIAdapter {
char* passphraseRequiredCallback(const PEP_STATUS status);
char* passphraseRequiredCallback(const PEP_STATUS status);
template<typename... A> PEP_STATUS passphraseWrap(
PEP_STATUS f(PEP_SESSION, A...), PEP_SESSION session, A... a);
};
};
template<typename... A> PEP_STATUS passphraseWrap(PEP_STATUS f(PEP_SESSION, A...), PEP_SESSION session, A... a);
}
}
#include "passphrase_callback.hxx"

+ 6
- 6
src/passphrase_callback.hxx View File

@ -5,8 +5,7 @@
namespace pEp {
namespace JNIAdapter {
template<typename... A> PEP_STATUS passphraseWrap(
PEP_STATUS f(PEP_SESSION, A...), PEP_SESSION session, A... a) {
template<typename... A> PEP_STATUS passphraseWrap(PEP_STATUS f(PEP_SESSION, A...), PEP_SESSION session, A... a) {
pEpLog("cached passphrase mode");
bool retryAgain = false;
int maxRetries = 3;
@ -17,15 +16,16 @@ namespace pEp {
pEpLog("calling passphrase_cache.api from basic_api");
status = passphrase_cache.api(f, session, a...);
pEpLog("PEP_STATUS:" << status);
if (status == PEP_PASSPHRASE_REQUIRED || status == PEP_WRONG_PASSPHRASE
|| status == PEP_PASSPHRASE_FOR_NEW_KEYS_REQUIRED) {
if (status == PEP_PASSPHRASE_REQUIRED ||
status == PEP_WRONG_PASSPHRASE ||
status == PEP_PASSPHRASE_FOR_NEW_KEYS_REQUIRED)
{
pEpLog("none of the cached passphrases worked");
if (retryCount < maxRetries) {
// call the app
char *_passphrase = passphraseRequiredCallback(status);
pEpLog("callback returned, config_passphrase() with new passphrase");
PEP_STATUS status = ::config_passphrase(session,
passphrase_cache.add(_passphrase));
PEP_STATUS status = ::config_passphrase(session, passphrase_cache.add(_passphrase));
retryAgain = true;
retryCount++;
} else {


Loading…
Cancel
Save