src/keymanagement.c
branchENGINE-199
changeset 1734 6d5ea8793614
parent 1610 1f07d18d8bcc
child 1753 01faac16cec6
     1.1 --- a/src/keymanagement.c	Thu Apr 20 15:46:16 2017 +0200
     1.2 +++ b/src/keymanagement.c	Fri Apr 21 21:38:20 2017 +0200
     1.3 @@ -91,7 +91,7 @@
     1.4      assert(!EMPTYSTR(identity->address));
     1.5  
     1.6      if (!(session && identity && !EMPTYSTR(identity->address)))
     1.7 -        return PEP_ILLEGAL_VALUE;
     1.8 +        return ERROR(PEP_ILLEGAL_VALUE);
     1.9  
    1.10      if (identity->me || (identity->user_id && strcmp(identity->user_id, PEP_OWN_USERID) == 0)) {
    1.11          identity->me = true;
    1.12 @@ -311,7 +311,7 @@
    1.13      free_identity(stored_identity);
    1.14      free_identity(temp_id);
    1.15      
    1.16 -    return status;
    1.17 +    return ERROR(status);
    1.18  }
    1.19  
    1.20  PEP_STATUS elect_ownkey(
    1.21 @@ -406,7 +406,7 @@
    1.22      
    1.23      *is_usable = !dont_use_fpr;
    1.24      
    1.25 -    return status;
    1.26 +    return ERROR(status);
    1.27  }
    1.28  
    1.29  PEP_STATUS _myself(PEP_SESSION session, pEp_identity * identity, bool do_keygen, bool ignore_flags)
    1.30 @@ -424,7 +424,7 @@
    1.31      if (!(session && identity && !EMPTYSTR(identity->address) &&
    1.32              (EMPTYSTR(identity->user_id) ||
    1.33              strcmp(identity->user_id, PEP_OWN_USERID) == 0)))
    1.34 -        return PEP_ILLEGAL_VALUE;
    1.35 +        return ERROR(PEP_ILLEGAL_VALUE);
    1.36  
    1.37      identity->comm_type = PEP_ct_pEp;
    1.38      identity->me = true;
    1.39 @@ -512,7 +512,7 @@
    1.40          status = elect_ownkey(session, identity);
    1.41          assert(status == PEP_STATUS_OK);
    1.42          if (status != PEP_STATUS_OK) {
    1.43 -            return status;
    1.44 +            return ERROR(status);
    1.45          }
    1.46  
    1.47          bool has_private = false;
    1.48 @@ -548,21 +548,21 @@
    1.49              status = elect_ownkey(session, identity);
    1.50              assert(status == PEP_STATUS_OK);
    1.51              if (status != PEP_STATUS_OK) {
    1.52 -                return status;
    1.53 +                return ERROR(status);
    1.54              }
    1.55          } 
    1.56          else if (status != PEP_STATUS_OK) 
    1.57          {
    1.58 -            return status;
    1.59 +            return ERROR(status);
    1.60          }
    1.61      }
    1.62     
    1.63      bool new_key_generated = false;
    1.64  
    1.65      if (EMPTYSTR(identity->fpr) || revoked)
    1.66 -    {        
    1.67 +    {
    1.68          if(!do_keygen){
    1.69 -            return PEP_GET_KEY_FAILED;
    1.70 +            return ERROR(PEP_GET_KEY_FAILED);
    1.71          }
    1.72  
    1.73          if(revoked)
    1.74 @@ -580,7 +580,7 @@
    1.75              DEBUG_LOG("generating key pair failed", "debug", buf);
    1.76              if(revoked && r_fpr)
    1.77                  free(r_fpr);
    1.78 -            return status;
    1.79 +            return ERROR(status);
    1.80          }
    1.81  
    1.82          new_key_generated = true;
    1.83 @@ -591,7 +591,7 @@
    1.84                                   identity->fpr, time(NULL));
    1.85              free(r_fpr);
    1.86              if (status != PEP_STATUS_OK) {
    1.87 -                return status;
    1.88 +                return ERROR(status);
    1.89              }
    1.90          }
    1.91      }
    1.92 @@ -604,7 +604,7 @@
    1.93  
    1.94          assert(status == PEP_STATUS_OK);
    1.95          if (status != PEP_STATUS_OK) {
    1.96 -            return status;
    1.97 +            return ERROR(status);
    1.98          }
    1.99  
   1.100          if (status == PEP_STATUS_OK && expired) {
   1.101 @@ -632,12 +632,12 @@
   1.102          }
   1.103      }
   1.104  
   1.105 -    return PEP_STATUS_OK;
   1.106 +    return ERROR(PEP_STATUS_OK);
   1.107  }
   1.108  
   1.109  DYNAMIC_API PEP_STATUS myself(PEP_SESSION session, pEp_identity * identity)
   1.110  {
   1.111 -    return _myself(session, identity, true, false);
   1.112 +    return ERROR(_myself(session, identity, true, false));
   1.113  }
   1.114  
   1.115  DYNAMIC_API PEP_STATUS register_examine_function(