src/sync_actions.c
branchkeysync
changeset 954 a72e5c669833
parent 953 1572660086e7
child 959 c1c463ecf30c
     1.1 --- a/src/sync_actions.c	Sun Jul 31 21:03:27 2016 +0200
     1.2 +++ b/src/sync_actions.c	Sun Jul 31 21:25:22 2016 +0200
     1.3 @@ -208,7 +208,10 @@
     1.4      return status;
     1.5  }
     1.6  
     1.7 -static PEP_STATUS receive_sync_msg(PEP_SESSION session, DeviceGroup_Protocol_t *msg)
     1.8 +static PEP_STATUS receive_sync_msg(
     1.9 +        PEP_SESSION session,
    1.10 +        DeviceGroup_Protocol_t *msg
    1.11 +    )
    1.12  {
    1.13      assert(session && msg && msg->present != DeviceGroup_Protocol_PR_NOTHING);
    1.14      if (!(session && msg && msg->present != DeviceGroup_Protocol_PR_NOTHING))
    1.15 @@ -227,14 +230,16 @@
    1.16              break;
    1.17  
    1.18          case DeviceGroup_Protocol_PR_handshakeRequest:
    1.19 -            partner = Identity_to_Struct(&msg->choice.handshakeRequest.header.me, NULL);
    1.20 +            partner = Identity_to_Struct(
    1.21 +                    &msg->choice.handshakeRequest.header.me, NULL);
    1.22              if (!partner)
    1.23                  return PEP_OUT_OF_MEMORY;
    1.24              event = HandshakeRequest;
    1.25              break;
    1.26  
    1.27          case DeviceGroup_Protocol_PR_groupKeys:
    1.28 -            partner = Identity_to_Struct(&msg->choice.groupKeys.header.me, NULL);
    1.29 +            partner = Identity_to_Struct(&msg->choice.groupKeys.header.me,
    1.30 +                    NULL);
    1.31              if (!partner)
    1.32                  return PEP_OUT_OF_MEMORY;
    1.33              identity_list *group_keys = IdentityList_to_identity_list(
    1.34 @@ -265,10 +270,8 @@
    1.35      for (bloblist_t *bl = src->attachments; bl && bl->value; bl = bl->next) {
    1.36          if (bl->mime_type && strcasecmp(bl->mime_type, "application/pEp") == 0
    1.37                  && bl->size) {
    1.38 -            struct asn_codec_ctx_s opt_codec_ctx;
    1.39 -            memset(&opt_codec_ctx, 0, sizeof(opt_codec_ctx));
    1.40              DeviceGroup_Protocol_t *msg;
    1.41 -            uper_decode_complete(&opt_codec_ctx, &asn_DEF_DeviceGroup_Protocol,
    1.42 +            uper_decode_complete(NULL, &asn_DEF_DeviceGroup_Protocol,
    1.43                      (void **) &msg, bl->value, bl->size);
    1.44              if (msg) {
    1.45                  found = true;