decrypt_message() returns PEP_STATUS_OK when decrypted and verified, not PEP_DECRYPTED_AND_VERIFIED. Exception that proves the rule.
authorEdouard Tisserant <edouard@pep-project.org>
Thu, 15 Jun 2017 10:52:50 +0200
changeset 1859acf5c59a49e3
parent 1858 600dc0395ec0
child 1860 1975a3b9bc37
child 1862 881f5a1d8a40
decrypt_message() returns PEP_STATUS_OK when decrypted and verified, not PEP_DECRYPTED_AND_VERIFIED. Exception that proves the rule.
src/message_api.c
     1.1 --- a/src/message_api.c	Wed Jun 14 19:37:20 2017 +0200
     1.2 +++ b/src/message_api.c	Thu Jun 15 10:52:50 2017 +0200
     1.3 @@ -2053,8 +2053,6 @@
     1.4  
     1.5          if (status != PEP_STATUS_OK)
     1.6              GOTO(pep_error);
     1.7 -
     1.8 -        status = decrypt_status;
     1.9      }
    1.10      else
    1.11      {
    1.12 @@ -2090,7 +2088,6 @@
    1.13                              PEP_decrypt_flag_ignore :
    1.14                              PEP_decrypt_flag_consume;
    1.15  
    1.16 -                status = decrypt_status;
    1.17              }
    1.18              else if (status != PEP_STATUS_OK){
    1.19                  goto pep_error;
    1.20 @@ -2109,7 +2106,10 @@
    1.21      *dst = msg;
    1.22      *keylist = _keylist;
    1.23  
    1.24 -    return ADD_TO_LOG(status);
    1.25 +    if(decrypt_status == PEP_DECRYPTED_AND_VERIFIED)
    1.26 +        return ADD_TO_LOG(PEP_STATUS_OK);
    1.27 +    else
    1.28 +        return ADD_TO_LOG(decrypt_status);
    1.29  
    1.30  enomem:
    1.31      status = PEP_OUT_OF_MEMORY;