ENGINE-198: ensured MIME_decrypt_message will treat unencrypted or signed-only texts correctly ENGINE-198
authorKrista Bennett <krista@pep-project.org>
Tue, 02 May 2017 09:27:04 +0200
branchENGINE-198
changeset 174367f9eecd5535
parent 1741 5bd49bd73192
child 1744 4d42c179c6bb
child 2733 8469dff8f958
ENGINE-198: ensured MIME_decrypt_message will treat unencrypted or signed-only texts correctly
src/message_api.c
     1.1 --- a/src/message_api.c	Tue May 02 08:48:35 2017 +0200
     1.2 +++ b/src/message_api.c	Tue May 02 09:27:04 2017 +0200
     1.3 @@ -2569,6 +2569,11 @@
     1.4                                                  keylist,
     1.5                                                  rating,
     1.6                                                  flags);
     1.7 +                                                
     1.8 +    if (!dec_msg && (decrypt_status == PEP_UNENCRYPTED || decrypt_status == PEP_VERIFIED)) {
     1.9 +        dec_msg = message_dup(tmp_msg);
    1.10 +    }
    1.11 +        
    1.12      if (decrypt_status > PEP_CANNOT_DECRYPT_UNKNOWN)
    1.13      {
    1.14          status = decrypt_status;
    1.15 @@ -2582,6 +2587,7 @@
    1.16      if (status == PEP_STATUS_OK)
    1.17      {
    1.18          free(tmp_msg);
    1.19 +        free(dec_msg);
    1.20          return decrypt_status;
    1.21      }
    1.22