Browse Source

ENGINE-398: Moved key_reset into its own files

generate_api
Krista Bennett 4 years ago
parent
commit
6e4456a1f1
9 changed files with 896 additions and 524 deletions
  1. +478
    -0
      src/key_reset.c
  2. +93
    -0
      src/key_reset.h
  3. +0
    -377
      src/message_api.c
  4. +0
    -86
      src/pEpEngine.c
  5. +0
    -61
      src/pEpEngine.h
  6. +2
    -0
      src/pEp_internal.h
  7. +87
    -0
      test/test_files/398_gabrielle_to_alice.eml
  8. +115
    -0
      test/test_files/398_reset_from_alice_to_bob.eml
  9. +121
    -0
      test/test_files/398_reset_from_alice_to_fenris.eml

+ 478
- 0
src/key_reset.c View File

@ -0,0 +1,478 @@
// This file is under GNU General Public License 3.0
// see LICENSE.txt
#include "pEp_internal.h"
#include "dynamic_api.h"
#include "message_api.h"
#include <string.h>
#include <stdlib.h>
PEP_STATUS has_key_reset_been_sent(
PEP_SESSION session,
const char* user_id,
const char* revoked_fpr,
bool* contacted)
{
assert(session);
assert(contacted);
assert(user_id);
assert(revoked_fpr);
assert(!EMPTYSTR(user_id));
if (!session || !contacted || EMPTYSTR(revoked_fpr) || EMPTYSTR(user_id))
return PEP_ILLEGAL_VALUE;
*contacted = false;
char* alias_default = NULL;
PEP_STATUS status = get_userid_alias_default(session, user_id, &alias_default);
if (status == PEP_CANNOT_FIND_ALIAS || EMPTYSTR(alias_default)) {
free(alias_default);
alias_default = strdup(user_id);
}
sqlite3_reset(session->was_id_for_revoke_contacted);
sqlite3_bind_text(session->was_id_for_revoke_contacted, 1, revoked_fpr, -1,
SQLITE_STATIC);
sqlite3_bind_text(session->was_id_for_revoke_contacted, 2, user_id, -1,
SQLITE_STATIC);
int result = sqlite3_step(session->was_id_for_revoke_contacted);
switch (result) {
case SQLITE_ROW: {
*contacted = (sqlite3_column_int(session->was_id_for_revoke_contacted, 0) != 0);
break;
}
default:
sqlite3_reset(session->was_id_for_revoke_contacted);
free(alias_default);
return PEP_UNKNOWN_DB_ERROR;
}
sqlite3_reset(session->was_id_for_revoke_contacted);
return PEP_STATUS_OK;
}
//static const char *sql_set_revoke_contact_as_notified =
// "insert or replace into revocation_contact_list(fpr, contact_id) values (?1, ?2) ;";
PEP_STATUS set_reset_contact_notified(
PEP_SESSION session,
const char* revoke_fpr,
const char* contact_id
)
{
PEP_STATUS status = PEP_STATUS_OK;
assert(session && !EMPTYSTR(revoke_fpr) && !EMPTYSTR(contact_id));
if (!session || EMPTYSTR(revoke_fpr) || EMPTYSTR(contact_id))
return PEP_ILLEGAL_VALUE;
sqlite3_reset(session->set_revoke_contact_as_notified);
sqlite3_bind_text(session->set_revoke_contact_as_notified, 1, revoke_fpr, -1,
SQLITE_STATIC);
sqlite3_bind_text(session->set_revoke_contact_as_notified, 2, contact_id, -1,
SQLITE_STATIC);
int result;
result = sqlite3_step(session->set_revoke_contact_as_notified);
switch (result) {
case SQLITE_DONE:
status = PEP_STATUS_OK;
break;
default:
status = PEP_UNKNOWN_DB_ERROR;
}
sqlite3_reset(session->set_revoke_contact_as_notified);
return status;
}
PEP_STATUS receive_key_reset(PEP_SESSION session,
message* reset_msg) {
if (!session || !reset_msg)
return PEP_ILLEGAL_VALUE;
pEp_identity* sender_id = reset_msg->from;
if (!sender_id)
return PEP_MALFORMED_KEY_RESET_MSG;
PEP_STATUS status = update_identity(session, sender_id);
if (!sender_id->user_id)
return PEP_UNKNOWN_ERROR;
if (is_me(session, sender_id))
return PEP_ILLEGAL_VALUE;
if (!reset_msg->longmsg || strncmp(reset_msg->longmsg, "OLD: ", 5) != 0)
return PEP_MALFORMED_KEY_RESET_MSG;
status = PEP_STATUS_OK;
char* old_fpr = NULL;
char* new_fpr = NULL;
stringlist_t* keylist = NULL;
pEp_identity* temp_ident = identity_dup(sender_id);
if (!temp_ident) {
status = PEP_OUT_OF_MEMORY;
goto pep_free;
}
char* rest = NULL;
char* p = strtok_r(reset_msg->longmsg, "\r\n", &rest);
if (!EMPTYSTR(p + 5))
old_fpr = strdup(p + 5);
else {
status = PEP_MALFORMED_KEY_RESET_MSG;
goto pep_free;
}
bool own_key = false;
status = is_own_key(session, old_fpr, &own_key);
if (own_key) {
// Nope, no one can make us our own default. If we want to do that,
// that's keysync, NOT key reset.
status = PEP_ILLEGAL_VALUE;
goto pep_free;
}
p = strtok_r(NULL, "\r\n", &rest);
if (strncmp(p, "NEW: ", 5) != 0 || EMPTYSTR(p + 5)) {
status = PEP_MALFORMED_KEY_RESET_MSG;
goto pep_free;
}
new_fpr = strdup(p + 5);
// Reset the original key
status = key_reset(session, old_fpr, temp_ident);
if (status != PEP_STATUS_OK)
goto pep_free;
status = find_keys(session, new_fpr, &keylist);
if (status != PEP_STATUS_OK)
goto pep_free;
if (!keylist) {
status = PEP_KEY_NOT_FOUND;
goto pep_free;
}
// alright, we've checked as best we can. Let's set that baby.
sender_id->fpr = new_fpr;
// This only sets as the default, does NOT TRUST IN ANY WAY
sender_id->comm_type = sender_id->comm_type & (~PEP_ct_confirmed);
status = set_identity(session, sender_id);
sender_id->fpr = NULL; // ownership for free
pep_free:
free_stringlist(keylist);
free(old_fpr);
free(new_fpr);
free_identity(temp_ident);
return status;
}
PEP_STATUS create_standalone_key_reset_message(PEP_SESSION session,
message** dst,
pEp_identity* recip,
const char* old_fpr,
const char* new_fpr) {
if (!dst || !recip->user_id || !recip->address)
return PEP_ILLEGAL_VALUE;
if (!old_fpr || !new_fpr)
return PEP_ILLEGAL_VALUE;
*dst = NULL;
// Get own identity user has corresponded with
pEp_identity* own_identity = NULL;
PEP_STATUS status = get_own_ident_for_contact_id(session,
recip,
&own_identity);
if (status != PEP_STATUS_OK)
return status;
message* reset_message = new_message(PEP_dir_outgoing);
reset_message->from = own_identity;
reset_message->to = new_identity_list(identity_dup(recip)); // ?
const char* oldtag = "OLD: ";
const char* newtag = "\nNEW: ";
const size_t taglens = 11;
size_t full_len = taglens + strlen(old_fpr) + strlen(new_fpr) + 2; // \n and \0
char* longmsg = calloc(full_len, 1);
strlcpy(longmsg, oldtag, full_len);
strlcat(longmsg, old_fpr, full_len);
strlcat(longmsg, newtag, full_len);
strlcat(longmsg, new_fpr, full_len);
strlcat(longmsg, "\n", full_len);
reset_message->longmsg = longmsg;
reset_message->shortmsg = strdup("Key reset");
message* output_msg = NULL;
status = encrypt_message(session, reset_message, NULL,
&output_msg, PEP_enc_PGP_MIME,
PEP_encrypt_flag_key_reset_only);
if (status == PEP_STATUS_OK)
*dst = output_msg;
free_message(reset_message);
return status;
}
PEP_STATUS send_key_reset_to_recents(PEP_SESSION session,
const char* old_fpr,
const char* new_fpr) {
assert(old_fpr);
assert(new_fpr);
assert(session);
assert(session->messageToSend || session->sync_session->messageToSend);
if (!session || !old_fpr || !new_fpr)
return PEP_ILLEGAL_VALUE;
messageToSend_t send_cb = send_cb = session->messageToSend;
void* sync_obj = session->sync_obj;
if (!send_cb) {
send_cb = session->sync_session->messageToSend;
sync_obj = session->sync_session->sync_obj;
}
if (!send_cb)
return PEP_SYNC_NO_MESSAGE_SEND_CALLBACK;
identity_list* recent_contacts = NULL;
message* reset_msg = NULL;
PEP_STATUS status = get_last_contacted(session, &recent_contacts);
if (status != PEP_STATUS_OK)
goto pep_free;
identity_list* curr_id_ptr = recent_contacts;
for (curr_id_ptr = recent_contacts; curr_id_ptr; curr_id_ptr = curr_id_ptr->next) {
pEp_identity* curr_id = curr_id_ptr->ident;
if (!curr_id)
break;
const char* user_id = curr_id->user_id;
// Should be impossible, but?
if (!user_id)
continue;
// Check if it's us - if so, pointless...
if (is_me(session, curr_id))
continue;
// Check if they've already been told - this shouldn't be the case, but...
bool contacted = false;
status = has_key_reset_been_sent(session, user_id, old_fpr, &contacted);
if (status != PEP_STATUS_OK)
goto pep_free;
if (contacted)
continue;
// if not, make em a message
reset_msg = NULL;
status = create_standalone_key_reset_message(session,
&reset_msg,
curr_id,
old_fpr,
new_fpr);
if (status == PEP_CANNOT_FIND_IDENTITY) { // this is ok, just means we never mailed them
status = PEP_STATUS_OK;
continue;
}
if (status != PEP_STATUS_OK) {
free(reset_msg);
goto pep_free;
}
// insert into queue
status = send_cb(sync_obj, reset_msg);
if (status != PEP_STATUS_OK) {
free(reset_msg);
goto pep_free;
}
// Put into notified DB
status = set_reset_contact_notified(session, old_fpr, user_id);
if (status != PEP_STATUS_OK)
goto pep_free;
}
pep_free:
free_identity_list(recent_contacts);
return status;
}
DYNAMIC_API PEP_STATUS key_reset(
PEP_SESSION session,
const char* key_id,
pEp_identity* ident
)
{
if (!session)
return PEP_ILLEGAL_VALUE;
PEP_STATUS status = PEP_STATUS_OK;
char* fpr_copy = NULL;
char* own_id = NULL;
char* new_key = NULL;
identity_list* key_idents = NULL;
stringlist_t* keys = NULL;
if (!EMPTYSTR(key_id)) {
fpr_copy = strdup(key_id);
if (!fpr_copy)
return PEP_OUT_OF_MEMORY;
}
if (!ident) {
// Get list of own identities
status = get_default_own_userid(session, &own_id);
if (status != PEP_STATUS_OK)
goto pep_free;
if (EMPTYSTR(fpr_copy)) {
status = get_all_keys_for_user(session, own_id, &keys);
if (status == PEP_STATUS_OK) {
stringlist_t* curr_key;
for (curr_key = keys; curr_key && curr_key->value; curr_key = curr_key->next) {
status = key_reset(session, curr_key->value, NULL);
if (status != PEP_STATUS_OK)
break;
}
}
goto pep_free;
} // otherwise, we have a specific fpr to process
// fpr_copy exists, so... let's go.
// Process own identities with this fpr
status = get_identities_by_main_key_id(session, fpr_copy, &key_idents);
if (status == PEP_STATUS_OK) {
// have ident list, or should
identity_list* curr_ident;
for (curr_ident = key_idents; curr_ident && curr_ident->ident;
curr_ident = curr_ident->next) {
pEp_identity* this_identity = curr_ident->ident;
status = key_reset(session, fpr_copy, this_identity);
if (status != PEP_STATUS_OK)
break;
}
}
goto pep_free;
}
else { // an identity was specified.
if (is_me(session, ident)) {
// FIXME: make sure this IS our fpr?
// If it got sent in with an empty fpr...
if (EMPTYSTR(fpr_copy)) {
//
// if (!EMPTYSTR(ident->fpr))
// fpr_copy = strdup(ident->fpr);
status = _myself(session, ident, false, true);
if (status == PEP_STATUS_OK && ident->fpr)
fpr_copy = strdup(ident->fpr);
else {
// last resort?
// Get list of own identities
char* own_id = NULL;
status = get_default_own_userid(session, &own_id);
if (status == PEP_STATUS_OK)
status = get_user_default_key(session, own_id, &fpr_copy);
if (status != PEP_STATUS_OK || EMPTYSTR(fpr_copy)) {
free(own_id);
return (status == PEP_STATUS_OK ? PEP_KEY_NOT_FOUND : status);
}
}
}
free(ident->fpr);
ident->fpr = fpr_copy;
// Create revocation
status = revoke_key(session, fpr_copy, NULL);
// generate new key
if (status == PEP_STATUS_OK) {
ident->fpr = NULL;
status = generate_keypair(session, ident);
}
if (status == PEP_STATUS_OK) {
new_key = strdup(ident->fpr);
status = set_own_key(session, ident, new_key);
}
// mistrust fpr from trust
ident->fpr = fpr_copy;
ident->comm_type = PEP_ct_mistrusted;
status = set_trust(session, ident);
ident->fpr = NULL;
// Done with old use of ident.
if (status == PEP_STATUS_OK) {
// Update fpr for outgoing
status = myself(session, ident);
}
if (status == PEP_STATUS_OK)
// cascade that mistrust for anyone using this key
status = mark_as_compromised(session, fpr_copy);
if (status == PEP_STATUS_OK)
status = remove_fpr_as_default(session, fpr_copy);
if (status == PEP_STATUS_OK)
status = add_mistrusted_key(session, fpr_copy);
// add to revocation list
if (status == PEP_STATUS_OK)
status = set_revoked(session, fpr_copy, new_key, time(NULL));
// for all active communication partners:
// active_send revocation
if (status == PEP_STATUS_OK)
status = send_key_reset_to_recents(session, fpr_copy, new_key);
}
else { // not is_me
// remove fpr from all identities
// remove fpr from all users
if (status == PEP_STATUS_OK)
status = remove_fpr_as_default(session, fpr_copy);
// delete key from DB
if (status == PEP_STATUS_OK) {};
// status = delete_keypair(session, fpr_copy);
// N.B. If this key is being replaced by something else, it
// is done outside of this function.
}
}
pep_free:
free(fpr_copy);
free(own_id);
free_identity_list(key_idents);
free_stringlist(keys);
free(new_key);
return status;
}

