src/message_api.c
branchENGINE-215
changeset 1857 52e46f43ac67
parent 1856 99348d336639
parent 1853 a86d6290d493
child 1864 9ce429048fd7
     1.1 --- a/src/message_api.c	Wed Jun 14 18:52:55 2017 +0200
     1.2 +++ b/src/message_api.c	Wed Jun 14 18:58:09 2017 +0200
     1.3 @@ -1104,14 +1104,14 @@
     1.4      assert(enc_format != PEP_enc_none);
     1.5  
     1.6      if (!(session && src && dst && enc_format != PEP_enc_none))
     1.7 -        return ERROR(PEP_ILLEGAL_VALUE);
     1.8 +        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
     1.9  
    1.10      if (src->dir == PEP_dir_incoming)
    1.11 -        return ERROR(PEP_ILLEGAL_VALUE);
    1.12 +        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
    1.13  
    1.14      determine_encryption_format(src);
    1.15      if (src->enc_format != PEP_enc_none)
    1.16 -        return ERROR(PEP_ILLEGAL_VALUE);
    1.17 +        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
    1.18  
    1.19      *dst = NULL;
    1.20  
    1.21 @@ -1218,7 +1218,7 @@
    1.22          free_stringlist(keys);
    1.23          if (!session->passive_mode && !(flags & PEP_encrypt_flag_force_no_attached_key))
    1.24              attach_own_key(session, src);
    1.25 -        return ERROR(PEP_UNENCRYPTED);
    1.26 +        return ADD_TO_LOG(PEP_UNENCRYPTED);
    1.27      }
    1.28      else {
    1.29          msg = clone_to_empty_message(src);
    1.30 @@ -1275,7 +1275,7 @@
    1.31      }
    1.32  
    1.33      *dst = msg;
    1.34 -    return ERROR(status);
    1.35 +    return ADD_TO_LOG(status);
    1.36  
    1.37  enomem:
    1.38      status = PEP_OUT_OF_MEMORY;
    1.39 @@ -1284,7 +1284,7 @@
    1.40      free_stringlist(keys);
    1.41      free_message(msg);
    1.42  
    1.43 -    return ERROR(status);
    1.44 +    return ADD_TO_LOG(status);
    1.45  }
    1.46  
    1.47  DYNAMIC_API PEP_STATUS encrypt_message_for_self(
    1.48 @@ -1306,14 +1306,14 @@
    1.49      assert(enc_format != PEP_enc_none);
    1.50  
    1.51      if (!(session && src && dst && enc_format != PEP_enc_none))
    1.52 -        return ERROR(PEP_ILLEGAL_VALUE);
    1.53 +        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
    1.54  
    1.55      if (src->dir == PEP_dir_incoming)
    1.56 -        return ERROR(PEP_ILLEGAL_VALUE);
    1.57 +        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
    1.58  
    1.59      determine_encryption_format(src);
    1.60      if (src->enc_format != PEP_enc_none)
    1.61 -        return ERROR(PEP_ILLEGAL_VALUE);
    1.62 +        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
    1.63  
    1.64      status = myself(session, target_id);
    1.65      if (status != PEP_STATUS_OK)
    1.66 @@ -1394,7 +1394,7 @@
    1.67      free_stringlist(keys);
    1.68      free_message(msg);
    1.69  
    1.70 -    return ERROR(status);
    1.71 +    return ADD_TO_LOG(status);
    1.72  }
    1.73  
    1.74  static bool is_a_pEpmessage(const message *msg)
    1.75 @@ -1669,7 +1669,7 @@
    1.76      assert(flags);
    1.77  
    1.78      if (!(session && src && dst && keylist && rating && flags))
    1.79 -        return ERROR(PEP_ILLEGAL_VALUE);
    1.80 +        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
    1.81  
    1.82      *flags = 0;
    1.83  
    1.84 @@ -1680,7 +1680,7 @@
    1.85      // we would need to check signature
    1.86      status = _update_identity_for_incoming_message(session, src);
    1.87      if(status != PEP_STATUS_OK)
    1.88 -        return ERROR(status);
    1.89 +        return ADD_TO_LOG(status);
    1.90  
    1.91      // Get detached signature, if any
    1.92      bloblist_t* detached_sig = NULL;
    1.93 @@ -1714,7 +1714,7 @@
    1.94                                  PEP_decrypt_flag_consume;
    1.95                  }
    1.96                  else if (status != PEP_STATUS_OK) {
    1.97 -                    return ERROR(status);
    1.98 +                    return ADD_TO_LOG(status);
    1.99                  }
   1.100              }
   1.101              
   1.102 @@ -1746,7 +1746,7 @@
   1.103                  }
   1.104              }
   1.105              
   1.106 -            return ERROR(PEP_UNENCRYPTED);
   1.107 +            return ADD_TO_LOG(PEP_UNENCRYPTED);
   1.108  
   1.109          case PEP_enc_PGP_MIME:
   1.110              ctext = src->attachments->next->value;
   1.111 @@ -2117,7 +2117,7 @@
   1.112      free_message(msg);
   1.113      free_stringlist(_keylist);
   1.114  
   1.115 -    return ERROR(status);
   1.116 +    return ADD_TO_LOG(status);
   1.117  }
   1.118  
   1.119  DYNAMIC_API PEP_STATUS decrypt_message(
   1.120 @@ -2166,7 +2166,7 @@
   1.121  
   1.122      free_identity_list(private_il);
   1.123  
   1.124 -    return ERROR(status);
   1.125 +    return ADD_TO_LOG(status);
   1.126  }
   1.127  
   1.128  static void _max_comm_type_from_identity_list(
   1.129 @@ -2207,10 +2207,10 @@
   1.130      assert(rating);
   1.131  
   1.132      if (!(session && msg && rating))
   1.133 -        return ERROR(PEP_ILLEGAL_VALUE);
   1.134 +        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
   1.135  
   1.136      if (msg->dir != PEP_dir_outgoing)
   1.137 -        return ERROR(PEP_ILLEGAL_VALUE);
   1.138 +        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
   1.139  
   1.140      *rating = PEP_rating_undefined;
   1.141  
   1.142 @@ -2401,7 +2401,7 @@
   1.143          free (XORed_fpr);
   1.144          
   1.145      the_end:
   1.146 -    return ERROR(status);
   1.147 +    return ADD_TO_LOG(status);
   1.148  }
   1.149  
   1.150  DYNAMIC_API PEP_STATUS get_message_trustwords(
   1.151 @@ -2487,7 +2487,7 @@
   1.152  
   1.153      if (status != PEP_STATUS_OK) {
   1.154          free_identity(partner);
   1.155 -        return ERROR(status);
   1.156 +        return ADD_TO_LOG(status);
   1.157      }
   1.158     
   1.159      // Find own identity corresponding to given account address.
   1.160 @@ -2500,7 +2500,7 @@
   1.161  
   1.162      if (status != PEP_STATUS_OK) {
   1.163          free_identity(stored_identity);
   1.164 -        return ERROR(status);
   1.165 +        return ADD_TO_LOG(status);
   1.166      }
   1.167  
   1.168      // get the trustwords
   1.169 @@ -2509,7 +2509,7 @@
   1.170                              partner, received_by, 
   1.171                              lang, words, &wsize, full);
   1.172  
   1.173 -    return ERROR(status);
   1.174 +    return ADD_TO_LOG(status);
   1.175  }
   1.176  
   1.177  DYNAMIC_API PEP_STATUS MIME_decrypt_message(
   1.178 @@ -2560,14 +2560,14 @@
   1.179      {
   1.180          free(tmp_msg);
   1.181          free(dec_msg);
   1.182 -        return ERROR(decrypt_status);
   1.183 +        return ADD_TO_LOG(decrypt_status);
   1.184      }
   1.185      
   1.186  pep_error:
   1.187      free_message(tmp_msg);
   1.188      free_message(dec_msg);
   1.189  
   1.190 -    return ERROR(status);
   1.191 +    return ADD_TO_LOG(status);
   1.192  }
   1.193  
   1.194  
   1.195 @@ -2612,7 +2612,7 @@
   1.196      free_message(tmp_msg);
   1.197      free_message(enc_msg);
   1.198  
   1.199 -    return ERROR(status);
   1.200 +    return ADD_TO_LOG(status);
   1.201  
   1.202  }
   1.203  
   1.204 @@ -2656,7 +2656,7 @@
   1.205      free_message(tmp_msg);
   1.206      free_message(enc_msg);
   1.207  
   1.208 -    return ERROR(status);
   1.209 +    return ADD_TO_LOG(status);
   1.210  }
   1.211  
   1.212  static PEP_rating string_to_rating(const char * rating)
   1.213 @@ -2749,7 +2749,7 @@
   1.214      assert(rating);
   1.215  
   1.216      if (!(session && msg && rating))
   1.217 -        return ERROR(PEP_ILLEGAL_VALUE);
   1.218 +        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
   1.219  
   1.220      *rating = PEP_rating_undefined;
   1.221  
   1.222 @@ -2760,7 +2760,7 @@
   1.223                  goto got_rating;
   1.224              }
   1.225          }
   1.226 -        return ERROR(PEP_ILLEGAL_VALUE);
   1.227 +        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
   1.228      }
   1.229  
   1.230  got_rating:
   1.231 @@ -2777,7 +2777,7 @@
   1.232                  goto got_keylist;
   1.233              }
   1.234          }
   1.235 -        return ERROR(PEP_ILLEGAL_VALUE);
   1.236 +        return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
   1.237      }
   1.238  got_keylist:
   1.239  
   1.240 @@ -2796,5 +2796,5 @@
   1.241      if (must_free_keylist)
   1.242          free_stringlist(_keylist);
   1.243  
   1.244 -    return ERROR(status);
   1.245 +    return ADD_TO_LOG(status);
   1.246  }