Fixed missuse of updatw_identity in decrypt leading to replacing own fpr in some case. Fixed dandling else typo from cce44a694981 keysync
authorEdouard Tisserant <edouard@pep-project.org>
Sun, 11 Sep 2016 22:32:22 +0200
branchkeysync
changeset 115623006f389f2f
parent 1155 172cc6ca6648
child 1157 7d383681ef2f
Fixed missuse of updatw_identity in decrypt leading to replacing own fpr in some case. Fixed dandling else typo from cce44a694981
src/message_api.c
     1.1 --- a/src/message_api.c	Fri Sep 09 21:59:47 2016 +0200
     1.2 +++ b/src/message_api.c	Sun Sep 11 22:32:22 2016 +0200
     1.3 @@ -826,11 +826,14 @@
     1.4              status = least_trust(session, _kl->value, &ct);
     1.5              if (status != PEP_STATUS_OK)
     1.6                  return PEP_rating_undefined;
     1.7 -            if (ct == PEP_ct_unknown)
     1.8 -                if (rating >= PEP_rating_reliable)
     1.9 +            if (ct == PEP_ct_unknown){
    1.10 +                if (rating >= PEP_rating_reliable){
    1.11                      rating = PEP_rating_reliable;
    1.12 -            else
    1.13 +                }
    1.14 +            }
    1.15 +            else{
    1.16                  rating = _rating(ct, rating);
    1.17 +            }
    1.18          }
    1.19          else if (_rating_ == PEP_rating_unencrypted) {
    1.20              if (rating > PEP_rating_unencrypted_for_some)
    1.21 @@ -1642,10 +1645,12 @@
    1.22                                                         src->from->user_id, src->from->username);
    1.23                      if (_from == NULL)
    1.24                          goto enomem;
    1.25 -                    status = update_identity(session, _from);
    1.26 +                    status = get_trust(session, _from);
    1.27                      if (_from->comm_type != PEP_ct_unknown)
    1.28                          *rating = _rating(_from->comm_type, PEP_rating_undefined);
    1.29                      free_identity(_from);
    1.30 +                    if (status == PEP_CANNOT_FIND_IDENTITY)
    1.31 +                       status = PEP_STATUS_OK;
    1.32                      if (status != PEP_STATUS_OK)
    1.33                          goto pep_error;
    1.34                  }