+ 93
- 0
src/key_reset.h View File

@ -0,0 +1,93 @@
// This file is under GNU General Public License 3.0
// see LICENSE.txt
#pragma once
#include "key_reset.h"
#include "pEpEngine.h"
#include "keymanagement.h"
#include "message.h"
#include "message_api.h"
#include "cryptotech.h"
#ifdef __cplusplus
extern "C" {
#endif
// FIXME: Proper docs!
// Algorithm:
//
// Key Reset trigger; either manually or in another protocol, parameter key (optional)
//
// if identity given:
//
// key reset for one identity
//
// else
//
// For identity in own identities
//
// key reset for one identitiy
//
// Key Reset for identity:
//
// if own identity:
//
// Create revocation
//
// add to revocation list
//
// mistrust fpr from trust
//
// Remove fpr from ALL identities
//
// Remove fpr from ALL users
//
// generate new key
//
// for all active communication partners:
//
// active_send revocation
//
// else
//
// remove fpr from all identities
//
// remove fpr from all users
//
// delete key from key ring
DYNAMIC_API PEP_STATUS key_reset(
PEP_SESSION session,
const char* fpr,
pEp_identity* ident
);
PEP_STATUS has_key_reset_been_sent(
PEP_SESSION session,
const char* user_id,
const char* revoked_fpr,
bool* contacted);
PEP_STATUS set_reset_contact_notified(
PEP_SESSION session,
const char* revoke_fpr,
const char* contact_id
);
PEP_STATUS receive_key_reset(PEP_SESSION session,
message* reset_msg);
PEP_STATUS create_standalone_key_reset_message(PEP_SESSION session,
message** dst,
pEp_identity* recip,
const char* old_fpr,
const char* new_fpr);
PEP_STATUS send_key_reset_to_recents(PEP_SESSION session,
const char* old_fpr,
const char* new_fpr);
#ifdef __cplusplus
}
#endif

