merge "default" branch into "roker-linux" roker-linux
authorRoker <roker@pep-project.org>
Mon, 26 Sep 2016 08:08:21 +0200
branchroker-linux
changeset 1191b5779126c6aa
parent 1168 4d4e3ecbaf8b
parent 1187 8bbb80bb4323
child 2567 ccb6a6c93bce
merge "default" branch into "roker-linux"
     1.1 --- a/src/pgp_gpg.c	Tue Sep 20 15:54:57 2016 +0200
     1.2 +++ b/src/pgp_gpg.c	Mon Sep 26 08:08:21 2016 +0200
     1.3 @@ -1256,7 +1256,7 @@
     1.4      stringpair_list_t* list_curr = _keyinfo_list;
     1.5      stringpair_t* pair = NULL;
     1.6          
     1.7 -    do {
     1.8 +    do { 
     1.9          gpgme_error = gpg.gpgme_op_keylist_next(session->ctx, &key);
    1.10          gpgme_error = _GPGERR(gpgme_error);
    1.11        
    1.12 @@ -1271,13 +1271,21 @@
    1.13  
    1.14                  // first subkey is primary key
    1.15                  char* fpr = key->subkeys->fpr;
    1.16 -                char* uid = key->uids->uid;
    1.17 -                
    1.18 +
    1.19                  assert(fpr);
    1.20 -                assert(uid); // ??
    1.21                  if (!fpr)
    1.22                      return PEP_GET_KEY_FAILED;
    1.23                  
    1.24 +                bool own_key = false;
    1.25 +                PEP_STATUS own_key_status = own_key_is_listed(session, fpr, &own_key);
    1.26 +                
    1.27 +                if (own_key || own_key_status != PEP_STATUS_OK) // Hrm... is this second part ok?
    1.28 +                    continue;
    1.29 +
    1.30 +                char* uid = key->uids->uid;
    1.31 +                assert(uid); // ??                
    1.32 +                
    1.33 +                
    1.34                  PEP_STATUS key_status = PEP_GET_KEY_FAILED;
    1.35                  
    1.36                  bool key_revoked = false;