Browse Source

_if_ we should throw here, we need to do it differently...

pull/2/head
heck 5 years ago
parent
commit
39f3b5fb45
  1. 27
      src/gen_cpp_Engine.ysl2

27
src/gen_cpp_Engine.ysl2

@ -68,8 +68,31 @@ tstylesheet {
choose {
when "@cached = 'true'" {
||
pEpLog("cached passphrase");
PEP_STATUS status = passphrase_cache.api(::«@name»,session()`apply "parm", mode=call`);
pEpLog("cached passphrase mode");
bool retryAfterCallback = false;
int maxRetries = 3;
int retryCount = 0;
PEP_STATUS status;
do {
// the actual target function
status = passphrase_cache.api(::«@name»,session()`apply "parm", mode=call`);
if(status == PEP_PASSPHRASE_REQUIRED || PEP_WRONG_PASSPHRASE ) {
pEpLog("PassReq OR Wrong");
// call the app
const char * _passphrase = "passphrase_alice";
PEP_STATUS status = ::config_passphrase(session(),passphrase_cache.add(_passphrase));
retryCount++;
if(retryCount > maxRetries) {
retryAfterCallback = false;
} else {
retryAfterCallback = true;
}
} else {
retryAfterCallback = false;
}
} while (retryAfterCallback);
||
} otherwise {
||

Loading…
Cancel
Save