Merge with sync sequoia_windows
authorThomas
Mon, 20 May 2019 11:41:21 +0200
branchsequoia_windows
changeset 37333772373556a4
parent 3718 a6355f25976f
parent 3722 0f31947b826d
child 3738 93bdc04f45da
Merge with sync
src/pgp_sequoia.c
     1.1 --- a/src/keymanagement.c	Fri May 17 08:26:12 2019 +0200
     1.2 +++ b/src/keymanagement.c	Mon May 20 11:41:21 2019 +0200
     1.3 @@ -1060,6 +1060,9 @@
     1.4          if (read_only) {
     1.5              free(identity->user_id);
     1.6              identity->user_id = strdup(default_own_id);
     1.7 +            assert(identity->user_id);
     1.8 +            if (!identity->user_id)
     1.9 +                return PEP_OUT_OF_MEMORY;
    1.10          }
    1.11          else {
    1.12              status = set_userid_alias(session, default_own_id, identity->user_id);
    1.13 @@ -1069,6 +1072,7 @@
    1.14                  
    1.15              free(identity->user_id);
    1.16              identity->user_id = strdup(default_own_id);
    1.17 +            assert(identity->user_id);
    1.18              if (identity->user_id == NULL) {
    1.19                  status = PEP_OUT_OF_MEMORY;
    1.20                  goto pEp_free;
    1.21 @@ -1108,11 +1112,14 @@
    1.22      if (EMPTYSTR(identity->username) || read_only) {
    1.23          bool stored_uname = (stored_identity && !EMPTYSTR(stored_identity->username));
    1.24          char* uname = (stored_uname ? stored_identity->username : identity->address);
    1.25 -        free(identity->username);
    1.26 -        identity->username = strdup(uname);
    1.27 -        if (identity->username == NULL) {
    1.28 -            status = PEP_OUT_OF_MEMORY;
    1.29 -            goto pEp_free;
    1.30 +        if (uname) {
    1.31 +            free(identity->username);
    1.32 +            identity->username = strdup(uname);
    1.33 +            assert(identity->username);
    1.34 +            if (identity->username == NULL) {
    1.35 +                status = PEP_OUT_OF_MEMORY;
    1.36 +                goto pEp_free;
    1.37 +            }
    1.38          }
    1.39      }
    1.40  
     2.1 --- a/src/pEpEngine.c	Fri May 17 08:26:12 2019 +0200
     2.2 +++ b/src/pEpEngine.c	Mon May 20 11:41:21 2019 +0200
     2.3 @@ -4997,6 +4997,9 @@
     2.4      return PEP_ENGINE_VERSION;
     2.5  }
     2.6  
     2.7 +DYNAMIC_API const char* get_protocol_version() {
     2.8 +    return PEP_VERSION;
     2.9 +}
    2.10  
    2.11  DYNAMIC_API PEP_STATUS reset_pEptest_hack(PEP_SESSION session)
    2.12  {
     3.1 --- a/src/pEpEngine.h	Fri May 17 08:26:12 2019 +0200
     3.2 +++ b/src/pEpEngine.h	Mon May 20 11:41:21 2019 +0200
     3.3 @@ -1300,6 +1300,10 @@
     3.4  //
     3.5  DYNAMIC_API const char* get_engine_version();
     3.6  
     3.7 +// get_protocol_version() - returns the pEp protocol version
     3.8 +
     3.9 +DYNAMIC_API const char *get_protocol_version();
    3.10 +
    3.11  // is_pEp_user() - returns true if the USER corresponding to this identity 
    3.12  //                 has been listed in the *person* table as a pEp user. 
    3.13  //
     4.1 --- a/src/pgp_netpgp.h	Fri May 17 08:26:12 2019 +0200
     4.2 +++ b/src/pgp_netpgp.h	Mon May 20 11:41:21 2019 +0200
     4.3 @@ -108,3 +108,11 @@
     4.4  
     4.5  // Stub - just returns PEP_STATUS_OK, as netpgp isn't sufficient to do this.
     4.6  PEP_STATUS pgp_import_ultimately_trusted_keypairs(PEP_SESSION session);
     4.7 +
     4.8 +PEP_STATUS pgp_config_cipher_suite(PEP_SESSION session, PEP_CIPHER_SUITE suite) {
     4.9 +    if (suite == PEP_CIPHER_SUITE_DEFAULT) {
    4.10 +        return PEP_STATUS_OK;
    4.11 +    } else {
    4.12 +        return PEP_CANNOT_CONFIG;
    4.13 +    }
    4.14 +}
     5.1 --- a/sync/cond_act_sync.yml2	Fri May 17 08:26:12 2019 +0200
     5.2 +++ b/sync/cond_act_sync.yml2	Mon May 20 11:41:21 2019 +0200
     5.3 @@ -273,6 +273,15 @@
     5.4              }
     5.5          }
     5.6  
     5.7 +        free(partner->user_id);
     5.8 +        partner->user_id = strdup("#NV");
     5.9 +        assert(partner->user_id);
    5.10 +        if (!partner->user_id) {
    5.11 +            free_identity(me);
    5.12 +            free_identity(partner);
    5.13 +            return PEP_OUT_OF_MEMORY;
    5.14 +        }
    5.15 +
    5.16          status = session->notifyHandshake(me, partner, «$type»);
    5.17          if (status)
    5.18              return status;
     6.1 --- a/test/src/SuiteMaker.cc	Fri May 17 08:26:12 2019 +0200
     6.2 +++ b/test/src/SuiteMaker.cc	Mon May 20 11:41:21 2019 +0200
     6.3 @@ -22,6 +22,7 @@
     6.4  #include "BloblistTests.h"
     6.5  #include "NewUpdateIdAndMyselfTests.h"
     6.6  #include "NoOwnIdentWritesOnDecryptTests.h"
     6.7 +#include "LiteralFilenameTests.h"
     6.8  #include "I18nTests.h"
     6.9  #include "IdentityListTests.h"
    6.10  #include "PgpBinaryTests.h"
    6.11 @@ -84,6 +85,7 @@
    6.12      "BloblistTests",
    6.13      "NewUpdateIdAndMyselfTests",
    6.14      "NoOwnIdentWritesOnDecryptTests",
    6.15 +    "LiteralFilenameTests",
    6.16      "I18nTests",
    6.17      "IdentityListTests",
    6.18      "PgpBinaryTests",
    6.19 @@ -136,7 +138,7 @@
    6.20  };
    6.21  
    6.22  // This file is generated, so magic constants are ok.
    6.23 -int SuiteMaker::num_suites = 59;
    6.24 +int SuiteMaker::num_suites = 60;
    6.25  
    6.26  void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
    6.27      if (strcmp(test_class_name, "URIAddressTests") == 0)
    6.28 @@ -159,6 +161,8 @@
    6.29          *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
    6.30      else if (strcmp(test_class_name, "NoOwnIdentWritesOnDecryptTests") == 0)
    6.31          *test_suite = new NoOwnIdentWritesOnDecryptTests(test_class_name, test_home);
    6.32 +    else if (strcmp(test_class_name, "LiteralFilenameTests") == 0)
    6.33 +        *test_suite = new LiteralFilenameTests(test_class_name, test_home);
    6.34      else if (strcmp(test_class_name, "I18nTests") == 0)
    6.35          *test_suite = new I18nTests(test_class_name, test_home);
    6.36      else if (strcmp(test_class_name, "IdentityListTests") == 0)