Browse Source

allow default PEP_OWN_USERID in _myself()

trustsync
Volker Birk 2 years ago
parent
commit
de1bb2ad84
2 changed files with 15 additions and 6 deletions
  1. +11
    -3
      src/keymanagement.c
  2. +4
    -3
      src/message_api.c

+ 11
- 3
src/keymanagement.c View File

@ -1061,12 +1061,20 @@ PEP_STATUS _myself(PEP_SESSION session,
assert(session);
assert(identity);
assert(!EMPTYSTR(identity->address));
assert(!EMPTYSTR(identity->user_id));
if (!session || !identity || EMPTYSTR(identity->address) ||
EMPTYSTR(identity->user_id))
if (!session || EMPTYSTR(identity->address))
return PEP_ILLEGAL_VALUE;
// this is leading to crashes otherwise
if (!(identity->user_id && identity->user_id[0])) {
free(identity->user_id);
identity->user_id = strdup(PEP_OWN_USERID);
assert(identity->user_id);
if (!identity->user_id)
return PEP_OUT_OF_MEMORY;
}
pEp_identity *stored_identity = NULL;
char* revoked_fpr = NULL;
bool valid_key_found = false;


+ 4
- 3
src/message_api.c View File

@ -1314,11 +1314,12 @@ static PEP_comm_type _get_comm_type(
if (max_comm_type == PEP_ct_mistrusted)
return PEP_ct_mistrusted;
if (!is_me(session, ident))
if (!is_me(session, ident)) {
status = update_identity(session, ident);
else
// ???
}
else {
status = _myself(session, ident, false, false, true);
}
if (status == PEP_STATUS_OK) {
if (ident->comm_type == PEP_ct_compromised)


Loading…
Cancel
Save