trigger KeyGen sync
authorVolker Birk <vb@pep.foundation>
Thu, 23 Aug 2018 10:24:49 +0200
branchsync
changeset 2880fa5b054aa4b6
parent 2879 1b90ffed2d89
child 2881 26b451252f73
trigger KeyGen
src/pEpEngine.c
sync/gen_statemachine.ysl2
test/src/EngineTestSuite.cc
test/src/engine_tests/SyncTests.cc
     1.1 --- a/src/pEpEngine.c	Thu Aug 23 10:04:33 2018 +0200
     1.2 +++ b/src/pEpEngine.c	Thu Aug 23 10:24:49 2018 +0200
     1.3 @@ -6,6 +6,7 @@
     1.4  #include "cryptotech.h"
     1.5  #include "transport.h"
     1.6  #include "blacklist.h"
     1.7 +#include "KeySync_fsm.h"
     1.8  
     1.9  #include <time.h>
    1.10  #include <stdlib.h>
    1.11 @@ -3189,6 +3190,8 @@
    1.12      if (identity->fpr)
    1.13          status = set_pgp_keypair(session, identity->fpr);
    1.14  
    1.15 +    signal_Sync_event(session, Sync_PR_keysync, KeyGen);
    1.16 +
    1.17      // add to known keypair DB, as this might not end up being a default
    1.18      return status;
    1.19  }
     2.1 --- a/sync/gen_statemachine.ysl2	Thu Aug 23 10:04:33 2018 +0200
     2.2 +++ b/sync/gen_statemachine.ysl2	Thu Aug 23 10:24:49 2018 +0200
     2.3 @@ -178,7 +178,7 @@
     2.4                      int event
     2.5                  );
     2.6  
     2.7 -            PEP_STATUS inject_«@name»_event(
     2.8 +            PEP_STATUS signal_«@name»_event(
     2.9                      PEP_SESSION session, 
    2.10                      «@name»_PR fsm,
    2.11                      int event
    2.12 @@ -226,7 +226,7 @@
    2.13                  return PEP_STATUS_OK;
    2.14              }
    2.15  
    2.16 -            PEP_STATUS inject_«@name»_event(
    2.17 +            PEP_STATUS signal_«@name»_event(
    2.18                      PEP_SESSION session, 
    2.19                      «@name»_PR fsm,
    2.20                      int event
     3.1 --- a/test/src/EngineTestSuite.cc	Thu Aug 23 10:04:33 2018 +0200
     3.2 +++ b/test/src/EngineTestSuite.cc	Thu Aug 23 10:24:49 2018 +0200
     3.3 @@ -48,7 +48,7 @@
     3.4          struct stat buf;
     3.5  
     3.6          if (stat(test_home.c_str(), &buf) == 0) {
     3.7 -            cout << test_home << " exists. We'll recursively delete. We hope we're not horking your whole system..." << endl;
     3.8 +            cout << test_home << " exists. Deleting..." << endl;
     3.9              int success = nftw((test_home + "/.").c_str(), util_delete_filepath, 100, FTW_DEPTH);
    3.10          }
    3.11      }
     4.1 --- a/test/src/engine_tests/SyncTests.cc	Thu Aug 23 10:04:33 2018 +0200
     4.2 +++ b/test/src/engine_tests/SyncTests.cc	Thu Aug 23 10:24:49 2018 +0200
     4.3 @@ -35,6 +35,8 @@
     4.4  
     4.5      static int inject_sync_event(SYNC_EVENT ev, void *management)
     4.6      {
     4.7 +        Sync_event_t *_ev = ev;
     4.8 +        cout << "injecting event " << _ev->event << "\n";
     4.9          auto adapter = static_cast< Sync_Adapter *>(management);
    4.10          adapter->q.push_front(ev);
    4.11          return 0;