Merged in default ENGINE-442
authorKrista Bennett <krista@pep-project.org>
Wed, 27 Jun 2018 17:10:08 +0200
branchENGINE-442
changeset 2778aef57434e32b
parent 2769 e9eb2387f9d1
parent 2775 a513ca50bcd9
child 2779 7618e2247a78
child 2780 5f0c7d00b5bb
Merged in default
src/message_api.c
     1.1 --- a/src/message_api.c	Tue Jun 26 13:45:27 2018 +0200
     1.2 +++ b/src/message_api.c	Wed Jun 27 17:10:08 2018 +0200
     1.3 @@ -1589,6 +1589,8 @@
     1.4      if (src->enc_format != PEP_enc_none)
     1.5          return PEP_ILLEGAL_VALUE;
     1.6  
     1.7 +    bool force_v_1 = flags & PEP_encrypt_flag_force_version_1;
     1.8 +    
     1.9      *dst = NULL;
    1.10  
    1.11      if (src->from && (!src->from->user_id || src->from->user_id[0] == '\0')) {
    1.12 @@ -1806,7 +1808,7 @@
    1.13      }
    1.14      else {
    1.15          // FIXME - we need to deal with transport types (via flag)
    1.16 -        if ((max_comm_type | PEP_ct_confirmed) == PEP_ct_pEp) {
    1.17 +        if ((!force_v_1) && ((max_comm_type | PEP_ct_confirmed) == PEP_ct_pEp)) {
    1.18              _src = wrap_message_as_attachment(NULL, src, false);
    1.19              if (!_src)
    1.20                  goto pep_error;
    1.21 @@ -2051,7 +2053,7 @@
    1.22      }
    1.23              
    1.24      // Ok, it's in there. Let's do this.        
    1.25 -    status = encrypt_message(session, src, keys, dst, enc_format, 0);
    1.26 +    status = encrypt_message(session, src, keys, dst, enc_format, flags);
    1.27      
    1.28      // Delete what we added to src
    1.29      free_bloblist(created_bl);
     2.1 --- a/src/message_api.h	Tue Jun 26 13:45:27 2018 +0200
     2.2 +++ b/src/message_api.h	Wed Jun 27 17:10:08 2018 +0200
     2.3 @@ -37,7 +37,11 @@
     2.4      
     2.5      // This is used for outer messages (used to wrap the real message)
     2.6      // This is only used internally and (eventually) by transport functions
     2.7 -    PEP_encrypt_flag_inner_message = 0x8
     2.8 +    PEP_encrypt_flag_inner_message = 0x8,
     2.9 +    
    2.10 +    // This is mainly used by pEp clients to send private keys to 
    2.11 +    // their own PGP-only device
    2.12 +    PEP_encrypt_flag_force_version_1 = 0x16
    2.13      
    2.14  } PEP_encrypt_flags; 
    2.15  
     3.1 --- a/src/pEpEngine.h	Tue Jun 26 13:45:27 2018 +0200
     3.2 +++ b/src/pEpEngine.h	Wed Jun 27 17:10:08 2018 +0200
     3.3 @@ -300,9 +300,9 @@
     3.4  //
     3.5  //    return value:
     3.6  //        PEP_STATUS_OK = 0            encryption and signing succeeded
     3.7 -//        PEP_KEY_NOT_FOUND            at least one of the receipient keys
     3.8 +//        PEP_KEY_NOT_FOUND            at least one of the recipient keys
     3.9  //                                     could not be found
    3.10 -//        PEP_KEY_HAS_AMBIG_NAME       at least one of the receipient keys has
    3.11 +//        PEP_KEY_HAS_AMBIG_NAME       at least one of the recipient keys has
    3.12  //                                     an ambiguous name
    3.13  //        PEP_GET_KEY_FAILED           cannot retrieve key
    3.14  //
    3.15 @@ -462,7 +462,7 @@
    3.16      PEP_ct_confirmed_encryption = 0x90,         // generic
    3.17      PEP_ct_OpenPGP_weak = 0x91,                 // RSA 1024 is weak (unused)
    3.18  
    3.19 -    PEP_ct_to_be_checked_confirmed = 0xa0,      //generic
    3.20 +    PEP_ct_to_be_checked_confirmed = 0xa0,      // generic
    3.21      PEP_ct_SMIME = 0xa1,
    3.22      PEP_ct_CMS = 0xa2,
    3.23  
     4.1 Binary file test/test_files/427_old_db has changed