|
|
|
@ -152,14 +152,15 @@ DYNAMIC_API PEP_STATUS update_identity(
|
|
|
|
|
|
|
|
|
|
if (revoked) {
|
|
|
|
|
// Do stuff
|
|
|
|
|
status = change_key_comm_type(session, fpr, PEP_ct_key_revoked);
|
|
|
|
|
status = change_key_comm_type(session, stored_identity->fpr, PEP_ct_key_revoked);
|
|
|
|
|
// What to do on failure? FIXME
|
|
|
|
|
status = remove_key_as_id_default(session, fpr);
|
|
|
|
|
status = remove_key_as_id_default(session, stored_identity->fpr);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
status = blacklist_is_listed(session, stored_identity->fpr, &dont_use_stored_fpr);
|
|
|
|
|
if (status != PEP_STATUS_OK)
|
|
|
|
|
dont_use_stored_fpr = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
status = blacklist_is_listed(session, stored_identity->fpr, &dont_use_stored_fpr);
|
|
|
|
|
if (status != PEP_STATUS_OK)
|
|
|
|
|
dont_use_stored_fpr = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1062,7 +1063,7 @@ PEP_STATUS contains_priv_key(PEP_SESSION session, const char *fpr,
|
|
|
|
|
return session->cryptotech[PEP_crypt_OpenPGP].contains_priv_key(session, fpr, has_private);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static PEP_STATUS change_key_comm_type(PEP_SESSION session,
|
|
|
|
|
PEP_STATUS change_key_comm_type(PEP_SESSION session,
|
|
|
|
|
const char* fpr,
|
|
|
|
|
PEP_comm_type comm_type) {
|
|
|
|
|
|
|
|
|
@ -1076,7 +1077,7 @@ static PEP_STATUS change_key_comm_type(PEP_SESSION session,
|
|
|
|
|
return status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!user_id_list || !user_id_list->value())
|
|
|
|
|
if (!user_id_list || !user_id_list->value)
|
|
|
|
|
return PEP_KEY_NOT_FOUND;
|
|
|
|
|
|
|
|
|
|
stringlist_t* curr_id = user_id_list;
|
|
|
|
@ -1093,12 +1094,12 @@ static PEP_STATUS change_key_comm_type(PEP_SESSION session,
|
|
|
|
|
return PEP_STATUS_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static PEP_STATUS remove_key_as_id_default(PEP_SESSIONS session,
|
|
|
|
|
PEP_STATUS remove_key_as_id_default(PEP_SESSION session,
|
|
|
|
|
const char* fpr)
|
|
|
|
|
{
|
|
|
|
|
identity_list* affected_ids = NULL;
|
|
|
|
|
|
|
|
|
|
PEP_STATUS status get_identities_by_fpr(session, fpr, &identity_list);
|
|
|
|
|
PEP_STATUS status = get_identities_by_fpr(session, fpr, &affected_ids);
|
|
|
|
|
|
|
|
|
|
if (status != PEP_STATUS_OK) {
|
|
|
|
|
free_identity_list(affected_ids);
|
|
|
|
@ -1112,9 +1113,9 @@ static PEP_STATUS remove_key_as_id_default(PEP_SESSIONS session,
|
|
|
|
|
status = PEP_STATUS_OK;
|
|
|
|
|
|
|
|
|
|
while (curr_identity) {
|
|
|
|
|
free(curr_identity->fpr);
|
|
|
|
|
curr_identity->fpr = (char*)calloc(1, sizeof(char)); // ""
|
|
|
|
|
status = set_identity(session, curr_identity);
|
|
|
|
|
free(curr_identity->ident->fpr);
|
|
|
|
|
curr_identity->ident->fpr = (char*)calloc(1, sizeof(char)); // ""
|
|
|
|
|
status = set_identity(session, curr_identity->ident);
|
|
|
|
|
if (status != PEP_STATUS_OK)
|
|
|
|
|
goto the_end;
|
|
|
|
|
curr_identity = curr_identity->next;
|
|
|
|
|