PEP_enc_none allowed
authorVolker Birk <vb@pep.foundation>
Sat, 30 Dec 2017 15:41:38 +0100
changeset 2337ce5d8de1321c
parent 2336 67b76440cfde
child 2338 b70a6082836b
PEP_enc_none allowed
src/message_api.c
     1.1 --- a/src/message_api.c	Sat Dec 30 14:50:11 2017 +0100
     1.2 +++ b/src/message_api.c	Sat Dec 30 15:41:38 2017 +0100
     1.3 @@ -29,7 +29,8 @@
     1.4      return false;
     1.5  }
     1.6  
     1.7 -static bool is_wrapper(message* src) {
     1.8 +static bool is_wrapper(message* src)
     1.9 +{
    1.10      bool retval = false;
    1.11      
    1.12      if (src) {
    1.13 @@ -62,21 +63,23 @@
    1.14  }
    1.15  
    1.16  
    1.17 -static stringpair_t* search_optfields(const message* msg, const char* key) {
    1.18 -    if (msg && key) {
    1.19 -        stringpair_list_t* opt_fields = msg->opt_fields;
    1.20 -        
    1.21 -        const stringpair_list_t* curr;
    1.22 -        
    1.23 -        for (curr = opt_fields; curr && curr->value; curr = curr->next) {
    1.24 -            if (curr->value->key) {
    1.25 -                if (strcasecmp(curr->value->key, key) == 0)
    1.26 -                    return curr->value;
    1.27 -            }
    1.28 -        } 
    1.29 -    }
    1.30 -    return NULL;
    1.31 -}
    1.32 +/*
    1.33 + * static stringpair_t* search_optfields(const message* msg, const char* key) {
    1.34 + *     if (msg && key) {
    1.35 + *         stringpair_list_t* opt_fields = msg->opt_fields;
    1.36 + *         
    1.37 + *         const stringpair_list_t* curr;
    1.38 + *         
    1.39 + *         for (curr = opt_fields; curr && curr->value; curr = curr->next) {
    1.40 + *             if (curr->value->key) {
    1.41 + *                 if (strcasecmp(curr->value->key, key) == 0)
    1.42 + *                     return curr->value;
    1.43 + *             }
    1.44 + *         } 
    1.45 + *     }
    1.46 + *     return NULL;
    1.47 + * }
    1.48 + */
    1.49  
    1.50  static char * keylist_to_string(const stringlist_t *keylist)
    1.51  {
    1.52 @@ -1416,7 +1419,6 @@
    1.53      assert(session);
    1.54      assert(src);
    1.55      assert(dst);
    1.56 -    assert(enc_format != PEP_enc_none);
    1.57  
    1.58      if (!(session && src && dst && enc_format != PEP_enc_none))
    1.59          return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
    1.60 @@ -2553,9 +2555,7 @@
    1.61             now we need to update the message rating with the 
    1.62             sender and recipients in mind */
    1.63          status = amend_rating_according_to_sender_and_recipients(session,
    1.64 -                                                                 rating,
    1.65 -                                                                 src->from,
    1.66 -                                                                 _keylist);
    1.67 +                rating, src->from, _keylist);
    1.68  
    1.69          if (status != PEP_STATUS_OK)
    1.70              GOTO(pep_error);
    1.71 @@ -3378,10 +3378,8 @@
    1.72      if (status != PEP_STATUS_OK)
    1.73          GOTO(pep_error);
    1.74  
    1.75 -    status = amend_rating_according_to_sender_and_recipients(session,
    1.76 -                                                             &_rating,
    1.77 -                                                             msg->from,
    1.78 -                                                             _keylist);
    1.79 +    status = amend_rating_according_to_sender_and_recipients(session, &_rating,
    1.80 +            msg->from, _keylist);
    1.81      if (status == PEP_STATUS_OK)
    1.82          *rating = _rating;
    1.83