Browse Source

...

async_key_management
vb 7 years ago
parent
commit
6a6d2eb64f
4 changed files with 14 additions and 19 deletions
  1. +6
    -15
      src/keymanagement.c
  2. +4
    -4
      src/keymanagement.h
  3. +1
    -0
      src/pEpEngine.c
  4. +3
    -0
      src/pEpEngine.h

+ 6
- 15
src/keymanagement.c View File

@ -37,23 +37,14 @@ DYNAMIC_API PEP_STATUS update_identity(
if (status == PEP_OUT_OF_MEMORY)
return PEP_OUT_OF_MEMORY;
PEP_comm_type _comm_type_key;
status = get_key_rating(session, stored_identity->fpr, &_comm_type_key);
assert(status != PEP_OUT_OF_MEMORY);
if (status == PEP_OUT_OF_MEMORY)
return PEP_OUT_OF_MEMORY;
if (stored_identity) {
if (EMPTY(identity->fpr)) {
identity->comm_type = PEP_ct_unknown;
stringlist_t *keylist;
status = find_keys(session, stored_identity->fpr, &keylist);
assert(status != PEP_OUT_OF_MEMORY);
if (status == PEP_OUT_OF_MEMORY)
return PEP_OUT_OF_MEMORY;
if (keylist && keylist->value) {
identity->comm_type = stored_identity->comm_type;
}
free_stringlist(keylist);
identity->fpr = strdup(stored_identity->fpr);
assert(identity->fpr);
if (identity->fpr == NULL)


+ 4
- 4
src/keymanagement.h View File

@ -9,10 +9,10 @@ extern "C" {
// identity (inout) identity information of communication partner
//
// caveat:
// if this function returns PEP_ct_unknown in identity->comm_type, the
// caller must insert the identity into the asynchronous management
// implementation, so retrieve_next_identity() will return this identity
// later
// if this function returns PEP_ct_unknown or PEP_ct_key_expired in
// identity->comm_type, the caller must insert the identity into the
// asynchronous management implementation, so retrieve_next_identity()
// will return this identity later
// at least identity->address must be a valid UTF-8 string as input
DYNAMIC_API PEP_STATUS update_identity(


+ 1
- 0
src/pEpEngine.c View File

@ -2003,6 +2003,7 @@ DYNAMIC_API PEP_STATUS get_key_rating(
break;
case GPG_ERR_ENOMEM:
_session->gpgme_op_keylist_end(_session->ctx);
*comm_type = PEP_ct_unknown;
return PEP_OUT_OF_MEMORY;
default:
// BUG: GPGME returns an illegal value instead of GPG_ERR_EOF after


+ 3
- 0
src/pEpEngine.h View File

@ -612,6 +612,9 @@ DYNAMIC_API PEP_STATUS get_trust(PEP_SESSION session, pEp_identity *identity);
// session (in) session handle
// fpr (in) unique identifyer for key as UTF-8 string
// comm_type (out) key rating
//
// if an error occurs, *comm_type is set to PEP_ct_unknown and an error status
// is returned
DYNAMIC_API PEP_STATUS get_key_rating(
PEP_SESSION session,


Loading…
Cancel
Save