MIME_decrypt_message now returns the decrypt status instead of PEP_UNKNOWN_ERROR if there is no message returned by decrypt message.
authorKrista Bennett <krista@pep-project.org>
Mon, 15 May 2017 15:02:46 +0200
changeset 178343f02b40d5f0
parent 1782 a070b3ce5af4
child 1784 dc910648bc32
child 1791 0253b2e1b8ff
MIME_decrypt_message now returns the decrypt status instead of PEP_UNKNOWN_ERROR if there is no message returned by decrypt message.
src/message_api.c
     1.1 --- a/src/message_api.c	Fri May 12 18:07:54 2017 +0200
     1.2 +++ b/src/message_api.c	Mon May 15 15:02:46 2017 +0200
     1.3 @@ -2511,19 +2511,12 @@
     1.4          dec_msg = message_dup(tmp_msg);
     1.5      }
     1.6          
     1.7 -    // This is for when errors are seriously fatal, not just decryption probs
     1.8 -    // Unlikely to happen.
     1.9 -    if (decrypt_status > PEP_CANNOT_DECRYPT_UNKNOWN)
    1.10 +    if (decrypt_status > PEP_CANNOT_DECRYPT_UNKNOWN || !dec_msg)
    1.11      {
    1.12          status = decrypt_status;
    1.13          GOTO(pep_error);
    1.14      }
    1.15  
    1.16 -    if (!dec_msg) {
    1.17 -        status = PEP_UNKNOWN_ERROR;
    1.18 -        GOTO(pep_error);
    1.19 -    }
    1.20 -
    1.21      status = mime_encode_message(dec_msg, false, mime_plaintext);
    1.22  
    1.23      if (status == PEP_STATUS_OK)