Merge with sync sequoia_windows
authorThomas
Fri, 14 Jun 2019 07:54:26 +0200
branchsequoia_windows
changeset 383397d3517be4a3
parent 3827 3030ae87f2f9
parent 3832 8860f25e9be9
child 3835 65f3c7d59eb1
Merge with sync
     1.1 --- a/src/baseprotocol.c	Tue Jun 11 08:00:44 2019 +0200
     1.2 +++ b/src/baseprotocol.c	Fri Jun 14 07:54:26 2019 +0200
     1.3 @@ -164,7 +164,7 @@
     1.4      char *_fpr = NULL;
     1.5      if (_sign) {
     1.6          status = verify_text(session, _payload, _payload_size, _sign, _sign_size, &keylist);
     1.7 -        if (status != PEP_VERIFIED || !keylist || !keylist->value) {
     1.8 +        if (!(status == PEP_VERIFIED || status == PEP_VERIFIED_AND_TRUSTED) || !keylist || !keylist->value) {
     1.9              // signature invalid or does not match; ignore sync message
    1.10              status = PEP_STATUS_OK;
    1.11              goto the_end;
    1.12 @@ -187,4 +187,3 @@
    1.13      free_stringlist(keylist);
    1.14      return status;
    1.15  }
    1.16 -
     2.1 --- a/src/message_api.c	Tue Jun 11 08:00:44 2019 +0200
     2.2 +++ b/src/message_api.c	Fri Jun 14 07:54:26 2019 +0200
     2.3 @@ -3125,6 +3125,20 @@
     2.4      return status;    
     2.5  }
     2.6  
     2.7 +static PEP_STATUS reconcile_sent_and_recv_info(message* src, message* inner_message) {
     2.8 +    PEP_STATUS status = PEP_STATUS_OK;
     2.9 +    if (!src || !inner_message)
    2.10 +        return PEP_ILLEGAL_VALUE;
    2.11 +        
    2.12 +    if (!inner_message->sent)
    2.13 +        inner_message->sent = timestamp_dup(src->sent);
    2.14 +        
    2.15 +    // This will never be set otherwise, since it's a transport header on the outside    
    2.16 +    inner_message->recv = timestamp_dup(src->recv);
    2.17 +    
    2.18 +    return PEP_STATUS_OK;
    2.19 +}
    2.20 +
    2.21  static PEP_STATUS reconcile_src_and_inner_messages(message* src, 
    2.22                                               message* inner_message) {
    2.23  
    2.24 @@ -3142,6 +3156,9 @@
    2.25      if (status == PEP_STATUS_OK && inner_message->bcc)
    2.26          status = reconcile_identity_lists(src->bcc, inner_message->bcc);
    2.27  
    2.28 +    if (status == PEP_STATUS_OK)
    2.29 +        status = reconcile_sent_and_recv_info(src, inner_message);
    2.30 +        
    2.31      return status;
    2.32      // FIXME - are there any flags or anything else we need to be sure are carried?
    2.33  }
     3.1 --- a/src/timestamp.c	Tue Jun 11 08:00:44 2019 +0200
     3.2 +++ b/src/timestamp.c	Fri Jun 14 07:54:26 2019 +0200
     3.3 @@ -30,7 +30,6 @@
     3.4  
     3.5  DYNAMIC_API timestamp * timestamp_dup(const timestamp *src)
     3.6  {
     3.7 -    assert(src);
     3.8      if (!src)
     3.9          return NULL;
    3.10  
    3.11 @@ -42,4 +41,3 @@
    3.12      memcpy(dst, src, sizeof(timestamp));
    3.13      return dst;
    3.14  }
    3.15 -