From 476011d7744f8f19e425e6e50f61f92f958cd326 Mon Sep 17 00:00:00 2001 From: heck Date: Tue, 18 Aug 2020 21:57:06 +0200 Subject: [PATCH] use passphraseWrap() in CodeGen template too. --- ...oundation_pEp_jniadapter_AbstractEngine.cc | 1 - src/gen_cpp_Engine.ysl2 | 30 ++----------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/src/foundation_pEp_jniadapter_AbstractEngine.cc b/src/foundation_pEp_jniadapter_AbstractEngine.cc index e5714ba..624b233 100644 --- a/src/foundation_pEp_jniadapter_AbstractEngine.cc +++ b/src/foundation_pEp_jniadapter_AbstractEngine.cc @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include diff --git a/src/gen_cpp_Engine.ysl2 b/src/gen_cpp_Engine.ysl2 index d4e2e90..466e0db 100644 --- a/src/gen_cpp_Engine.ysl2 +++ b/src/gen_cpp_Engine.ysl2 @@ -9,6 +9,7 @@ tstylesheet { template "interface" document("foundation_pEp_jniadapter_{@name}.cc", "text") || + #include #include #include #include @@ -70,34 +71,7 @@ tstylesheet { choose { when "@cached = 'true'" { || - pEpLog("cached passphrase mode"); - bool retryAgain = false; - int maxRetries = 3; - int retryCount = 0; - PEP_STATUS status; - do { - // the actual target function - pEpLog("calling passphrase_cache.api(::«@name»())"); - status = passphrase_cache.api(::«@name»,session()`apply "parm", mode=call`); - pEpLog("PEP_STATUS:" << status); - 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)); - retryAgain = true; - retryCount++; - } else { - pEpLog("max retries reached:" << maxRetries); - retryAgain = false; - } - } else { - retryAgain = false; - } - } while (retryAgain); - + PEP_STATUS status = passphraseWrap(::«@name», session()`apply "parm", mode=call`); || } otherwise { ||