Merged in all sync changes
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Wed, 06 May 2020 21:36:51 +0200
changeset 46729f99a202f9b9
parent 4671 13322aab125a
parent 4669 13aa7b46c8ad
child 4675 03b483e73b3a
Merged in all sync changes
.hgignore
.hgtags
src/keymanagement.c
src/pEpEngine.c
src/pEpEngine.h
src/pEp_internal.h
sync/cond_act_sync.yml2
     1.1 --- a/.hgignore	Wed May 06 21:16:05 2020 +0200
     1.2 +++ b/.hgignore	Wed May 06 21:36:51 2020 +0200
     1.3 @@ -89,7 +89,7 @@
     1.4  test/googletest
     1.5  test/tmp/*
     1.6  
     1.7 -# generated test data
     1.8 +# ignore generated test data
     1.9  
    1.10  test/655_16F07F382FB3CF5DF977005D1069C7CACF9C23C6.asc
    1.11  test/655_5FBDE3C9E10552B1DD6D9763E89759391DE04053.asc
    1.12 @@ -100,3 +100,4 @@
    1.13  test/test_keys/736_a.asc
    1.14  test/test_keys/736_b.asc
    1.15  test/test_mails/ENGINE-654_bob_mail.eml
    1.16 +
     2.1 --- a/.hgtags	Wed May 06 21:16:05 2020 +0200
     2.2 +++ b/.hgtags	Wed May 06 21:36:51 2020 +0200
     2.3 @@ -27,15 +27,10 @@
     2.4  0000000000000000000000000000000000000000 2.0.0-RC
     2.5  0000000000000000000000000000000000000000 2.0.0-RC
     2.6  c4eb9bb2008fbe531f892fd56f8edce53048eb62 2.0.0-RC
     2.7 -c71ec33fb34612be1d35629de5169f3489975b05 2.0.1_target
     2.8 -c71ec33fb34612be1d35629de5169f3489975b05 2.0.1_target
     2.9 -73516323c7532d71760515d23dd4b36a510f9117 2.0.1_target
    2.10 -0000000000000000000000000000000000000000 2.0.1_target
    2.11 -a0785e8bca3935e0ab7cd82a5826a0fca8d23ccb 2.0.1_target
    2.12 -0000000000000000000000000000000000000000 2.0.1_target
    2.13 -a0785e8bca3935e0ab7cd82a5826a0fca8d23ccb 2.0.1_target
    2.14 -0000000000000000000000000000000000000000 2.0.1_target
    2.15 -f7633443ef921ed222519347720b0a7276b3ef6a 2.0.1_target
    2.16 +c71ec33fb34612be1d35629de5169f3489975b05 Release_2.0.0
    2.17 +b5ce496201c0e534c81d18f8447101e39762ec36 Release_2.0.1
    2.18 +f7633443ef921ed222519347720b0a7276b3ef6a 2.1.0_target
    2.19 +f089504579b7808e60281ba06c9a4eee750939c6 Release_2.0.3
    2.20  f0e7ec9616c5aa50b42cef70eff8930feb60f7bd decode-encode-API-change
    2.21  29ddc8a400abbe9b4e05fc5172e5db9ba99f3515 last-old-mime-api-version
    2.22  c173428cd2c31fcc8867dc1ac785a6637c001210 Restarting default from postrelease
     3.1 --- a/src/keymanagement.c	Wed May 06 21:16:05 2020 +0200
     3.2 +++ b/src/keymanagement.c	Wed May 06 21:36:51 2020 +0200
     3.3 @@ -2030,3 +2030,98 @@
     3.4      sqlite3_reset(session->is_mistrusted_key);
     3.5      return status;
     3.6  }
     3.7 +
     3.8 +static PEP_STATUS _wipe_default_key_if_invalid(PEP_SESSION session,
     3.9 +                                         pEp_identity* ident) {
    3.10 +    
    3.11 +    PEP_STATUS status = PEP_STATUS_OK;
    3.12 +    
    3.13 +    if (!ident->user_id)
    3.14 +        return PEP_ILLEGAL_VALUE;
    3.15 +        
    3.16 +    if (!ident->fpr)
    3.17 +        return status;
    3.18 +    
    3.19 +    char* cached_fpr = strdup(ident->fpr);
    3.20 +    if (!ident->fpr)
    3.21 +        return PEP_OUT_OF_MEMORY;
    3.22 +        
    3.23 +    PEP_STATUS keystatus = validate_fpr(session, ident, true, false);
    3.24 +    switch (keystatus) {
    3.25 +        case PEP_STATUS_OK:
    3.26 +            // Check for non-renewable expiry and 
    3.27 +            // if so, fallthrough
    3.28 +            if (ident->comm_type != PEP_ct_key_expired_but_confirmed &&
    3.29 +                    ident->comm_type != PEP_ct_key_expired) {
    3.30 +                break;
    3.31 +            }        
    3.32 +        case PEP_KEY_UNSUITABLE:
    3.33 +        case PEP_KEY_BLACKLISTED:
    3.34 +            // Remove key as default for all identities and users 
    3.35 +            status = remove_fpr_as_default(session, cached_fpr);
    3.36 +            break;   
    3.37 +        default:
    3.38 +            break;
    3.39 +    }     
    3.40 +    free(cached_fpr);
    3.41 +    
    3.42 +    if (status == PEP_STATUS_OK)
    3.43 +        status = myself(session, ident);
    3.44 +            
    3.45 +    return status;                                        
    3.46 +}
    3.47 +
    3.48 +PEP_STATUS clean_own_key_defaults(PEP_SESSION session) {
    3.49 +    identity_list* idents = NULL;
    3.50 +    PEP_STATUS status = own_identities_retrieve(session, &idents);
    3.51 +    if (status != PEP_STATUS_OK)
    3.52 +        return status;
    3.53 +        
    3.54 +    if (!idents)
    3.55 +        return PEP_STATUS_OK;
    3.56 +
    3.57 +    if (!idents->ident && !idents->next) {
    3.58 +        free_identity_list(idents);
    3.59 +        return PEP_STATUS_OK;
    3.60 +    } // Kludge: FIX own_identities_retrieve. Should return NULL, not empty list    
    3.61 +        
    3.62 +    identity_list* curr = idents;
    3.63 +    
    3.64 +    for ( ; curr ; curr = curr->next) {
    3.65 +        pEp_identity* ident = curr->ident;
    3.66 +        if (!ident)
    3.67 +            continue;
    3.68 +        
    3.69 +        _wipe_default_key_if_invalid(session, ident);    
    3.70 +    }   
    3.71 +    
    3.72 +    free_identity_list(idents);
    3.73 +    
    3.74 +    // Also remove invalid default user key
    3.75 +    char* own_id = NULL;
    3.76 +
    3.77 +    status = get_default_own_userid(session, &own_id);
    3.78 +
    3.79 +    if (status != PEP_STATUS_OK)
    3.80 +        return status;
    3.81 +
    3.82 +    if (own_id) {
    3.83 +        char* user_default_key = NULL;
    3.84 +        status = get_user_default_key(session, own_id, &user_default_key);
    3.85 +        if (status != PEP_STATUS_OK) {
    3.86 +            free(own_id);
    3.87 +            if (status == PEP_KEY_NOT_FOUND)
    3.88 +                status = PEP_STATUS_OK;
    3.89 +            else
    3.90 +                return status;
    3.91 +        }
    3.92 +        else if (user_default_key) {
    3.93 +            pEp_identity* empty_user = new_identity(NULL, user_default_key, NULL, own_id);
    3.94 +            _wipe_default_key_if_invalid(session, empty_user);       
    3.95 +            free(user_default_key);
    3.96 +        }
    3.97 +        free(own_id);    
    3.98 +    }
    3.99 +    return status;
   3.100 +}
   3.101 +
     4.1 --- a/src/keymanagement.h	Wed May 06 21:16:05 2020 +0200
     4.2 +++ b/src/keymanagement.h	Wed May 06 21:36:51 2020 +0200
     4.3 @@ -408,6 +408,8 @@
     4.4                              bool* is_address_default,
     4.5                              bool check_blacklist);
     4.6  
     4.7 +PEP_STATUS clean_own_key_defaults(PEP_SESSION session);
     4.8 +
     4.9  #ifdef __cplusplus
    4.10  }
    4.11  #endif
     5.1 --- a/src/pEpEngine.c	Wed May 06 21:16:05 2020 +0200
     5.2 +++ b/src/pEpEngine.c	Wed May 06 21:36:51 2020 +0200
     5.3 @@ -85,8 +85,8 @@
     5.4      "   is_own, pEp_version_major, pEp_version_minor"
     5.5      "   from identity"
     5.6      "   join person on id = identity.user_id"
     5.7 -    "   join pgp_keypair on fpr = identity.main_key_id"
     5.8 -    "   join trust on id = trust.user_id"
     5.9 +    "   left join pgp_keypair on fpr = identity.main_key_id"
    5.10 +    "   left join trust on id = trust.user_id"
    5.11      "       and pgp_keypair_fpr = identity.main_key_id"    
    5.12      "   where (case when (address = ?1) then (1)"
    5.13      "               when (lower(address) = lower(?1)) then (1)"
    5.14 @@ -103,8 +103,8 @@
    5.15      "   is_own, pEp_version_major, pEp_version_minor"
    5.16      "   from identity"
    5.17      "   join person on id = identity.user_id"
    5.18 -    "   join pgp_keypair on fpr = identity.main_key_id"
    5.19 -    "   join trust on id = trust.user_id"
    5.20 +    "   left join pgp_keypair on fpr = identity.main_key_id"
    5.21 +    "   left join trust on id = trust.user_id"
    5.22      "       and pgp_keypair_fpr = identity.main_key_id"    
    5.23      "   where identity.main_key_id = ?1" 
    5.24      "   order by is_own desc, "
    5.25 @@ -143,8 +143,8 @@
    5.26      "   is_own, pEp_version_major, pEp_version_minor"
    5.27      "   from identity"
    5.28      "   join person on id = identity.user_id"
    5.29 -    "   join pgp_keypair on fpr = identity.main_key_id"
    5.30 -    "   join trust on id = trust.user_id"
    5.31 +    "   left join pgp_keypair on fpr = identity.main_key_id"
    5.32 +    "   left join trust on id = trust.user_id"
    5.33      "       and pgp_keypair_fpr = identity.main_key_id"    
    5.34      "   where identity.user_id = ?1" 
    5.35      "   order by is_own desc, "
    5.36 @@ -155,10 +155,12 @@
    5.37      "   set main_key_id = ?1 "
    5.38      "   where main_key_id = ?2 ;";
    5.39      
    5.40 -static const char *sql_remove_fpr_as_default =
    5.41 -    "update person set main_key_id = NULL where main_key_id = ?1 ;"
    5.42 +static const char *sql_remove_fpr_as_identity_default =
    5.43      "update identity set main_key_id = NULL where main_key_id = ?1 ;";
    5.44  
    5.45 +static const char *sql_remove_fpr_as_user_default =
    5.46 +    "update person set main_key_id = NULL where main_key_id = ?1 ;";
    5.47 +    
    5.48  // Set person, but if already exist, only update.
    5.49  // if main_key_id already set, don't touch.
    5.50  static const char *sql_set_person = 
    5.51 @@ -431,8 +433,8 @@
    5.52      "   lang, identity.flags | pgp_keypair.flags, pEp_version_major, pEp_version_minor"
    5.53      "   from identity"
    5.54      "   join person on id = identity.user_id"
    5.55 -    "   join pgp_keypair on fpr = identity.main_key_id"
    5.56 -    "   join trust on id = trust.user_id"
    5.57 +    "   left join pgp_keypair on fpr = identity.main_key_id"
    5.58 +    "   left join trust on id = trust.user_id"
    5.59      "       and pgp_keypair_fpr = identity.main_key_id"
    5.60      "   where identity.is_own = 1"
    5.61      "       and (identity.flags & ?1) = 0;";
    5.62 @@ -454,7 +456,7 @@
    5.63      "select id from person"
    5.64      "   join identity on id = identity.user_id"
    5.65      "   where identity.is_own = 1";
    5.66 -
    5.67 +    
    5.68  // Sequence
    5.69  static const char *sql_sequence_value1 = 
    5.70      "insert or replace into sequences (name, value) "
    5.71 @@ -1797,9 +1799,14 @@
    5.72              &_session->replace_identities_fpr, NULL);
    5.73      assert(int_result == SQLITE_OK);
    5.74      
    5.75 -    int_result = sqlite3_prepare_v2(_session->db, sql_remove_fpr_as_default,
    5.76 -            (int)strlen(sql_remove_fpr_as_default), 
    5.77 -            &_session->remove_fpr_as_default, NULL);
    5.78 +    int_result = sqlite3_prepare_v2(_session->db, sql_remove_fpr_as_identity_default,
    5.79 +            (int)strlen(sql_remove_fpr_as_identity_default), 
    5.80 +            &_session->remove_fpr_as_identity_default, NULL);
    5.81 +    assert(int_result == SQLITE_OK);
    5.82 +
    5.83 +    int_result = sqlite3_prepare_v2(_session->db, sql_remove_fpr_as_user_default,
    5.84 +            (int)strlen(sql_remove_fpr_as_user_default), 
    5.85 +            &_session->remove_fpr_as_user_default, NULL);
    5.86      assert(int_result == SQLITE_OK);
    5.87  
    5.88      int_result = sqlite3_prepare_v2(_session->db, sql_set_person,
    5.89 @@ -2061,6 +2068,11 @@
    5.90          goto pEp_error;
    5.91  
    5.92      // runtime config
    5.93 +    
    5.94 +    // clean up invalid keys 
    5.95 +    status = clean_own_key_defaults(_session);
    5.96 +    if (status != PEP_STATUS_OK)
    5.97 +        goto pEp_error;
    5.98  
    5.99      *session = _session;
   5.100      
   5.101 @@ -2126,8 +2138,10 @@
   5.102                  sqlite3_finalize(session->add_userid_alias);
   5.103              if (session->replace_identities_fpr)
   5.104                  sqlite3_finalize(session->replace_identities_fpr);        
   5.105 -            if (session->remove_fpr_as_default)
   5.106 -                sqlite3_finalize(session->remove_fpr_as_default);            
   5.107 +            if (session->remove_fpr_as_identity_default)
   5.108 +                sqlite3_finalize(session->remove_fpr_as_identity_default);            
   5.109 +            if (session->remove_fpr_as_user_default)
   5.110 +                sqlite3_finalize(session->remove_fpr_as_user_default);            
   5.111              if (session->set_person)
   5.112                  sqlite3_finalize(session->set_person);
   5.113              if (session->delete_person)
   5.114 @@ -3795,16 +3809,26 @@
   5.115      if (!session || !fpr)
   5.116          return PEP_ILLEGAL_VALUE;
   5.117              
   5.118 -    sqlite3_reset(session->remove_fpr_as_default);
   5.119 -    sqlite3_bind_text(session->remove_fpr_as_default, 1, fpr, -1,
   5.120 +    sqlite3_reset(session->remove_fpr_as_identity_default);
   5.121 +    sqlite3_bind_text(session->remove_fpr_as_identity_default, 1, fpr, -1,
   5.122                        SQLITE_STATIC);
   5.123  
   5.124 -    int result = sqlite3_step(session->remove_fpr_as_default);
   5.125 -    sqlite3_reset(session->remove_fpr_as_default);
   5.126 +    int result = sqlite3_step(session->remove_fpr_as_identity_default);
   5.127 +    sqlite3_reset(session->remove_fpr_as_identity_default);
   5.128      
   5.129      if (result != SQLITE_DONE)
   5.130 -        return PEP_CANNOT_SET_IDENTITY; // misleading - could also be person
   5.131 -
   5.132 +        return PEP_CANNOT_SET_IDENTITY; 
   5.133 +
   5.134 +    sqlite3_reset(session->remove_fpr_as_user_default);
   5.135 +    sqlite3_bind_text(session->remove_fpr_as_user_default, 1, fpr, -1,
   5.136 +                      SQLITE_STATIC);
   5.137 +
   5.138 +    result = sqlite3_step(session->remove_fpr_as_user_default);
   5.139 +    sqlite3_reset(session->remove_fpr_as_user_default);
   5.140 +    
   5.141 +    if (result != SQLITE_DONE)
   5.142 +        return PEP_CANNOT_SET_PERSON; 
   5.143 +        
   5.144      return PEP_STATUS_OK;
   5.145  }
   5.146  
     7.1 --- a/src/pEp_internal.h	Wed May 06 21:16:05 2020 +0200
     7.2 +++ b/src/pEp_internal.h	Wed May 06 21:36:51 2020 +0200
     7.3 @@ -160,7 +160,8 @@
     7.4      sqlite3_stmt *get_main_user_fpr;
     7.5      sqlite3_stmt *refresh_userid_default_key;
     7.6      sqlite3_stmt *delete_key;
     7.7 -    sqlite3_stmt *remove_fpr_as_default;
     7.8 +    sqlite3_stmt *remove_fpr_as_identity_default;
     7.9 +    sqlite3_stmt *remove_fpr_as_user_default;
    7.10      sqlite3_stmt *set_person;
    7.11      sqlite3_stmt *update_person;
    7.12      sqlite3_stmt *delete_person;
     8.1 --- a/sync/cond_act_sync.yml2	Wed May 06 21:16:05 2020 +0200
     8.2 +++ b/sync/cond_act_sync.yml2	Wed May 06 21:36:51 2020 +0200
     8.3 @@ -503,15 +503,15 @@
     8.4  
     8.5      for (identity_list *_il = il; _il && _il->ident ; _il = _il->next) {
     8.6          status = set_own_key(session, _il->ident, _il->ident->fpr);
     8.7 -        if (status) {
     8.8 -            free_identity_list(il);
     8.9 -            free(user_id);
    8.10 -            return status;
    8.11 -        }
    8.12 +        if (status != PEP_STATUS_OK && status != PEP_KEY_UNSUITABLE)
    8.13 +            break;
    8.14      }
    8.15  
    8.16      free_identity_list(il);
    8.17      free(user_id);
    8.18 +
    8.19 +    if (status == PEP_KEY_UNSUITABLE)
    8.20 +        status = PEP_STATUS_OK;
    8.21  ||
    8.22  
    8.23  action useThisKey
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/test/src/CleanInvalidOwnKeysTest.cc	Wed May 06 21:36:51 2020 +0200
     9.3 @@ -0,0 +1,125 @@
     9.4 +#include <stdlib.h>
     9.5 +#include <string>
     9.6 +#include <cstring>
     9.7 +
     9.8 +#include "pEpEngine.h"
     9.9 +#include "test_util.h"
    9.10 +#include "TestConstants.h"
    9.11 +#include "Engine.h"
    9.12 +
    9.13 +#include <gtest/gtest.h>
    9.14 +
    9.15 +
    9.16 +namespace {
    9.17 +
    9.18 +	//The fixture for CleanInvalidOwnKeysTest
    9.19 +    class CleanInvalidOwnKeysTest : public ::testing::Test {
    9.20 +        public:
    9.21 +            Engine* engine;
    9.22 +            PEP_SESSION session;
    9.23 +
    9.24 +        protected:
    9.25 +            // You can remove any or all of the following functions if its body
    9.26 +            // is empty.
    9.27 +            CleanInvalidOwnKeysTest() {
    9.28 +                // You can do set-up work for each test here.
    9.29 +                test_suite_name = ::testing::UnitTest::GetInstance()->current_test_info()->GTEST_SUITE_SYM();
    9.30 +                test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name();
    9.31 +                test_path = get_main_test_home_dir() + "/" + test_suite_name + "/" + test_name;
    9.32 +            }
    9.33 +
    9.34 +            ~CleanInvalidOwnKeysTest() override {
    9.35 +                // You can do clean-up work that doesn't throw exceptions here.
    9.36 +            }
    9.37 +
    9.38 +            // If the constructor and destructor are not enough for setting up
    9.39 +            // and cleaning up each test, you can define the following methods:
    9.40 +
    9.41 +            void SetUp() override {
    9.42 +                // Code here will be called immediately after the constructor (right
    9.43 +                // before each test).
    9.44 +
    9.45 +                // Leave this empty if there are no files to copy to the home directory path
    9.46 +                std::vector<std::pair<std::string, std::string>> init_files = std::vector<std::pair<std::string, std::string>>();
    9.47 +                string keyfile = string("test_files/ENGINE-750_") + test_name + "_keys.db";
    9.48 +                string mgmtfile = string("test_files/ENGINE-750_") + test_name + "_mgmt.db";
    9.49 +                init_files.push_back(std::pair<std::string, std::string>(keyfile, std::string("keys.db")));                
    9.50 +                init_files.push_back(std::pair<std::string, std::string>(mgmtfile, std::string("management.db")));
    9.51 +                
    9.52 +                // Get a new test Engine.
    9.53 +                engine = new Engine(test_path);
    9.54 +                ASSERT_NE(engine, nullptr);
    9.55 +
    9.56 +                // Ok, let's initialize test directories etc.
    9.57 +                engine->prep(NULL, NULL, init_files);
    9.58 +
    9.59 +                // Ok, try to start this bugger.
    9.60 +                engine->start();
    9.61 +                ASSERT_NE(engine->session, nullptr);
    9.62 +                session = engine->session;
    9.63 +
    9.64 +                // Engine is up. Keep on truckin'
    9.65 +            }
    9.66 +
    9.67 +            void TearDown() override {
    9.68 +                // Code here will be called immediately after each test (right
    9.69 +                // before the destructor).
    9.70 +                engine->shut_down();
    9.71 +                delete engine;
    9.72 +                engine = NULL;
    9.73 +                session = NULL;
    9.74 +            }
    9.75 +
    9.76 +        private:
    9.77 +            const char* test_suite_name;
    9.78 +            const char* test_name;
    9.79 +            string test_path;
    9.80 +            // Objects declared here can be used by all tests in the CleanInvalidOwnKeysTest suite.
    9.81 +
    9.82 +    };
    9.83 +
    9.84 +}  // namespace
    9.85 +
    9.86 +
    9.87 +TEST_F(CleanInvalidOwnKeysTest, check_clean_invalid_own_keys_no_alts_revoked) {
    9.88 +    // This is just a dummy test case. The convention is check_whatever_you_are_checking
    9.89 +    // so for multiple test cases in a suite, be more explicit ;)   
    9.90 +    pEp_identity* alice = NULL;
    9.91 +    PEP_STATUS status = get_identity(session, "pep.test.alice@pep-project.org", "ALICE", &alice);
    9.92 +    ASSERT_EQ(status, PEP_STATUS_OK);
    9.93 +    ASSERT_EQ(alice->fpr, nullptr);
    9.94 +    char* fpr = NULL;
    9.95 +    status = get_user_default_key(session, "ALICE", &fpr);
    9.96 +    ASSERT_EQ(fpr, nullptr);
    9.97 +    ASSERT_EQ(status, PEP_STATUS_OK);    
    9.98 +}
    9.99 +
   9.100 +TEST_F(CleanInvalidOwnKeysTest, check_clean_invalid_own_keys_no_alts_mistrusted) {
   9.101 +    // This is just a dummy test case. The convention is check_whatever_you_are_checking
   9.102 +    // so for multiple test cases in a suite, be more explicit ;)   
   9.103 +    pEp_identity* alice = NULL;
   9.104 +    PEP_STATUS status = get_identity(session, "pep.test.alice@pep-project.org", "ALICE", &alice);
   9.105 +    ASSERT_EQ(status, PEP_STATUS_OK);
   9.106 +    ASSERT_EQ(alice->fpr, nullptr);
   9.107 +    char* fpr = NULL;
   9.108 +    status = get_user_default_key(session, "ALICE", &fpr);
   9.109 +    ASSERT_EQ(fpr, nullptr);
   9.110 +    ASSERT_EQ(status, PEP_STATUS_OK);    
   9.111 +}
   9.112 +
   9.113 +TEST_F(CleanInvalidOwnKeysTest, check_clean_invalid_own_keys_no_alts_expired) {
   9.114 +    // This is just a dummy test case. The convention is check_whatever_you_are_checking
   9.115 +    // so for multiple test cases in a suite, be more explicit ;)   
   9.116 +    pEp_identity* bob = NULL;
   9.117 +    PEP_STATUS status = get_identity(session, "expired_bob_0@darthmama.org", "BOB", &bob);
   9.118 +    ASSERT_EQ(status, PEP_STATUS_OK);
   9.119 +    ASSERT_NE(bob->fpr, nullptr);
   9.120 +    char* fpr = NULL;
   9.121 +    status = get_user_default_key(session, "BOB", &fpr);
   9.122 +    ASSERT_NE(fpr, nullptr);
   9.123 +    ASSERT_EQ(status, PEP_STATUS_OK);    
   9.124 +    bool expired = true;
   9.125 +    status = key_expired(session, bob->fpr, time(NULL), &expired);
   9.126 +    ASSERT_FALSE(expired);
   9.127 +    ASSERT_STREQ(bob->fpr, fpr);
   9.128 +}
    10.1 Binary file test/test_files/ENGINE-750_check_clean_invalid_own_keys_no_alts_expired_keys.db has changed
    11.1 Binary file test/test_files/ENGINE-750_check_clean_invalid_own_keys_no_alts_expired_mgmt.db has changed
    12.1 Binary file test/test_files/ENGINE-750_check_clean_invalid_own_keys_no_alts_mistrusted_keys.db has changed
    13.1 Binary file test/test_files/ENGINE-750_check_clean_invalid_own_keys_no_alts_mistrusted_mgmt.db has changed
    14.1 Binary file test/test_files/ENGINE-750_check_clean_invalid_own_keys_no_alts_revoked_keys.db has changed
    15.1 Binary file test/test_files/ENGINE-750_check_clean_invalid_own_keys_no_alts_revoked_mgmt.db has changed