fixed MIME_encode_message bug.
authorKrista Bennett <krista@pep-project.org>
Wed, 11 Oct 2017 15:46:04 +0200
changeset 2154326bdd83df88
parent 2150 cfbfa7df0b07
child 2158 c96ee66f4fc8
child 2160 5f5fe1d047ee
fixed MIME_encode_message bug.
src/message_api.c
src/mime.c
     1.1 --- a/src/message_api.c	Tue Oct 10 10:24:22 2017 +0200
     1.2 +++ b/src/message_api.c	Wed Oct 11 15:46:04 2017 +0200
     1.3 @@ -3025,6 +3025,9 @@
     1.4          GOTO(pep_error);
     1.5      }
     1.6  
     1.7 +    // Clear the encryption status, or mime_encode will ignore
     1.8 +    // the plaintext and do all sorts of other stupid things
     1.9 +    enc_msg->enc_format = PEP_enc_none;
    1.10      status = mime_encode_message(enc_msg, false, mime_ciphertext);
    1.11  
    1.12  pep_error:
     2.1 --- a/src/mime.c	Tue Oct 10 10:24:22 2017 +0200
     2.2 +++ b/src/mime.c	Wed Oct 11 15:46:04 2017 +0200
     2.3 @@ -819,14 +819,12 @@
     2.4  	struct mailmime_parameter * param;
     2.5      int r;
     2.6      PEP_STATUS status;
     2.7 -    //char *subject;
     2.8      char *plaintext;
     2.9      size_t plaintext_size;
    2.10  
    2.11      assert(msg->attachments && msg->attachments->next &&
    2.12              msg->attachments->next->value);
    2.13  
    2.14 -    //subject = (msg->shortmsg) ? msg->shortmsg : "pEp"; // not used, yet.
    2.15      plaintext = msg->attachments->next->value;
    2.16      plaintext_size = msg->attachments->next->size;
    2.17