Merge with sync sequoia_windows
authorThomas
Tue, 09 Jul 2019 08:19:24 +0200
branchsequoia_windows
changeset 39061a00a4b3ff54
parent 3903 abaab1748cc1
parent 3905 1d3c2c487980
child 3908 02674dbf74df
Merge with sync
src/pEpEngine.c
     1.1 --- a/src/message_api.c	Mon Jul 08 09:26:12 2019 +0200
     1.2 +++ b/src/message_api.c	Tue Jul 09 08:19:24 2019 +0200
     1.3 @@ -3126,7 +3126,6 @@
     1.4  }
     1.5  
     1.6  static PEP_STATUS reconcile_sent_and_recv_info(message* src, message* inner_message) {
     1.7 -    PEP_STATUS status = PEP_STATUS_OK;
     1.8      if (!src || !inner_message)
     1.9          return PEP_ILLEGAL_VALUE;
    1.10          
     2.1 --- a/src/pEpEngine.c	Mon Jul 08 09:26:12 2019 +0200
     2.2 +++ b/src/pEpEngine.c	Tue Jul 09 08:19:24 2019 +0200
     2.3 @@ -4251,8 +4251,27 @@
     2.4      if (!(session && pattern && keylist))
     2.5          return PEP_ILLEGAL_VALUE;
     2.6  
     2.7 -    return session->cryptotech[PEP_crypt_OpenPGP].find_keys(session, pattern,
     2.8 -            keylist);
     2.9 +    PEP_STATUS status = session->cryptotech[PEP_crypt_OpenPGP].find_keys(session, pattern,
    2.10 +                                                                         keylist);
    2.11 +                                                                         
    2.12 +#ifndef USE_GPG
    2.13 +    if (*keylist == NULL) {
    2.14 +        // we have a problem, in that older GPG keys with no username associated don't 
    2.15 +        // quote out the address-as-username, meaning the uid is non-standard.
    2.16 +        // sequoia then stores the whole uid string for lookup, so we try again here with 
    2.17 +        // a whole-uid-pattern:
    2.18 +        if (strchr(pattern, '@')) {
    2.19 +            char* new_pattern = calloc(2*strlen(pattern) + 4, 1);
    2.20 +            int n = sprintf(new_pattern, "%s <%s>", pattern, pattern);
    2.21 +            if (n > 0)
    2.22 +                status = session->cryptotech[PEP_crypt_OpenPGP].find_keys(session, new_pattern,
    2.23 +                                                                          keylist);
    2.24 +            free(new_pattern);                                                                      
    2.25 +        }    
    2.26 +    }
    2.27 +#endif 
    2.28 +    
    2.29 +    return status;
    2.30  }
    2.31  
    2.32  
     3.1 --- a/test/src/SuiteMaker.cc	Mon Jul 08 09:26:12 2019 +0200
     3.2 +++ b/test/src/SuiteMaker.cc	Tue Jul 09 08:19:24 2019 +0200
     3.3 @@ -21,7 +21,6 @@
     3.4  #include "Engine463Tests.h"
     3.5  #include "IOS1664Tests.h"
     3.6  #include "BloblistTests.h"
     3.7 -#include "KeyImportAndRetrieveTests.h"
     3.8  #include "NewUpdateIdAndMyselfTests.h"
     3.9  #include "NoOwnIdentWritesOnDecryptTests.h"
    3.10  #include "LiteralFilenameTests.h"
    3.11 @@ -88,7 +87,6 @@
    3.12      "Engine463Tests",
    3.13      "IOS1664Tests",
    3.14      "BloblistTests",
    3.15 -    "KeyImportAndRetrieveTests",
    3.16      "NewUpdateIdAndMyselfTests",
    3.17      "NoOwnIdentWritesOnDecryptTests",
    3.18      "LiteralFilenameTests",
    3.19 @@ -146,7 +144,7 @@
    3.20  };
    3.21  
    3.22  // This file is generated, so magic constants are ok.
    3.23 -int SuiteMaker::num_suites = 64;
    3.24 +int SuiteMaker::num_suites = 63;
    3.25  
    3.26  void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
    3.27      if (strcmp(test_class_name, "URIAddressTests") == 0)
    3.28 @@ -167,8 +165,6 @@
    3.29          *test_suite = new IOS1664Tests(test_class_name, test_home);
    3.30      else if (strcmp(test_class_name, "BloblistTests") == 0)
    3.31          *test_suite = new BloblistTests(test_class_name, test_home);
    3.32 -    else if (strcmp(test_class_name, "KeyImportAndRetrieveTests") == 0)
    3.33 -        *test_suite = new KeyImportAndRetrieveTests(test_class_name, test_home);
    3.34      else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
    3.35          *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
    3.36      else if (strcmp(test_class_name, "NoOwnIdentWritesOnDecryptTests") == 0)