Browse Source

ENGINE-462: we now always copy the recv from the src struct on decrypt, and sent if an inner message doesn't have this value

ENGINE-641
parent
commit
8ab6081161
2 changed files with 17 additions and 2 deletions
  1. +17
    -0
      src/message_api.c
  2. +0
    -2
      src/timestamp.c

+ 17
- 0
src/message_api.c View File

@ -3125,6 +3125,20 @@ static PEP_STATUS reconcile_identity_lists(identity_list* src_ids,
return status;
}
static PEP_STATUS reconcile_sent_and_recv_info(message* src, message* inner_message) {
PEP_STATUS status = PEP_STATUS_OK;
if (!src || !inner_message)
return PEP_ILLEGAL_VALUE;
if (!inner_message->sent)
inner_message->sent = timestamp_dup(src->sent);
// This will never be set otherwise, since it's a transport header on the outside
inner_message->recv = timestamp_dup(src->recv);
return PEP_STATUS_OK;
}
static PEP_STATUS reconcile_src_and_inner_messages(message* src,
message* inner_message) {
@ -3142,6 +3156,9 @@ static PEP_STATUS reconcile_src_and_inner_messages(message* src,
if (status == PEP_STATUS_OK && inner_message->bcc)
status = reconcile_identity_lists(src->bcc, inner_message->bcc);
if (status == PEP_STATUS_OK)
status = reconcile_sent_and_recv_info(src, inner_message);
return status;
// FIXME - are there any flags or anything else we need to be sure are carried?
}


+ 0
- 2
src/timestamp.c View File

@ -30,7 +30,6 @@ DYNAMIC_API void free_timestamp(timestamp *ts)
DYNAMIC_API timestamp * timestamp_dup(const timestamp *src)
{
assert(src);
if (!src)
return NULL;
@ -42,4 +41,3 @@ DYNAMIC_API timestamp * timestamp_dup(const timestamp *src)
memcpy(dst, src, sizeof(timestamp));
return dst;
}

Loading…
Cancel
Save