accept the fact that keys exist without identities without barfing in key reset sync
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Mon, 20 Jan 2020 10:13:18 +0100
branchsync
changeset 43533c59288158d7
parent 4352 69ac22b40ac7
child 4355 66cb18185fce
accept the fact that keys exist without identities without barfing in key reset
src/key_reset.c
src/pEpEngine.c
     1.1 --- a/src/key_reset.c	Sat Jan 18 23:15:45 2020 +0100
     1.2 +++ b/src/key_reset.c	Mon Jan 20 10:13:18 2020 +0100
     1.3 @@ -1040,10 +1040,11 @@
     1.4              const char* own_key = curr_key->value;
     1.5              status = get_identities_by_main_key_id(session, own_key, &key_idents);
     1.6              
     1.7 -            if (status != PEP_CANNOT_FIND_IDENTITY)
     1.8 -                status = _key_reset_device_group_for_shared_key(session, key_idents, own_key, true);
     1.9 -            
    1.10 -            if (status != PEP_STATUS_OK)
    1.11 +            if (status == PEP_CANNOT_FIND_IDENTITY)
    1.12 +                continue;
    1.13 +            else if (status == PEP_STATUS_OK)    
    1.14 +                status = _key_reset_device_group_for_shared_key(session, key_idents, own_key, true);            
    1.15 +            else 
    1.16                  goto pEp_free;
    1.17              
    1.18              free_identity_list(key_idents);    
     2.1 --- a/src/pEpEngine.c	Sat Jan 18 23:15:45 2020 +0100
     2.2 +++ b/src/pEpEngine.c	Mon Jan 20 10:13:18 2020 +0100
     2.3 @@ -5225,9 +5225,6 @@
     2.4  
     2.5  PEP_STATUS is_own_key(PEP_SESSION session, const char* fpr, bool* own_key) {
     2.6      
     2.7 -    assert(session);
     2.8 -    assert(!EMPTYSTR(fpr));
     2.9 -
    2.10      if (!session || EMPTYSTR(fpr))
    2.11          return PEP_ILLEGAL_VALUE;
    2.12