ENGINE-423 - this MAY have fixed the no-reencrypt-for-self issue, but we need real tests to figure out what's going on, so shelving this briefly to finish up the tests.
authorKrista Bennett <krista@pep-project.org>
Tue, 08 May 2018 10:50:10 +0200
changeset 26595d0dcfb29de6
parent 2658 b9d02eaf6b90
child 2660 485b9eaf1b5d
child 2663 5bcf7e1d9025
child 2665 574f882fe6a0
ENGINE-423 - this MAY have fixed the no-reencrypt-for-self issue, but we need real tests to figure out what's going on, so shelving this briefly to finish up the tests.
src/message_api.c
test/reencrypt_plus_extra_keys_test.cc
     1.1 --- a/src/message_api.c	Tue May 08 10:38:57 2018 +0200
     1.2 +++ b/src/message_api.c	Tue May 08 10:50:10 2018 +0200
     1.3 @@ -3012,7 +3012,7 @@
     1.4      bool is_pep_msg = is_a_pEpmessage(src);
     1.5  
     1.6      // Grab input flags
     1.7 -    bool reencrypt = ((*flags & PEP_decrypt_flag_untrusted_server) > 0);
     1.8 +    bool reencrypt = (((*flags & PEP_decrypt_flag_untrusted_server) > 0) && *keylist && !EMPTYSTR((*keylist)->value));
     1.9      
    1.10      // We own this pointer, and we take control of *keylist if reencrypting.
    1.11      stringlist_t* extra = NULL;
     2.1 --- a/test/reencrypt_plus_extra_keys_test.cc	Tue May 08 10:38:57 2018 +0200
     2.2 +++ b/test/reencrypt_plus_extra_keys_test.cc	Tue May 08 10:50:10 2018 +0200
     2.3 @@ -108,10 +108,10 @@
     2.4      cout << "Status is " << tl_status_string(status) << endl;
     2.5      assert(decrypted_text);
     2.6      assert(rating);
     2.7 -    assert(flags & PEP_decrypt_flag_src_modified);
     2.8 +    assert(!(flags & PEP_decrypt_flag_src_modified));
     2.9      
    2.10 -    assert(modified_src);
    2.11 -    cout << modified_src << endl;
    2.12 +    assert(!modified_src);
    2.13 +    //cout << modified_src << endl;
    2.14      
    2.15      free(decrypted_text);
    2.16      decrypted_text = nullptr;