Added own key attachement, even when encryption format is PEP_enc_PGP_MIME
authorEdouard Tisserant
Sat, 21 Nov 2015 18:47:19 +0100
changeset 3920680d1c13fd3
parent 391 81b082c062d5
child 393 3ad45d1e318c
Added own key attachement, even when encryption format is PEP_enc_PGP_MIME
src/message_api.c
     1.1 --- a/src/message_api.c	Wed Nov 18 13:37:47 2015 +0100
     1.2 +++ b/src/message_api.c	Sat Nov 21 18:47:19 2015 +0100
     1.3 @@ -947,24 +947,12 @@
     1.4          case PEP_enc_PGP_MIME:
     1.5          case PEP_enc_PEP: // BUG: should be implemented extra
     1.6              status = encrypt_PGP_MIME(session, src, keys, msg);
     1.7 -            if (status != PEP_STATUS_OK)
     1.8 -                goto pep_error;
     1.9              break;
    1.10  
    1.11          case PEP_enc_pieces:
    1.12              status = encrypt_PGP_in_pieces(session, src, keys, msg);
    1.13 -            if (status == PEP_OUT_OF_MEMORY)
    1.14 -                goto enomem;
    1.15 -            if (status != PEP_STATUS_OK) {
    1.16 -                attach_own_key(session, src);
    1.17 -                goto pep_error;
    1.18 -            }
    1.19 -            else {
    1.20 -                attach_own_key(session, msg);
    1.21 -            }
    1.22              break;
    1.23  
    1.24 -
    1.25          /* case PEP_enc_PEP:
    1.26              // TODO: implement
    1.27              NOT_IMPLEMENTED */
    1.28 @@ -974,6 +962,17 @@
    1.29              status = PEP_ILLEGAL_VALUE;
    1.30              goto pep_error;
    1.31          }
    1.32 +        
    1.33 +        if (status == PEP_OUT_OF_MEMORY)
    1.34 +            goto enomem;
    1.35 +        
    1.36 +        if (status != PEP_STATUS_OK) {
    1.37 +            attach_own_key(session, src);
    1.38 +            goto pep_error;
    1.39 +        }
    1.40 +        else {
    1.41 +            attach_own_key(session, msg);
    1.42 +        }
    1.43      }
    1.44  
    1.45      free_stringlist(keys);