Merge with sync sequoia_windows
authorThomas
Thu, 08 Aug 2019 15:21:28 +0200
branchsequoia_windows
changeset 39816c2d703cea6d
parent 3970 60c307b38566
parent 3975 7a0961661cf8
child 3982 c4162e447585
Merge with sync
src/pEpEngine.c
sync/sync.fsm
     1.1 --- a/src/message_api.c	Thu Aug 08 11:44:01 2019 +0200
     1.2 +++ b/src/message_api.c	Thu Aug 08 15:21:28 2019 +0200
     1.3 @@ -1083,6 +1083,7 @@
     1.4      return status;
     1.5  }
     1.6  
     1.7 +/*
     1.8  static bool _has_PGP_MIME_format(message* msg) {
     1.9      if (!msg || !msg->attachments || !msg->attachments->next)
    1.10          return false;
    1.11 @@ -1097,6 +1098,7 @@
    1.12          return false;
    1.13      return true;    
    1.14  }
    1.15 +*/
    1.16  
    1.17  static PEP_rating _rating(PEP_comm_type ct)
    1.18  {
     2.1 --- a/src/pEpEngine.c	Thu Aug 08 11:44:01 2019 +0200
     2.2 +++ b/src/pEpEngine.c	Thu Aug 08 15:21:28 2019 +0200
     2.3 @@ -1498,11 +1498,32 @@
     2.4                  // N.B. WE DEFINE PEP_VERSION - IF WE'RE AT 9-DIGIT MAJOR OR MINOR VERSIONS, ER, BAD.
     2.5                  char major_buf[10];
     2.6                  char minor_buf[10];
     2.7 -                if (sscanf("%s.%s", major_buf, minor_buf) != 2)
     2.8 -                    return PEP_UNKNOWN_ERROR; // DO BETTER
     2.9 -                size_t major_len = strlen(major_buf);
    2.10 -                size_t minor_len = strlen(minor_buf);
    2.11 -                    
    2.12 +                
    2.13 +                // Guess we were abusing sscanf here, so we'll do it this way:
    2.14 +                const char* cptr = PEP_VERSION;
    2.15 +                size_t major_len = 0;
    2.16 +                size_t minor_len = 0;
    2.17 +                
    2.18 +                char* bufptr = major_buf;
    2.19 +                while (*cptr != '.' && *cptr != '\0') {
    2.20 +                    *bufptr++ = *cptr++;
    2.21 +                    major_len++;
    2.22 +                }
    2.23 +                *bufptr = '\0';
    2.24 +                bufptr = minor_buf;
    2.25 +
    2.26 +                if (*cptr == '.') {
    2.27 +                    cptr++;
    2.28 +                    while (*cptr != '\0') {
    2.29 +                        *bufptr++ = *cptr++;
    2.30 +                        minor_len++;
    2.31 +                    }
    2.32 +                }
    2.33 +                else {
    2.34 +                    *bufptr++ = '0';
    2.35 +                }
    2.36 +                *bufptr = '\0';
    2.37 +                                    
    2.38                  const char* _ver_12_startstr =                     
    2.39                      "update identity\n"
    2.40                      "    set pEp_version_major = ";
     3.1 --- a/src/sync_api.h	Thu Aug 08 11:44:01 2019 +0200
     3.2 +++ b/src/sync_api.h	Thu Aug 08 15:21:28 2019 +0200
     3.3 @@ -32,6 +32,9 @@
     3.4      // handshake dialog must be closed
     3.5      SYNC_NOTIFY_OVERTAKEN = 9,
     3.6  
     3.7 +    // formig group
     3.8 +    SYNC_NOTIFY_FORMING_GROUP = 10,
     3.9 +
    3.10      // notificaton of actual group status
    3.11      SYNC_NOTIFY_SOLE = 254,
    3.12      SYNC_NOTIFY_IN_GROUP = 255
     4.1 --- a/sync/cond_act_sync.yml2	Thu Aug 08 11:44:01 2019 +0200
     4.2 +++ b/sync/cond_act_sync.yml2	Thu Aug 08 15:21:28 2019 +0200
     4.3 @@ -324,6 +324,9 @@
     4.4  action showDeviceAdded
     4.5      call "show_handshake" with "type" > SYNC_NOTIFY_ACCEPTED_DEVICE_ADDED
     4.6  
     4.7 +action showFormingGroup
     4.8 +    call "show_handshake" with "type" > SYNC_NOTIFY_FORMING_GROUP
     4.9 +    
    4.10  action showGroupCreated
    4.11      call "show_handshake" with "type" > SYNC_NOTIFY_ACCEPTED_GROUP_CREATED
    4.12  
     5.1 --- a/sync/sync.fsm	Thu Aug 08 11:44:01 2019 +0200
     5.2 +++ b/sync/sync.fsm	Thu Aug 08 15:21:28 2019 +0200
     5.3 @@ -231,8 +231,17 @@
     5.4              on Init {
     5.5                  do prepareOwnKeys;
     5.6                  send OwnKeysOfferer; // we're not grouped yet, this is our own keys
     5.7 +                do showFormingGroup;
     5.8              }
     5.9  
    5.10 +            on Cancel {
    5.11 +                send Rollback;
    5.12 +                go Sole;
    5.13 +            }
    5.14 +
    5.15 +            on Rollback
    5.16 +                go Sole;
    5.17 +
    5.18              on OwnKeysRequester {
    5.19                  do saveGroupKeys;
    5.20                  do receivedKeysAreDefaultKeys;
    5.21 @@ -242,14 +251,22 @@
    5.22          }
    5.23  
    5.24          state FormingGroupRequester {
    5.25 -            on Init {
    5.26 -                do prepareOwnKeys;
    5.27 -                send OwnKeysRequester; // we're not grouped yet, this is our own keys
    5.28 +            on Init
    5.29 +                do showFormingGroup;
    5.30 +
    5.31 +            on Cancel {
    5.32 +                send Rollback;
    5.33 +                go Sole;
    5.34              }
    5.35  
    5.36 +            on Rollback
    5.37 +                go Sole;
    5.38 +
    5.39              on OwnKeysOfferer {
    5.40                  do saveGroupKeys;
    5.41 +                do prepareOwnKeys;
    5.42                  do ownKeysAreDefaultKeys;
    5.43 +                send OwnKeysRequester; // we're not grouped yet, this is our own keys
    5.44                  do showGroupCreated;
    5.45                  go Grouped;
    5.46              }
     6.1 --- a/test/src/SuiteMaker.cc	Thu Aug 08 11:44:01 2019 +0200
     6.2 +++ b/test/src/SuiteMaker.cc	Thu Aug 08 15:21:28 2019 +0200
     6.3 @@ -21,7 +21,6 @@
     6.4  #include "Engine463Tests.h"
     6.5  #include "IOS1664Tests.h"
     6.6  #include "BloblistTests.h"
     6.7 -#include "KeyImportAndRetrieveTests.h"
     6.8  #include "NewUpdateIdAndMyselfTests.h"
     6.9  #include "NoOwnIdentWritesOnDecryptTests.h"
    6.10  #include "LiteralFilenameTests.h"
    6.11 @@ -31,7 +30,6 @@
    6.12  #include "PgpBinaryTests.h"
    6.13  #include "SubkeyRatingEvalTests.h"
    6.14  #include "MessageNullFromTests.h"
    6.15 -#include "Engine587Tests.h"
    6.16  #include "ExportKeyTests.h"
    6.17  #include "LeastCommonDenomColorTests.h"
    6.18  #include "StringlistTests.h"
    6.19 @@ -92,7 +90,6 @@
    6.20      "Engine463Tests",
    6.21      "IOS1664Tests",
    6.22      "BloblistTests",
    6.23 -    "KeyImportAndRetrieveTests",
    6.24      "NewUpdateIdAndMyselfTests",
    6.25      "NoOwnIdentWritesOnDecryptTests",
    6.26      "LiteralFilenameTests",
    6.27 @@ -102,7 +99,6 @@
    6.28      "PgpBinaryTests",
    6.29      "SubkeyRatingEvalTests",
    6.30      "MessageNullFromTests",
    6.31 -    "Engine587Tests",
    6.32      "ExportKeyTests",
    6.33      "LeastCommonDenomColorTests",
    6.34      "StringlistTests",
    6.35 @@ -154,7 +150,7 @@
    6.36  };
    6.37  
    6.38  // This file is generated, so magic constants are ok.
    6.39 -int SuiteMaker::num_suites = 68;
    6.40 +int SuiteMaker::num_suites = 66;
    6.41  
    6.42  void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
    6.43      if (strcmp(test_class_name, "URIAddressTests") == 0)
    6.44 @@ -175,8 +171,6 @@
    6.45          *test_suite = new IOS1664Tests(test_class_name, test_home);
    6.46      else if (strcmp(test_class_name, "BloblistTests") == 0)
    6.47          *test_suite = new BloblistTests(test_class_name, test_home);
    6.48 -    else if (strcmp(test_class_name, "KeyImportAndRetrieveTests") == 0)
    6.49 -        *test_suite = new KeyImportAndRetrieveTests(test_class_name, test_home);
    6.50      else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
    6.51          *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
    6.52      else if (strcmp(test_class_name, "NoOwnIdentWritesOnDecryptTests") == 0)
    6.53 @@ -195,8 +189,6 @@
    6.54          *test_suite = new SubkeyRatingEvalTests(test_class_name, test_home);
    6.55      else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
    6.56          *test_suite = new MessageNullFromTests(test_class_name, test_home);
    6.57 -    else if (strcmp(test_class_name, "Engine587Tests") == 0)
    6.58 -        *test_suite = new Engine587Tests(test_class_name, test_home);
    6.59      else if (strcmp(test_class_name, "ExportKeyTests") == 0)
    6.60          *test_suite = new ExportKeyTests(test_class_name, test_home);
    6.61      else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)