merged in default local_cpptest
authorKrista Bennett <krista@pep-project.org>
Tue, 08 May 2018 11:09:11 +0200
branchlocal_cpptest
changeset 2660485b9eaf1b5d
parent 2655 6ace263181b8
parent 2659 5d0dcfb29de6
child 2661 2b0b15a718bc
merged in default
     1.1 --- a/src/message_api.c	Mon May 07 17:42:40 2018 +0200
     1.2 +++ b/src/message_api.c	Tue May 08 11:09:11 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/src/message_api.h	Mon May 07 17:42:40 2018 +0200
     2.2 +++ b/src/message_api.h	Tue May 08 11:09:11 2018 +0200
     2.3 @@ -12,8 +12,8 @@
     2.4  extern "C" {
     2.5  #endif
     2.6  
     2.7 -
     2.8  bool import_attached_keys(
     2.9 +    
    2.10          PEP_SESSION session, 
    2.11          const message *msg,
    2.12          identity_list **private_idents
    2.13 @@ -269,7 +269,9 @@
    2.14  //      session (in)        session handle
    2.15  //      src (inout)         message to decrypt
    2.16  //      dst (out)           pointer to new decrypted message or NULL on failure
    2.17 -//      keylist (out)       stringlist with keyids
    2.18 +//      keylist (inout)     in: stringlist with additional keyids for reencryption if needed
    2.19 +//                              (will be freed and replaced with output keylist) 
    2.20 +//                          out: stringlist with keyids
    2.21  //      rating (out)        rating for the message
    2.22  //      flags (inout)       flags to signal special decryption features
    2.23  //
    2.24 @@ -327,7 +329,9 @@
    2.25  //      mimetext (in)           MIME encoded text to decrypt
    2.26  //      size (in)               size of mime text to decode (in order to decrypt)
    2.27  //      mime_plaintext (out)    decrypted, encoded message
    2.28 -//      keylist (out)           stringlist with keyids
    2.29 +//      keylist (inout)         in: stringlist with additional keyids for reencryption if needed
    2.30 +//                                  (will be freed and replaced with output keylist)
    2.31 +//                              out: stringlist with keyids
    2.32  //      rating (out)            rating for the message
    2.33  //      flags (inout)           flags to signal special decryption features (see below)
    2.34  //      modified_src (out)      modified source string, if decrypt had reason to change it
     3.1 --- a/test/reencrypt_plus_extra_keys_test.cc	Mon May 07 17:42:40 2018 +0200
     3.2 +++ b/test/reencrypt_plus_extra_keys_test.cc	Tue May 08 11:09:11 2018 +0200
     3.3 @@ -108,10 +108,10 @@
     3.4      cout << "Status is " << tl_status_string(status) << endl;
     3.5      assert(decrypted_text);
     3.6      assert(rating);
     3.7 -    assert(flags & PEP_decrypt_flag_src_modified);
     3.8 +    assert(!(flags & PEP_decrypt_flag_src_modified));
     3.9      
    3.10 -    assert(modified_src);
    3.11 -    cout << modified_src << endl;
    3.12 +    assert(!modified_src);
    3.13 +    //cout << modified_src << endl;
    3.14      
    3.15      free(decrypted_text);
    3.16      decrypted_text = nullptr;