merge keysync
authorEdouard Tisserant
Tue, 27 Sep 2016 21:58:54 +0200
branchkeysync
changeset 1204e0859bbaf844
parent 1203 c463238a1942
parent 1202 0d89f70f9e73
child 1205 73464cbee361
merge
     1.1 --- a/src/pgp_gpg.c	Tue Sep 27 21:51:55 2016 +0200
     1.2 +++ b/src/pgp_gpg.c	Tue Sep 27 21:58:54 2016 +0200
     1.3 @@ -1261,7 +1261,7 @@
     1.4      stringpair_list_t* list_curr = _keyinfo_list;
     1.5      stringpair_t* pair = NULL;
     1.6          
     1.7 -    do {
     1.8 +    do { 
     1.9          gpgme_error = gpg.gpgme_op_keylist_next(session->ctx, &key);
    1.10          gpgme_error = _GPGERR(gpgme_error);
    1.11        
    1.12 @@ -1277,9 +1277,9 @@
    1.13                  // first subkey is primary key
    1.14                  char* fpr = key->subkeys->fpr;
    1.15                  char* uid = key->uids->uid;
    1.16 -                
    1.17 +
    1.18                  assert(fpr);
    1.19 -                assert(uid); // ??
    1.20 +                assert(uid);
    1.21                  if (!fpr)
    1.22                      return PEP_GET_KEY_FAILED;
    1.23                  
     2.1 --- a/src/sync_fsm.h	Tue Sep 27 21:51:55 2016 +0200
     2.2 +++ b/src/sync_fsm.h	Tue Sep 27 21:58:54 2016 +0200
     2.3 @@ -86,14 +86,6 @@
     2.4          stringlist_t *keylist
     2.5      );
     2.6  
     2.7 -// event injector
     2.8 -
     2.9 -PEP_STATUS inject_DeviceState_event(
    2.10 -    PEP_SESSION session, 
    2.11 -    DeviceState_event event,
    2.12 -    Identity partner,
    2.13 -    void *extra);
    2.14 -
    2.15  // state machine
    2.16  
    2.17  DeviceState_state fsm_DeviceState(
     3.1 --- a/src/sync_send_actions.c	Tue Sep 27 21:51:55 2016 +0200
     3.2 +++ b/src/sync_send_actions.c	Tue Sep 27 21:58:54 2016 +0200
     3.3 @@ -19,7 +19,7 @@
     3.4  //  params:
     3.5  //      session (in)        session handle
     3.6  //      state (in)          state the state machine is in
     3.7 -//      partner (in)        partner to communicate with
     3.8 +//      partner (in)        (must be NULL)
     3.9  //
    3.10  //  returns:
    3.11  //      PEP_STATUS_OK or any other value on error
    3.12 @@ -47,11 +47,13 @@
    3.13          goto error;
    3.14  
    3.15      free_DeviceGroup_Protocol_msg(msg);
    3.16 +    free_identity(partner);
    3.17      return PEP_STATUS_OK;
    3.18  
    3.19  enomem:
    3.20      status = PEP_OUT_OF_MEMORY;
    3.21  error:
    3.22 +    free_identity(partner);
    3.23      free_DeviceGroup_Protocol_msg(msg);
    3.24      return status;
    3.25  }
    3.26 @@ -90,11 +92,13 @@
    3.27          goto error;
    3.28  
    3.29      free_DeviceGroup_Protocol_msg(msg);
    3.30 +    free_identity(partner);
    3.31      return PEP_STATUS_OK;
    3.32  
    3.33  enomem:
    3.34      status = PEP_OUT_OF_MEMORY;
    3.35  error:
    3.36 +    free_identity(partner);
    3.37      free_DeviceGroup_Protocol_msg(msg);
    3.38      return status;
    3.39  }
    3.40 @@ -141,11 +145,13 @@
    3.41  
    3.42      free_identity_list(kl);
    3.43      free_DeviceGroup_Protocol_msg(msg);
    3.44 +    free_identity(partner);
    3.45      return PEP_STATUS_OK;
    3.46  
    3.47  enomem:
    3.48      status = PEP_OUT_OF_MEMORY;
    3.49  error:
    3.50 +    free_identity(partner);
    3.51      free_DeviceGroup_Protocol_msg(msg);
    3.52      free_identity_list(kl);
    3.53      return status;
     4.1 --- a/test/Makefile	Tue Sep 27 21:51:55 2016 +0200
     4.2 +++ b/test/Makefile	Tue Sep 27 21:58:54 2016 +0200
     4.3 @@ -4,7 +4,7 @@
     4.4  CXX?=g++ -std=gnu++11 -pthread
     4.5  LD?=$(CXX)
     4.6  LDFLAGS?=-L$(HOME)/lib
     4.7 -LDLIBS?=-letpan -lpEpEngine -lstdc++ -L../asn.1 -lasn1
     4.8 +LDLIBS?=-letpan -lpEpEngine -lstdc++ -L../asn.1 -lasn1 -luuid
     4.9  CXXFLAGS?=-std=c++11 -g -O0 -I../src -I../asn.1
    4.10  # CXXFLAGS=-O3 -DNDEBUG
    4.11  
     5.1 --- a/test/sequence_test.cc	Tue Sep 27 21:51:55 2016 +0200
     5.2 +++ b/test/sequence_test.cc	Tue Sep 27 21:58:54 2016 +0200
     5.3 @@ -1,5 +1,6 @@
     5.4  #include <iostream>
     5.5  #include <string>
     5.6 +#include <cstring> // for std::strdup()
     5.7  #include <assert.h>
     5.8  #include "pEpEngine.h"
     5.9