Browse Source

own_identities_retrieve() bullet proof

doc_update_sequoia
Volker Birk 6 years ago
parent
commit
91e5b7da91
3 changed files with 8 additions and 13 deletions
  1. +5
    -7
      src/keymanagement.c
  2. +2
    -2
      src/pEpEngine.c
  3. +1
    -4
      src/sync_impl.c

+ 5
- 7
src/keymanagement.c View File

@ -737,16 +737,14 @@ DYNAMIC_API PEP_STATUS own_identities_retrieve(
sqlite3_column_text(session->own_identities_retrieve, 0);
fpr = (const char *)
sqlite3_column_text(session->own_identities_retrieve, 1);
user_id = (const char *)
sqlite3_column_text(session->own_identities_retrieve, 2);
user_id = PEP_OWN_USERID;
username = (const char *)
sqlite3_column_text(session->own_identities_retrieve, 3);
comm_type = (PEP_comm_type)
sqlite3_column_int(session->own_key_is_listed, 4);
sqlite3_column_text(session->own_identities_retrieve, 2);
comm_type = PEP_ct_pEp;
lang = (const char *)
sqlite3_column_text(session->own_identities_retrieve, 5);
sqlite3_column_text(session->own_identities_retrieve, 3);
flags = (unsigned int)
sqlite3_column_int(session->own_key_is_listed, 6);
sqlite3_column_int(session->own_key_is_listed, 4);
pEp_identity *ident = new_identity(address, fpr, username, user_id);
ident->comm_type = comm_type;


+ 2
- 2
src/pEpEngine.c View File

@ -360,8 +360,8 @@ DYNAMIC_API PEP_STATUS init(PEP_SESSION *session)
" where main_key_id = upper(replace(?1,' ',''))"
" and user_id = '" PEP_OWN_USERID "' );";
sql_own_identities_retrieve = "select address, fpr, username, user_id,"
" comm_type, lang, identity.flags | pgp_keypair.flags"
sql_own_identities_retrieve = "select address, fpr, username, "
" lang, identity.flags | pgp_keypair.flags"
" from identity"
" join person on id = identity.user_id"
" join pgp_keypair on fpr = identity.main_key_id"


+ 1
- 4
src/sync_impl.c View File

@ -152,10 +152,7 @@ PEP_STATUS unicast_msg(
msg->header.state = (long) state;
me = new_identity(partner->address, NULL, PEP_OWN_USERID, NULL);
if (!me)
goto enomem;
status = myself(session, me);
status = get_identity(session, partner->address, PEP_OWN_USERID, &me);
if (status != PEP_STATUS_OK)
goto error;
if (Identity_from_Struct(me, &msg->header.me) == NULL)


Loading…
Cancel
Save