+ 0
- 377
src/message_api.c View File

@ -1547,153 +1547,6 @@ void attach_own_key(PEP_SESSION session, message *msg)
free(revoked_fpr);
}
PEP_STATUS create_standalone_key_reset_message(PEP_SESSION session,
message** dst,
pEp_identity* recip,
const char* old_fpr,
const char* new_fpr) {
if (!dst || !recip->user_id || !recip->address)
return PEP_ILLEGAL_VALUE;
if (!old_fpr || !new_fpr)
return PEP_ILLEGAL_VALUE;
*dst = NULL;
// Get own identity user has corresponded with
pEp_identity* own_identity = NULL;
PEP_STATUS status = get_own_ident_for_contact_id(session,
recip,
&own_identity);
if (status != PEP_STATUS_OK)
return status;
message* reset_message = new_message(PEP_dir_outgoing);
reset_message->from = own_identity;
reset_message->to = new_identity_list(identity_dup(recip)); // ?
const char* oldtag = "OLD: ";
const char* newtag = "\nNEW: ";
const size_t taglens = 11;
size_t full_len = taglens + strlen(old_fpr) + strlen(new_fpr) + 2; // \n and \0
char* longmsg = calloc(full_len, 1);
strlcpy(longmsg, oldtag, full_len);
strlcat(longmsg, old_fpr, full_len);
strlcat(longmsg, newtag, full_len);
strlcat(longmsg, new_fpr, full_len);
strlcat(longmsg, "\n", full_len);
reset_message->longmsg = longmsg;
reset_message->shortmsg = strdup("Key reset");
message* output_msg = NULL;
status = encrypt_message(session, reset_message, NULL,
&output_msg, PEP_enc_PGP_MIME,
PEP_encrypt_flag_key_reset_only);
if (status == PEP_STATUS_OK)
*dst = output_msg;
free_message(reset_message);
return status;
}
PEP_STATUS send_key_reset_to_recents(PEP_SESSION session,
const char* old_fpr,
const char* new_fpr) {
assert(old_fpr);
assert(new_fpr);
assert(session);
assert(session->messageToSend || session->sync_session->messageToSend);
if (!session || !old_fpr || !new_fpr)
return PEP_ILLEGAL_VALUE;
messageToSend_t send_cb = send_cb = session->messageToSend;
void* sync_obj = session->sync_obj;
if (!send_cb) {
send_cb = session->sync_session->messageToSend;
sync_obj = session->sync_session->sync_obj;
}
if (!send_cb)
return PEP_SYNC_NO_MESSAGE_SEND_CALLBACK;
identity_list* recent_contacts = NULL;
message* reset_msg = NULL;
PEP_STATUS status = get_last_contacted(session, &recent_contacts);
if (status != PEP_STATUS_OK)
goto pep_free;
identity_list* curr_id_ptr = recent_contacts;
for (curr_id_ptr = recent_contacts; curr_id_ptr; curr_id_ptr = curr_id_ptr->next) {
pEp_identity* curr_id = curr_id_ptr->ident;
if (!curr_id)
break;
const char* user_id = curr_id->user_id;
// Should be impossible, but?
if (!user_id)
continue;
// Check if it's us - if so, pointless...
if (is_me(session, curr_id))
continue;
// Check if they've already been told - this shouldn't be the case, but...
bool contacted = false;
status = has_key_reset_been_sent(session, user_id, old_fpr, &contacted);
if (status != PEP_STATUS_OK)
goto pep_free;
if (contacted)
continue;
// if not, make em a message
reset_msg = NULL;
status = create_standalone_key_reset_message(session,
&reset_msg,
curr_id,
old_fpr,
new_fpr);
if (status == PEP_CANNOT_FIND_IDENTITY) { // this is ok, just means we never mailed them
status = PEP_STATUS_OK;
continue;
}
if (status != PEP_STATUS_OK) {
free(reset_msg);
goto pep_free;
}
// insert into queue
status = send_cb(sync_obj, reset_msg);
if (status != PEP_STATUS_OK) {
free(reset_msg);
goto pep_free;
}
// Put into notified DB
status = set_reset_contact_notified(session, old_fpr, user_id);
if (status != PEP_STATUS_OK)
goto pep_free;
}
pep_free:
free_identity_list(recent_contacts);
return status;
}
PEP_cryptotech determine_encryption_format(message *msg)
{
assert(msg);
@ -3290,86 +3143,6 @@ pep_free:
}
PEP_STATUS receive_key_reset(PEP_SESSION session,
message* reset_msg) {
if (!session || !reset_msg)
return PEP_ILLEGAL_VALUE;
pEp_identity* sender_id = reset_msg->from;
if (!sender_id)
return PEP_MALFORMED_KEY_RESET_MSG;
PEP_STATUS status = update_identity(session, sender_id);
if (!sender_id->user_id)
return PEP_UNKNOWN_ERROR;
// FIXME: We'll have to change this for lists!!!
if (is_me(session, sender_id)) // hrm...
return PEP_ILLEGAL_VALUE;
if (!reset_msg->longmsg || strncmp(reset_msg->longmsg, "OLD: ", 5) != 0)
return PEP_MALFORMED_KEY_RESET_MSG;
status = PEP_STATUS_OK;
char* old_fpr = NULL;
char* new_fpr = NULL;
stringlist_t* keylist = NULL;
pEp_identity* temp_ident = identity_dup(sender_id);
if (!temp_ident) {
status = PEP_OUT_OF_MEMORY;
goto pep_free;
}
char* rest = NULL;
char* p = strtok_r(reset_msg->longmsg, "\r\n", &rest);
if (!EMPTYSTR(p + 5))
old_fpr = strdup(p + 5);
else {
status = PEP_MALFORMED_KEY_RESET_MSG;
goto pep_free;
}
p = strtok_r(NULL, "\r\n", &rest);
if (strncmp(p, "NEW: ", 5) != 0 || EMPTYSTR(p + 5)) {
status = PEP_MALFORMED_KEY_RESET_MSG;
goto pep_free;
}
new_fpr = strdup(p + 5);
// Reset the original key
status = key_reset(session, old_fpr, temp_ident);
if (status != PEP_STATUS_OK)
goto pep_free;
status = find_keys(session, new_fpr, &keylist);
if (status != PEP_STATUS_OK)
goto pep_free;
if (!keylist) {
status = PEP_KEY_NOT_FOUND;
goto pep_free;
}
// alright, we've checked as best we can. Let's set that baby.
sender_id->fpr = new_fpr;
// This only sets as the default, does NOT TRUST IN ANY WAY
sender_id->comm_type = sender_id->comm_type & (~PEP_ct_confirmed);
status = set_identity(session, sender_id);
sender_id->fpr = NULL; // ownership for free
pep_free:
free_stringlist(keylist);
free(old_fpr);
free(new_fpr);
free_identity(temp_ident);
return status;
}
DYNAMIC_API PEP_STATUS _decrypt_message(
PEP_SESSION session,
message *src,
@ -3957,156 +3730,6 @@ DYNAMIC_API PEP_STATUS own_message_private_key_details(
return status;
}
DYNAMIC_API PEP_STATUS key_reset(
PEP_SESSION session,
const char* key_id,
pEp_identity* ident
)
{
if (!session)
return PEP_ILLEGAL_VALUE;
PEP_STATUS status = PEP_STATUS_OK;
char* fpr_copy = NULL;
char* own_id = NULL;
char* new_key = NULL;
identity_list* key_idents = NULL;
stringlist_t* keys = NULL;
if (!EMPTYSTR(key_id)) {
fpr_copy = strdup(key_id);
if (!fpr_copy)
return PEP_OUT_OF_MEMORY;
}
if (!ident) {
// Get list of own identities
status = get_default_own_userid(session, &own_id);
if (status != PEP_STATUS_OK)
goto pep_free;
if (EMPTYSTR(fpr_copy)) {
status = get_all_keys_for_user(session, own_id, &keys);
if (status == PEP_STATUS_OK) {
stringlist_t* curr_key;
for (curr_key = keys; curr_key && curr_key->value; curr_key = curr_key->next) {
status = key_reset(session, curr_key->value, NULL);
if (status != PEP_STATUS_OK)
break;
}
}
goto pep_free;
} // otherwise, we have a specific fpr to process
// fpr_copy exists, so... let's go.
// Process own identities with this fpr
status = get_identities_by_main_key_id(session, fpr_copy, &key_idents);
if (status == PEP_STATUS_OK) {
// have ident list, or should
identity_list* curr_ident;
for (curr_ident = key_idents; curr_ident && curr_ident->ident;
curr_ident = curr_ident->next) {
pEp_identity* this_identity = curr_ident->ident;
status = key_reset(session, fpr_copy, this_identity);
if (status != PEP_STATUS_OK)
break;
}
}
goto pep_free;
}
else { // an identity was specified.
if (is_me(session, ident)) {
// FIXME: make sure this IS our fpr?
// If it got sent in with an empty fpr...
if (EMPTYSTR(fpr_copy)) {
//
// if (!EMPTYSTR(ident->fpr))
// fpr_copy = strdup(ident->fpr);
status = _myself(session, ident, false, true);
if (status == PEP_STATUS_OK && ident->fpr)
fpr_copy = strdup(ident->fpr);
else {
// last resort?
// Get list of own identities
char* own_id = NULL;
status = get_default_own_userid(session, &own_id);
if (status == PEP_STATUS_OK)
status = get_user_default_key(session, own_id, &fpr_copy);
if (status != PEP_STATUS_OK || EMPTYSTR(fpr_copy)) {
free(own_id);
return (status == PEP_STATUS_OK ? PEP_KEY_NOT_FOUND : status);
}
}
}
free(ident->fpr);
ident->fpr = fpr_copy;
// Create revocation
status = revoke_key(session, fpr_copy, NULL);
// generate new key
if (status == PEP_STATUS_OK) {
ident->fpr = NULL;
status = generate_keypair(session, ident);
}
if (status == PEP_STATUS_OK) {
new_key = strdup(ident->fpr);
status = set_own_key(session, ident, new_key);
}
// mistrust fpr from trust
ident->fpr = fpr_copy;
ident->comm_type = PEP_ct_mistrusted;
status = set_trust(session, ident);
ident->fpr = NULL;
// Done with old use of ident.
if (status == PEP_STATUS_OK) {
// Update fpr for outgoing
status = myself(session, ident);
}
if (status == PEP_STATUS_OK)
// cascade that mistrust for anyone using this key
status = mark_as_compromised(session, fpr_copy);
if (status == PEP_STATUS_OK)
status = remove_fpr_as_default(session, fpr_copy);
if (status == PEP_STATUS_OK)
status = add_mistrusted_key(session, fpr_copy);
// add to revocation list
if (status == PEP_STATUS_OK)
status = set_revoked(session, fpr_copy, new_key, time(NULL));
// for all active communication partners:
// active_send revocation
if (status == PEP_STATUS_OK)
status = send_key_reset_to_recents(session, fpr_copy, new_key);
}
else { // not is_me
// remove fpr from all identities
// remove fpr from all users
if (status == PEP_STATUS_OK)
status = remove_fpr_as_default(session, fpr_copy);
// delete key from DB
if (status == PEP_STATUS_OK) {};
// status = delete_keypair(session, fpr_copy);
// N.B. If this key is being replaced by something else, it
// is done outside of this function.
}
}
pep_free:
free(fpr_copy);
free(own_id);
free_identity_list(key_idents);
free_stringlist(keys);
free(new_key);
return status;
}
// Note: if comm_type_determine is false, it generally means that
// we were unable to get key information for anyone in the list,
// likely because a key is missing.


+ 0
- 86
src/pEpEngine.c View File

@ -4366,92 +4366,6 @@ PEP_STATUS get_last_contacted(
}
PEP_STATUS has_key_reset_been_sent(
PEP_SESSION session,
const char* user_id,
const char* revoked_fpr,
bool* contacted)
{
assert(session);
assert(contacted);
assert(user_id);
assert(revoked_fpr);
assert(!EMPTYSTR(user_id));
if (!session || !contacted || EMPTYSTR(revoked_fpr) || EMPTYSTR(user_id))
return PEP_ILLEGAL_VALUE;
*contacted = false;
char* alias_default = NULL;
PEP_STATUS status = get_userid_alias_default(session, user_id, &alias_default);
if (status == PEP_CANNOT_FIND_ALIAS || EMPTYSTR(alias_default)) {
free(alias_default);
alias_default = strdup(user_id);
}
sqlite3_reset(session->was_id_for_revoke_contacted);
sqlite3_bind_text(session->was_id_for_revoke_contacted, 1, revoked_fpr, -1,
SQLITE_STATIC);
sqlite3_bind_text(session->was_id_for_revoke_contacted, 2, user_id, -1,
SQLITE_STATIC);
int result = sqlite3_step(session->was_id_for_revoke_contacted);
switch (result) {
case SQLITE_ROW: {
*contacted = (sqlite3_column_int(session->was_id_for_revoke_contacted, 0) != 0);
break;
}
default:
sqlite3_reset(session->was_id_for_revoke_contacted);
free(alias_default);
return PEP_UNKNOWN_DB_ERROR;
}
sqlite3_reset(session->was_id_for_revoke_contacted);
return PEP_STATUS_OK;
}
//static const char *sql_set_revoke_contact_as_notified =
// "insert or replace into revocation_contact_list(fpr, contact_id) values (?1, ?2) ;";
PEP_STATUS set_reset_contact_notified(
PEP_SESSION session,
const char* revoke_fpr,
const char* contact_id
)
{
PEP_STATUS status = PEP_STATUS_OK;
assert(session && !EMPTYSTR(revoke_fpr) && !EMPTYSTR(contact_id));
if (!session || EMPTYSTR(revoke_fpr) || EMPTYSTR(contact_id))
return PEP_ILLEGAL_VALUE;
sqlite3_reset(session->set_revoke_contact_as_notified);
sqlite3_bind_text(session->set_revoke_contact_as_notified, 1, revoke_fpr, -1,
SQLITE_STATIC);
sqlite3_bind_text(session->set_revoke_contact_as_notified, 2, contact_id, -1,
SQLITE_STATIC);
int result;
result = sqlite3_step(session->set_revoke_contact_as_notified);
switch (result) {
case SQLITE_DONE:
status = PEP_STATUS_OK;
break;
default:
status = PEP_UNKNOWN_DB_ERROR;
}
sqlite3_reset(session->set_revoke_contact_as_notified);
return status;
}
PEP_STATUS key_created(
PEP_SESSION session,
const char *fpr,


+ 0
- 61
src/pEpEngine.h View File

@ -1177,54 +1177,6 @@ DYNAMIC_API PEP_STATUS get_revoked(
uint64_t *revocation_date
);
// Algorithm:
//
// Key Reset trigger; either manually or in another protocol, parameter key (optional)
//
// if identity given:
//
// key reset for one identity
//
// else
//
// For identity in own identities
//
// key reset for one identitiy
//
// Key Reset for identity:
//
// if own identity:
//
// Create revocation
//
// add to revocation list
//
// mistrust fpr from trust
//
// Remove fpr from ALL identities
//
// Remove fpr from ALL users
//
// generate new key
//
// for all active communication partners:
//
// active_send revocation
//
// else
//
// remove fpr from all identities
//
// remove fpr from all users
//
// delete key from key ring
DYNAMIC_API PEP_STATUS key_reset(
PEP_SESSION session,
const char* fpr,
pEp_identity* ident
);
// key_created() - get creation date of a key
//
// parameters:
@ -1349,19 +1301,6 @@ PEP_STATUS get_last_contacted(
identity_list** id_list
);
PEP_STATUS has_key_reset_been_sent(
PEP_SESSION session,
const char* user_id,
const char* revoked_fpr,
bool* contacted);
PEP_STATUS set_reset_contact_notified(
PEP_SESSION session,
const char* revoke_fpr,
const char* contact_id
);
PEP_STATUS get_own_ident_for_contact_id(PEP_SESSION session,
const pEp_identity* contact,
pEp_identity** own_ident);


+ 2
- 0
src/pEp_internal.h View File

@ -108,6 +108,8 @@
#include "transport.h"
#include "sync.h"
#include "key_reset.h"
#define NOT_IMPLEMENTED assert(0); return PEP_UNKNOWN_ERROR;
struct _pEpSession;


+ 87
- 0
test/test_files/398_gabrielle_to_alice.eml View File

@ -0,0 +1,87 @@
Message-ID: <pEp.PEW827.18NQTABD97IHX.3E6116A3-906D-4DAD-8BDD-3381606B4302@pep-project.org>
From: Gabi <pep-test-gabrielle@pep-project.org>
To: Alice is tired of Bob <pep.test.alice@pep-project.org>
Subject: =?utf-8?Q?p=E2=89=A1p?=
X-pEp-Version: 2.0
MIME-Version: 1.0
Content-Type: multipart/encrypted; boundary="d39e5287be3847623f45c9767504e45";
protocol="application/pgp-encrypted"
--d39e5287be3847623f45c9767504e45
Content-Type: application/pgp-encrypted
Version: 1
--d39e5287be3847623f45c9767504e45
Content-Type: application/octet-stream
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="msg.asc"
-----BEGIN PGP MESSAGE-----
hQEMAyZOqBcoGwQcAQf/QDYBUnJ8ASNE+aEOr/gKS1My4WXVbyCMtjLDHu2Ag0Rt
a7OKZNfJePc0DzNDAkj8Fj2OXVEBLAnpoE0E+Rs3V/rKsFjkQ0JXpK8LdstR+yC0
rqvRj8ga5lDkJMUGezk/bEJvsvdWTRiCsNqDOgR7FKo05Ize9Ce9NfxYjMDQrYfA
QaHcgb9naKe7VV8PJn4dtRHxHz0ZalyT2cTx3tge4MPv775I6ZUnLv8po3FUjx23
PFbjQv3lsV5BrzdBwYhZDbYUY8L7J3FJcHsJB0xQtlCPShfq++pEmuccl7KdV8fv
1Y6sv/hQstyAeAaI7g/QHcpYoOLqZq5isxjhTjsIP4UBDANaAgXZcwg/TQEIAKRc
MRhs9M0X4pZKd/q0K1/A7ey7AwbtjiBKV96hUS7rl/kpxtQrdzUJimpfylhDInUw
JRjJcsMXWrupcEwKr5UoXGgS7XfP6+by9qQY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dbH71s3nvq8vjMEBQkMlhgyKz9vq/ZMf8lXHrkRd+3gUklbMDfy9YwabX
jq1+nbB6QCYZNcE2BEuwE2qv11PEoIjuRpP5oafg6ECjoRpyyH3vTUPYsKBSl/VD
JrzxvdRlrXPBOzkhug6WwlKnBnazuuQ135aiXT3NajiY2ftLG2y4IutrG/ttX39o
RH5IaaK+/fJMDMpc6BDueO27C4A1FfnF6SNLymh1b2hg8zVKeVUPctxiYNoHWC6F
6ihY
=/YtR
-----END PGP MESSAGE-----
--d39e5287be3847623f45c9767504e45--

+ 115
- 0
test/test_files/398_reset_from_alice_to_bob.eml View File

@ -0,0 +1,115 @@
From: Alice in Wonderland <pep.test.alice@pep-project.org>
To: Bob's Burgers <pep.test.bob@pep-project.org>
Subject: =?utf-8?Q?p=E2=89=A1p?=
X-pEp-Version: 2.0
MIME-Version: 1.0
Content-Type: multipart/encrypted; boundary="41fb875950ea35e61360a605caa7977";
protocol="application/pgp-encrypted"
--41fb875950ea35e61360a605caa7977
Content-Type: application/pgp-encrypted
Version: 1
--41fb875950ea35e61360a605caa7977
Content-Type: application/octet-stream
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="msg.asc"
-----BEGIN PGP MESSAGE-----
hQEMA5Jd4qLmEMkZAQf+OnDf3f/QjoHqkMz/WdWwu0Trr4uN1k1QpNXgZEl8VpAk
Jlj1Akv3ksKMgNVRkdPGOSu14PE/xG7YxDDtzu4e0ruw3uFPl462i0WNz7fOmEdZ
YnMpfn4fNMf+H7/sG5BvaUs/Vdto7uhZ1+ebgeIcwVfKwiOs7NEvGghiJUMOteo/
Jqki9TMytX9sb58tL8x5d/dKbXEewNs1jqt28DKjAP+TCa+F2APN3z86GWBqaRse
JMnw5kOqDXEuyQ2XKA+nlLbThxMZ/5y0+4r4YeKmDqJdcqmSwggLet0LROhZajlV
O+UgkmIEpqKkj5yjG1Aobl8i+RbDSgcN2EcPjG+dHoUBDAOK25E37BudTgEH/1aK
OKh53th8VkK0XSnWqb3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cUSdQ7fTQmUyJIqBlSKlBbmtld7bph8nht9kEZdsfN+G
aSmWYw7HRaCXoq+IqVJeFoykvC35dBX/X30BV1d0HrO3kgTS87Fdl/7nF0boO528
ICgsOg1vvjXDZLqEyHrjxMCHpZiCNBksnQ==
=0apO
-----END PGP MESSAGE-----
--41fb875950ea35e61360a605caa7977--

+ 121
- 0
test/test_files/398_reset_from_alice_to_fenris.eml View File

@ -0,0 +1,121 @@
Message-ID: <pEp.PEW17L.0RC7XPI9ZPB8X.97B39B40-10C2-404B-B8CC-54B79229F8FD@pep-project.org>
From: Alice in Wonderland <pep.test.alice@pep-project.org>
To: Fenris Leto Hawke <pep.test.fenris@thisstilldoesntwork.lu>
Subject: =?utf-8?Q?p=E2=89=A1p?=
X-pEp-Version: 2.0
MIME-Version: 1.0
Content-Type: multipart/encrypted; boundary="7e23a74c7397f0666f31d87d17b86a89";
protocol="application/pgp-encrypted"
--7e23a74c7397f0666f31d87d17b86a89
Content-Type: application/pgp-encrypted
Version: 1
--7e23a74c7397f0666f31d87d17b86a89
Content-Type: application/octet-stream
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="msg.asc"
-----BEGIN PGP MESSAGE-----
hQEMA5Jd4qLmEMkZAQgAj8cxagENLesYZm9tPxJWZv70pPUxrVbFG8U0of9V7Q+i
mypRO+/WoKg/fU7f1+JniBGb62ijwn8YuuZyxEch4TFQQrQ2u4BoJesy2nXr/JFM
wFLt+QcMwWbgAe9rmaPZ6E0TXpKFphz3Gz6wa6+21JNQiAlcUqv3UL7aNI8C7t0d
Oh0J9JxboAdJ2pi3AfDtaSb0vie6EcmEN+AeU3P+LnQlYyT9NK4AqaYGOgKa515e
NpCuogpAbnoRChlcRJGFlEBOJR1fuFKnY9VVpUppVQLSUm34BtIAIexsAfiiexXV
A/5XlqN4fzA/erFknlo/zl2jZGnsd5MVHZ5XClVeZIUBDAMSIv439cLEHAEH/RK1
OJ8G+vI+X9b4SZbcNrE6P1rnC6iZMqlIn+13fmn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