merge sync
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Wed, 29 May 2019 09:59:52 +0200
branchsync
changeset 37632098edd0c4d7
parent 3762 55501092d6e3
parent 3760 0fb3c0079c5a
child 3765 6e0ded701a54
merge
     1.1 --- a/src/message_api.c	Wed May 29 09:59:00 2019 +0200
     1.2 +++ b/src/message_api.c	Wed May 29 09:59:52 2019 +0200
     1.3 @@ -1572,7 +1572,7 @@
     1.4  PEP_STATUS _attach_key(PEP_SESSION session, const char* fpr, message *msg)
     1.5  {
     1.6      char *keydata = NULL;
     1.7 -    size_t size;
     1.8 +    size_t size = 0;
     1.9  
    1.10      PEP_STATUS status = export_key(session, fpr, &keydata, &size);
    1.11      assert(status == PEP_STATUS_OK);
    1.12 @@ -1580,7 +1580,7 @@
    1.13          return status;
    1.14      assert(size);
    1.15  
    1.16 -     bloblist_t *bl = bloblist_add(msg->attachments, keydata, size, "application/pgp-keys",
    1.17 +    bloblist_t *bl = bloblist_add(msg->attachments, keydata, size, "application/pgp-keys",
    1.18                        "file://pEpkey.asc");
    1.19  
    1.20      if (msg->attachments == NULL && bl)
    1.21 @@ -3898,8 +3898,8 @@
    1.22          if (!tmpstatus && size && data) {
    1.23              if (sync_fpr)
    1.24                  signal_Sync_message(session, *rating, data, size, msg->from, sync_fpr);
    1.25 -            else
    1.26 -                signal_Sync_message(session, *rating, data, size, msg->from, NULL);
    1.27 +            else if (*keylist)
    1.28 +                signal_Sync_message(session, *rating, data, size, msg->from, (*keylist)->value);
    1.29          }
    1.30          free(sync_fpr);
    1.31      }
     2.1 --- a/src/pgp_sequoia.c	Wed May 29 09:59:00 2019 +0200
     2.2 +++ b/src/pgp_sequoia.c	Wed May 29 09:59:52 2019 +0200
     2.3 @@ -2096,6 +2096,8 @@
     2.4      if (tpk)
     2.5          pgp_tpk_free(tpk);
     2.6  
     2.7 +    (*size)--;  // Sequoia is delivering the 0 byte at the end with size, but
     2.8 +                // pEp is expecting it without
     2.9      T("(%s) -> %s", fpr, pEp_status_to_string(status));
    2.10      return status;
    2.11  }
    2.12 @@ -2405,7 +2407,7 @@
    2.13      if (tpk)
    2.14          pgp_tpk_free(tpk);
    2.15  
    2.16 -    T("(%s) -> %s", fpr, pep_comm_type_to_string(*comm_type));
    2.17 +    T("(%s) -> %s", fpr, pEp_comm_type_to_string(*comm_type));
    2.18      return status;
    2.19  }
    2.20  
     3.1 --- a/sync/gen_statemachine.ysl2	Wed May 29 09:59:00 2019 +0200
     3.2 +++ b/sync/gen_statemachine.ysl2	Wed May 29 09:59:52 2019 +0200
     3.3 @@ -335,6 +335,13 @@
     3.4                  if (!(session && data && size))
     3.5                      return PEP_ILLEGAL_VALUE;
     3.6  
     3.7 +                // FIXME: this will go wrong if MAC is used instead of Signature
     3.8 +                if (from && from->fpr && signature_fpr) {
     3.9 +                    // ignore own messages
    3.10 +                    if (strcmp(from->fpr, signature_fpr) == 0)
    3.11 +                        return PEP_STATUS_OK;
    3.12 +                }
    3.13 +
    3.14                  if (!session->inject_«yml:lcase(@name)»_event)
    3.15                     return PEP_«yml:ucase(@name)»_NO_INJECT_CALLBACK;
    3.16