src/keymanagement.c
branchENGINE-137
changeset 1502 ab5de5449d7d
parent 1501 a47ea9fdbd81
child 1506 fc7d96185247
child 1517 f29830f1c407
     1.1 --- a/src/keymanagement.c	Tue Dec 20 12:06:56 2016 +0100
     1.2 +++ b/src/keymanagement.c	Tue Dec 20 14:07:45 2016 +0100
     1.3 @@ -178,12 +178,6 @@
     1.4              status = elect_pubkey(session, temp_id);
     1.5              if (status != PEP_STATUS_OK)
     1.6                  goto exit_free;
     1.7 -            bool dont_use_elected_fpr = true;
     1.8 -            status = blacklist_is_listed(session, temp_id->fpr, &dont_use_elected_fpr);
     1.9 -            if (dont_use_elected_fpr) {
    1.10 -                free(temp_id->fpr);
    1.11 -                temp_id->fpr = NULL;
    1.12 -            }
    1.13              else {
    1.14                  _did_elect_new_key = 1;
    1.15              }
    1.16 @@ -229,28 +223,17 @@
    1.17          /* Work with the elected key */
    1.18          if (!EMPTYSTR(temp_id->fpr)) {
    1.19              
    1.20 -            bool dont_use_elected_fpr = true;
    1.21 -            status = blacklist_is_listed(session, temp_id->fpr, &dont_use_elected_fpr);
    1.22 -            if (status != PEP_STATUS_OK)
    1.23 -                dont_use_elected_fpr = true; 
    1.24 +            PEP_comm_type _comm_type_key = temp_id->comm_type;
    1.25 +            
    1.26 +            _did_elect_new_key = 1;
    1.27  
    1.28 -            if (!dont_use_elected_fpr) {
    1.29 -                PEP_comm_type _comm_type_key = temp_id->comm_type;
    1.30 -                
    1.31 -                _did_elect_new_key = 1;
    1.32 +            // We don't want to lose a previous trust entry!!!
    1.33 +            status = get_trust(session, temp_id);
    1.34  
    1.35 -                // We don't want to lose a previous trust entry!!!
    1.36 -                status = get_trust(session, temp_id);
    1.37 +            bool has_trust_status = (status == PEP_STATUS_OK);
    1.38  
    1.39 -                bool has_trust_status = (status == PEP_STATUS_OK);
    1.40 -
    1.41 -                if (!has_trust_status)
    1.42 -                    temp_id->comm_type = _comm_type_key;
    1.43 -            }
    1.44 -            else {
    1.45 -                free(temp_id->fpr);
    1.46 -                temp_id->fpr = NULL;
    1.47 -            }
    1.48 +            if (!has_trust_status)
    1.49 +                temp_id->comm_type = _comm_type_key;
    1.50          }
    1.51      }
    1.52