src/pEpEngine.c
branchENGINE-188
changeset 1632 ab9a7a180cfe
parent 1630 a507a5006bea
child 1636 cc152225ec01
     1.1 --- a/src/pEpEngine.c	Tue Mar 07 23:52:44 2017 +0100
     1.2 +++ b/src/pEpEngine.c	Wed Mar 08 23:10:30 2017 +0100
     1.3 @@ -90,7 +90,10 @@
     1.4      "and pgp_keypair_fpr = upper(replace(?2,' ','')) ;";
     1.5  
     1.6  static const char *sql_least_trust = 
     1.7 -    "select min(comm_type) from trust where pgp_keypair_fpr = upper(replace(?1,' ','')) ;";
     1.8 +    "select min(comm_type) from trust where"
     1.9 +    " pgp_keypair_fpr = upper(replace(?1,' ',''))"
    1.10 +    " and comm_type != 0;"; // ignores PEP_ct_unknown
    1.11 +    // returns PEP_ct_unknown only when no known trust is recorded
    1.12  
    1.13  static const char *sql_mark_as_compromized = 
    1.14      "update trust not indexed set comm_type = 15"
    1.15 @@ -1425,6 +1428,7 @@
    1.16              break;
    1.17          }
    1.18          default:
    1.19 +            // never reached because of sql min()
    1.20              status = PEP_CANNOT_FIND_IDENTITY;
    1.21      }
    1.22