Browse Source

merge

extra_keys_add
parent
commit
91345e09fe
3 changed files with 26 additions and 13 deletions
  1. +2
    -2
      src/key_reset.c
  2. +8
    -0
      src/key_reset.h
  3. +16
    -11
      src/message_api.c

+ 2
- 2
src/key_reset.c View File

@ -184,7 +184,7 @@ static PEP_STATUS _generate_own_commandlist_msg(PEP_SESSION session,
}
static PEP_STATUS _generate_keyreset_command_message(PEP_SESSION session,
PEP_STATUS _generate_keyreset_command_message(PEP_SESSION session,
const pEp_identity* from_ident,
const pEp_identity* to_ident,
const char* old_fpr,
@ -747,7 +747,7 @@ PEP_STATUS send_key_reset_to_recents(PEP_SESSION session,
assert(old_fpr);
assert(new_fpr);
assert(session);
assert(session->messageToSend);
// assert(session->messageToSend); NO. Don't assert this, FFS.
if (!session || !old_fpr || !new_fpr)
return PEP_ILLEGAL_VALUE;


+ 8
- 0
src/key_reset.h View File

@ -168,6 +168,14 @@ PEP_STATUS send_key_reset_to_recents(PEP_SESSION session,
PEP_STATUS key_reset_commands_to_PER(const keyreset_command_list *command_list, char **cmds, size_t *size);
PEP_STATUS PER_to_key_reset_commands(const char *cmds, size_t size, keyreset_command_list **command_list);
PEP_STATUS _generate_keyreset_command_message(PEP_SESSION session,
const pEp_identity* from_ident,
const pEp_identity* to_ident,
const char* old_fpr,
const char* new_fpr,
bool is_private,
message** dst);
#ifdef __cplusplus
}
#endif

+ 16
- 11
src/message_api.c View File

@ -3819,7 +3819,9 @@ static PEP_STATUS _decrypt_message(
bool ignore_msg = false;
if (is_key_reset) {
if (inner_message->_sender_fpr) {
if (decrypt_status == PEP_VERIFY_SIGNER_KEY_REVOKED)
ignore_msg = true;
else if (inner_message->_sender_fpr) {
bool sender_key_is_me = false;
status = is_own_key(session, inner_message->_sender_fpr, &sender_key_is_me);
if (status != PEP_STATUS_OK && status != PEP_KEY_NOT_FOUND)
@ -3837,7 +3839,7 @@ static PEP_STATUS _decrypt_message(
}
}
else
ignore_msg = true;
ignore_msg = true;
}
if (!ignore_msg) {
@ -3852,17 +3854,20 @@ static PEP_STATUS _decrypt_message(
private_il);
if (status != PEP_STATUS_OK)
goto pEp_error;
}
}
else {
// Simply put, we bail. We should not be returning ANYTHERE here.
status = decrypt_status;
goto pEp_error;
}
if (is_key_reset) {
if (decrypt_status == PEP_DECRYPTED || decrypt_status == PEP_DECRYPTED_AND_VERIFIED) {
if (!ignore_msg) {
status = receive_key_reset(session,
inner_message);
if (status != PEP_STATUS_OK) {
free_message(inner_message);
goto pEp_error;
}
}
status = receive_key_reset(session,
inner_message);
if (status != PEP_STATUS_OK) {
free_message(inner_message);
goto pEp_error;
}
*flags |= PEP_decrypt_flag_consume;
calculated_src = msg = inner_message;
}


Loading…
Cancel
Save