src/keymanagement.c
branchENGINE-289
changeset 2327 cc04433060ff
parent 2326 6d2a523aad35
child 2368 9e1609eeade3
     1.1 --- a/src/keymanagement.c	Mon Dec 18 23:00:56 2017 +0100
     1.2 +++ b/src/keymanagement.c	Mon Dec 18 23:10:29 2017 +0100
     1.3 @@ -262,7 +262,7 @@
     1.4      }
     1.5  
     1.6      new_ident->flags = stored_ident->flags;
     1.7 -                                              
     1.8 +    new_ident->me = new_ident->me || stored_ident->me;
     1.9  }
    1.10  
    1.11  static PEP_STATUS prepare_updated_identity(PEP_SESSION session,
    1.12 @@ -424,10 +424,7 @@
    1.13                  }
    1.14              }
    1.15          } 
    1.16 -        
    1.17 -        if (stored_ident && stored_ident->fpr)
    1.18 -            identity_default_fpr = strdup(stored_ident->fpr);
    1.19 -        
    1.20 +                
    1.21          if (status == PEP_STATUS_OK && stored_ident) { 
    1.22              //  * if identity available
    1.23              //      * patch it with username
    1.24 @@ -959,7 +956,7 @@
    1.25          {
    1.26              DEBUG_LOG("do_keymanagement", "retrieve_next_identity", identity->address);
    1.27  
    1.28 -            if (_identity_me(identity)) {
    1.29 +            if (identity->me) {
    1.30                  status = myself(session, identity);
    1.31              } else {
    1.32                  status = recv_key(session, identity->address);
    1.33 @@ -992,7 +989,7 @@
    1.34      if (!(session && ident && ident->fpr))
    1.35          return PEP_ILLEGAL_VALUE;
    1.36  
    1.37 -    if (_identity_me(ident))
    1.38 +    if (ident->me)
    1.39      {
    1.40          revoke_key(session, ident->fpr, NULL);
    1.41          myself(session, ident);
    1.42 @@ -1040,12 +1037,12 @@
    1.43  
    1.44      assert(session);
    1.45      assert(ident);
    1.46 -    assert(!_identity_me(ident));
    1.47 +    assert(!ident->me);
    1.48      assert(!EMPTYSTR(ident->fpr));
    1.49      assert(!EMPTYSTR(ident->address));
    1.50      assert(!EMPTYSTR(ident->user_id));
    1.51  
    1.52 -    if (!(session && ident && !_identity_me(ident) && ident->fpr && ident->address &&
    1.53 +    if (!(session && ident && !ident->me && ident->fpr && ident->address &&
    1.54              ident->user_id))
    1.55          return PEP_ILLEGAL_VALUE;
    1.56