src/sync_actions.c
changeset 654 0aa96447e38f
parent 653 a9752fd8d54c
child 655 8413f45947e8
     1.1 --- a/src/sync_actions.c	Wed May 18 12:22:02 2016 +0200
     1.2 +++ b/src/sync_actions.c	Wed May 18 12:54:22 2016 +0200
     1.3 @@ -1,6 +1,7 @@
     1.4  // Actions for DeviceState state machine
     1.5  
     1.6  #include <assert.h>
     1.7 +#include "keymanagement.h"
     1.8  #include "sync_fsm.h"
     1.9  #include "map_asn1.h"
    1.10  #include "../asn.1/Beacon.h"
    1.11 @@ -35,9 +36,15 @@
    1.12      status = sequence_value(session, "DeviceGroup", &seq);
    1.13      if (status != PEP_STATUS_OK)
    1.14          goto error;
    1.15 +    msg->header.sequence = (long) seq;
    1.16  
    1.17 -    msg->header.sequence = seq;
    1.18 -
    1.19 +    pEp_identity *me = new_identity(NULL, NULL, NULL, NULL);
    1.20 +    if (!me)
    1.21 +        goto enomem;
    1.22 +    status = myself(session, me);
    1.23 +    if (status != PEP_STATUS_OK)
    1.24 +        goto error;
    1.25 +    
    1.26      return status;
    1.27  
    1.28  enomem:
    1.29 @@ -75,9 +82,15 @@
    1.30      status = sequence_value(session, "DeviceGroup", &seq);
    1.31      if (status != PEP_STATUS_OK)
    1.32          goto error;
    1.33 +    msg->header.sequence = (long) seq;
    1.34  
    1.35 -    msg->header.sequence = seq;
    1.36 -
    1.37 +    pEp_identity *me = new_identity(NULL, NULL, NULL, NULL);
    1.38 +    if (!me)
    1.39 +        goto enomem;
    1.40 +    status = myself(session, me);
    1.41 +    if (status != PEP_STATUS_OK)
    1.42 +        goto error;
    1.43 +    
    1.44      return status;
    1.45  
    1.46  enomem:
    1.47 @@ -208,9 +221,15 @@
    1.48      status = sequence_value(session, "DeviceGroup", &seq);
    1.49      if (status != PEP_STATUS_OK)
    1.50          goto error;
    1.51 +    msg->header.sequence = (long) seq;
    1.52  
    1.53 -    msg->header.sequence = seq;
    1.54 -
    1.55 +    pEp_identity *me = new_identity(NULL, NULL, NULL, NULL);
    1.56 +    if (!me)
    1.57 +        goto enomem;
    1.58 +    status = myself(session, me);
    1.59 +    if (status != PEP_STATUS_OK)
    1.60 +        goto error;
    1.61 +    
    1.62      return status;
    1.63  
    1.64  enomem: