Browse Source

ENGINE-129: update_identity now properly returns an ID with an empty fpr string when no key can be elected because none are in the keyring

doc_update_sequoia
Krista Grothoff 6 years ago
parent
commit
19f553d85a
1 changed files with 10 additions and 9 deletions
  1. +10
    -9
      src/keymanagement.c

+ 10
- 9
src/keymanagement.c View File

@ -24,7 +24,7 @@ PEP_STATUS elect_pubkey(
{
PEP_STATUS status;
stringlist_t *keylist;
char *_fpr = NULL;
char *_fpr = "";
identity->comm_type = PEP_ct_unknown;
status = find_keys(session, identity->address, &keylist);
@ -59,15 +59,16 @@ PEP_STATUS elect_pubkey(
}
}
if (_fpr) {
free(identity->fpr);
// if (_fpr) {
free(identity->fpr);
identity->fpr = strdup(_fpr);
if (identity->fpr == NULL) {
free_stringlist(keylist);
return PEP_OUT_OF_MEMORY;
}
identity->fpr = strdup(_fpr);
if (identity->fpr == NULL) {
free_stringlist(keylist);
return PEP_OUT_OF_MEMORY;
}
// }
free_stringlist(keylist);
return PEP_STATUS_OK;
}
@ -137,7 +138,7 @@ DYNAMIC_API PEP_STATUS update_identity(
bool dont_use_fpr = true;
/* if we have a stored_identity fpr */
if (!EMPTYSTR(stored_identity->fpr)) {
if (!EMPTYSTR(stored_identity->fpr) && !EMPTYSTR(temp_id->fpr)) {
status = blacklist_is_listed(session, stored_identity->fpr, &dont_use_fpr);
if (status != PEP_STATUS_OK)
dont_use_fpr = true;


Loading…
Cancel
Save