Intermittent commit - changing list_keys signature, starting alterations to add management db ids to the mix ENGINE-73
authorKrista Grothoff <krista@pep-project.org>
Wed, 17 Aug 2016 12:27:44 +0200
branchENGINE-73
changeset 10295b6af5b14d3a
parent 1023 fbaab7b6d87b
child 1030 4354451338cd
Intermittent commit - changing list_keys signature, starting alterations to add management db ids to the mix
src/pEpEngine.c
src/pEpEngine.h
     1.1 --- a/src/pEpEngine.c	Tue Aug 16 16:41:23 2016 +0200
     1.2 +++ b/src/pEpEngine.c	Wed Aug 17 12:27:44 2016 +0200
     1.3 @@ -1235,7 +1235,7 @@
     1.4  }
     1.5  
     1.6  DYNAMIC_API PEP_STATUS list_keys(
     1.7 -        PEP_SESSION session, identity_list** id_list
     1.8 +        PEP_SESSION session, identity_list** id_list, bool db_only, bool show_revoked
     1.9      )
    1.10  {
    1.11      assert(session);
    1.12 @@ -1244,7 +1244,24 @@
    1.13      if (!(session && id_list))
    1.14          return PEP_ILLEGAL_VALUE;
    1.15  
    1.16 -    return session->cryptotech[PEP_crypt_OpenPGP].list_keys(session, id_list);
    1.17 +    identity_list* _id_list = new_identity_list(NULL);
    1.18 +    
    1.19 +    PEP_STATUS retval = PEP_KEY_NOT_FOUND;
    1.20 +    
    1.21 +    // FIXME: do management DB stuff here
    1.22 +    
    1.23 +    identity_list* _keyring_ids = NULL;
    1.24 +    if (!db_only) {
    1.25 +        PEP_STATUS extra_status = session->cryptotech[PEP_crypt_OpenPGP].list_keys(session, _keyring_ids);
    1.26 +    }
    1.27 +        
    1.28 +    // FIXME: Combine lists here
    1.29 +    if (_keyring_ids) {
    1.30 +    }
    1.31 +    
    1.32 +    if (retval == PEP_STATUS_OK)
    1.33 +        *id_list = _id_list;
    1.34 +    return retval;
    1.35  }
    1.36  
    1.37  DYNAMIC_API PEP_STATUS generate_keypair(
     2.1 --- a/src/pEpEngine.h	Tue Aug 16 16:41:23 2016 +0200
     2.2 +++ b/src/pEpEngine.h	Wed Aug 17 12:27:44 2016 +0200
     2.3 @@ -646,19 +646,24 @@
     2.4      );
     2.5  
     2.6  
     2.7 -// list_keys() - return identities for all keys in the keyring
     2.8 +// list_keys() - return identities for all keys in the database (and, optionally, keyring)
     2.9  //
    2.10  //  parameters:
    2.11  //      session (in)          session handle
    2.12 +//      db_only (in)          true if only identities for the pEp management database
    2.13 +//                            should be listed; false if identities should also be
    2.14 +//                            shown from the keyring
    2.15 +//      show_revoked (in)     true if identities with revoked primary keys should also
    2.16 +//                            be listed; false if only valid keys should be shown
    2.17  //      id_list (out)         list of identities for each available key 
    2.18 -//                            (whether in management database 
    2.19 -//                             or not)
    2.20  //
    2.21  //  caveat: FIXME
    2.22  //        the ownership of the identity list goes to the caller
    2.23  //        the caller must use free_identity_list() to free it
    2.24 +//        identity objects derived from the keyring only have the available information
    2.25 +//           from the keyring; some fields may be NULL
    2.26  DYNAMIC_API PEP_STATUS list_keys(
    2.27 -        PEP_SESSION session, identity_list** id_list
    2.28 +        PEP_SESSION session, identity_list** id_list, bool db_only, bool show_revoked
    2.29      );
    2.30  
    2.31  // send_key() - send key(s) to keyserver