merged in sync ENGINE-559
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Wed, 17 Jul 2019 09:47:56 +0200
branchENGINE-559
changeset 394347d45beb5cd1
parent 3926 4b83788c7a45
parent 3932 c487731d164d
child 3944 921174306d6a
merged in sync
src/keymanagement.c
src/message_api.c
test/src/SuiteMaker.cc
test/src/engine_tests/IOS1664Tests.cc
     1.1 --- a/src/keymanagement.c	Mon Jul 15 15:29:06 2019 +0200
     1.2 +++ b/src/keymanagement.c	Wed Jul 17 09:47:56 2019 +0200
     1.3 @@ -249,7 +249,7 @@
     1.4          case PEP_ct_key_revoked:
     1.5          case PEP_ct_key_b0rken:
     1.6              // delete key from being default key for all users/identities
     1.7 -            status = remove_fpr_as_default(session, fpr); //BUFF: considers the key as "revoked" ...
     1.8 +            status = remove_fpr_as_default(session, fpr);
     1.9              status = update_trust_for_fpr(session, 
    1.10                                            fpr, 
    1.11                                            ct);
    1.12 @@ -257,7 +257,7 @@
    1.13              free(ident->fpr);
    1.14              ident->fpr = NULL;
    1.15              ident->comm_type = ct;            
    1.16 -            status = PEP_KEY_UNSUITABLE; //BUFF: ... and returns PEP_KEY_UNSUITABLE
    1.17 +            status = PEP_KEY_UNSUITABLE;
    1.18          default:
    1.19              break;
    1.20      }            
     2.1 --- a/src/message_api.c	Mon Jul 15 15:29:06 2019 +0200
     2.2 +++ b/src/message_api.c	Wed Jul 17 09:47:56 2019 +0200
     2.3 @@ -2594,8 +2594,8 @@
     2.4      
     2.5      if ((!slong || slong[0] == '\0')
     2.6           && (!sform || sform[0] == '\0')) {
     2.7 -        if (satt) {
     2.8 -            const char* inner_mime_type = satt->mime_type;
     2.9 +        const char* inner_mime_type = (satt ? satt->mime_type : NULL);     
    2.10 +        if (inner_mime_type) {
    2.11              if (strcasecmp(inner_mime_type, "text/plain") == 0) {
    2.12                  free(slong); /* in case of "" */
    2.13                  src->longmsg = strndup(satt->value, satt->size); 
     3.1 --- a/sync/gen_statemachine.ysl2	Mon Jul 15 15:29:06 2019 +0200
     3.2 +++ b/sync/gen_statemachine.ysl2	Wed Jul 17 09:47:56 2019 +0200
     3.3 @@ -552,6 +552,7 @@
     3.4                                  status = PEP_«yml:ucase(@name)»_CANNOT_ENCRYPT;
     3.5                                  goto the_end;
     3.6                              }
     3.7 +                            add_opt_field(m, "pEp-auto-consume", "yes");
     3.8                              free_message(_m);
     3.9                              break;
    3.10  
    3.11 @@ -729,6 +730,7 @@
    3.12                                  status = PEP_«yml:ucase(@name)»_CANNOT_ENCRYPT;
    3.13                                  goto the_end;
    3.14                              }
    3.15 +                            add_opt_field(m, "pEp-auto-consume", "yes");
    3.16                              free_message(_m);
    3.17                              break;
    3.18  
    3.19 @@ -752,6 +754,7 @@
    3.20                                  status = PEP_«yml:ucase(@name)»_CANNOT_ENCRYPT;
    3.21                                  goto the_end;
    3.22                              }
    3.23 +                            add_opt_field(m, "pEp-auto-consume", "yes");
    3.24                              free_message(_m);
    3.25                      }
    3.26  
    3.27 @@ -1046,8 +1049,10 @@
    3.28  
    3.29          // state machine
    3.30  
    3.31 +        #ifndef NDEBUG
    3.32          const char *«@name»_state_name(int state);
    3.33          const char *«@name»_event_name(int event);
    3.34 +        #endif
    3.35  
    3.36          // the state machine function is returning the next state in case of a
    3.37          // transition or None for staying
    3.38 @@ -1073,6 +1078,9 @@
    3.39          #include "«@name»_fsm.h"
    3.40          #include <stdlib.h>
    3.41  
    3.42 +        #ifdef NDEBUG
    3.43 +        static
    3.44 +        #endif
    3.45          const char *«@name»_state_name(int state)
    3.46          {
    3.47              switch (state) {
    3.48 @@ -1093,6 +1101,9 @@
    3.49              }
    3.50          }
    3.51  
    3.52 +        #ifdef NDEBUG
    3.53 +        static
    3.54 +        #endif
    3.55          const char *«@name»_event_name(int event)
    3.56          {
    3.57              switch (event) {
    3.58 @@ -1158,7 +1169,7 @@
    3.59              switch (state) {
    3.60                  `` apply "state", 2, mode=fsm
    3.61                  default:
    3.62 -                    «@name»_ERR_LOG_INT("invalid state", state);
    3.63 +                    «@name»_ERR_LOG("invalid state", «@name»_state_name(state));
    3.64                      return invalid_state;
    3.65              }
    3.66              
     4.1 --- a/sync/sync.fsm	Mon Jul 15 15:29:06 2019 +0200
     4.2 +++ b/sync/sync.fsm	Wed Jul 17 09:47:56 2019 +0200
     4.3 @@ -10,7 +10,7 @@
     4.4  protocol Sync 1 {
     4.5      // all messages have a timestamp, time out and are removed after timeout
     4.6  
     4.7 -    fsm KeySync 1, threshold=60 {
     4.8 +    fsm KeySync 1, threshold=300 {
     4.9          version 1, 2;
    4.10  
    4.11          state InitState {