No idea of any of this WORKS, but it doesn't break anything OLD. ENGINE-633
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Sun, 22 Sep 2019 21:41:35 +0200
branchENGINE-633
changeset 4079da3b0627a59c
parent 4078 516e17803980
child 4080 2f2d566db998
No idea of any of this WORKS, but it doesn't break anything OLD.
src/baseprotocol.c
src/cryptotech.h
src/etpan_mime.c
src/message.h
src/message_api.c
src/pEpEngine.c
src/pEpEngine.h
src/pEp_internal.h
src/pgp_gpg.c
src/pgp_gpg.h
src/pgp_gpg_internal.h
src/pgp_netpgp.c
src/pgp_netpgp.h
src/pgp_sequoia.h
test/src/Message2_1Test.cc
test/src/SignOnlyTest.cc
     1.1 --- a/src/baseprotocol.c	Sun Sep 22 15:02:37 2019 +0200
     1.2 +++ b/src/baseprotocol.c	Sun Sep 22 21:41:35 2019 +0200
     1.3 @@ -32,7 +32,7 @@
     1.4      if (fpr && fpr[0] != '\0') {
     1.5          char *sign;
     1.6          size_t sign_size;
     1.7 -        status = sign_only(session,  payload, size, fpr, &sign, &sign_size);
     1.8 +        status = sign_only(session,  payload, size, fpr, &sign, &sign_size, NULL);
     1.9          if (status)
    1.10              goto error;
    1.11  
     2.1 --- a/src/cryptotech.h	Sun Sep 22 15:02:37 2019 +0200
     2.2 +++ b/src/cryptotech.h	Sun Sep 22 21:41:35 2019 +0200
     2.3 @@ -40,7 +40,7 @@
     2.4  
     2.5  typedef PEP_STATUS (*sign_only_t)(
     2.6          PEP_SESSION session, const char* fpr, const char *ptext,
     2.7 -        size_t psize, char **stext, size_t *ssize
     2.8 +        size_t psize, char **stext, size_t *ssize, PEP_HASH_ALGO* micalg
     2.9      );
    2.10  
    2.11  typedef PEP_STATUS (*delete_keypair_t)(PEP_SESSION session, const char *fpr);
     3.1 --- a/src/etpan_mime.c	Sun Sep 22 15:02:37 2019 +0200
     3.2 +++ b/src/etpan_mime.c	Sun Sep 22 21:41:35 2019 +0200
     3.3 @@ -1893,6 +1893,77 @@
     3.4      return status;
     3.5  }
     3.6  
     3.7 +static PEP_STATUS mime_encode_message_sign_only(
     3.8 +        const message * msg,
     3.9 +        bool omit_fields,
    3.10 +        struct mailmime **result
    3.11 +    )
    3.12 +{
    3.13 +    struct mailmime * mime = NULL;
    3.14 +    struct mailmime * submime = NULL;
    3.15 +	struct mailmime_parameter * param;
    3.16 +    int r;
    3.17 +    PEP_STATUS status;
    3.18 +    char *plaintext;
    3.19 +    size_t plaintext_size;
    3.20 +
    3.21 +    assert(msg->attachments && msg->attachments->next &&
    3.22 +            msg->attachments->next->value);
    3.23 +
    3.24 +    plaintext = msg->attachments->next->value;
    3.25 +    plaintext_size = msg->attachments->next->size;
    3.26 +
    3.27 +    mime = part_multiple_new("multipart/signed");
    3.28 +    assert(mime);
    3.29 +    if (mime == NULL)
    3.30 +        goto enomem;
    3.31 +
    3.32 +    if (msg->attachments && msg->attachments->value && msg->attachments->mime_type) {
    3.33 +        if (strcmp(msg->attachments->mime_type, "multipart/signed")) {
    3.34 +            param = mailmime_param_new_with_data("micalg", strdup(msg->attachments->value));
    3.35 +            clist_append(mime->mm_content_type->ct_parameters, param);    
    3.36 +        }
    3.37 +    }
    3.38 +
    3.39 +    r = mailmime_set_body_text(mime, msg->longmsg, strlen(msg->longmsg));
    3.40 +    if (r != 0)
    3.41 +        goto enomem;
    3.42 +            
    3.43 +    pEp_rid_list_t* resource = new_rid_node(PEP_RID_FILENAME, "signature.asc");
    3.44 +    submime = get_text_part(resource, "application/pgp-signature", msg->attachments->next->value,
    3.45 +            msg->attachments->next->size, MAILMIME_MECHANISM_7BIT);
    3.46 +            
    3.47 +    free_rid_list(resource);
    3.48 +    
    3.49 +    assert(submime);
    3.50 +    if (submime == NULL)
    3.51 +        goto enomem;
    3.52 +
    3.53 +    r = mailmime_smart_add_part(mime, submime);
    3.54 +    assert(r == MAILIMF_NO_ERROR);
    3.55 +    if (r == MAILIMF_ERROR_MEMORY) {
    3.56 +        goto enomem;
    3.57 +    }
    3.58 +    else {
    3.59 +        // mailmime_smart_add_part() takes ownership of submime
    3.60 +        submime = NULL;
    3.61 +    }
    3.62 +
    3.63 +    *result = mime;
    3.64 +    return PEP_STATUS_OK;
    3.65 +
    3.66 +enomem:
    3.67 +    status = PEP_OUT_OF_MEMORY;
    3.68 +
    3.69 +    if (mime)
    3.70 +        mailmime_free(mime);
    3.71 +
    3.72 +    if (submime)
    3.73 +        mailmime_free(submime);
    3.74 +
    3.75 +    return status;
    3.76 +}
    3.77 +
    3.78  PEP_STATUS _mime_encode_message_internal(
    3.79          const message * msg,
    3.80          bool omit_fields,
    3.81 @@ -1935,6 +2006,10 @@
    3.82  
    3.83          case PEP_enc_PEP:
    3.84              NOT_IMPLEMENTED
    3.85 +            
    3.86 +        case PEP_enc_sign_only:
    3.87 +            status = mime_encode_message_sign_only(msg, omit_fields, &mime);
    3.88 +            break;
    3.89  
    3.90          default:
    3.91              NOT_IMPLEMENTED
     4.1 --- a/src/message.h	Sun Sep 22 15:02:37 2019 +0200
     4.2 +++ b/src/message.h	Sun Sep 22 21:41:35 2019 +0200
     4.3 @@ -35,7 +35,8 @@
     4.4      PEP_enc_S_MIME,                         // RFC5751
     4.5      PEP_enc_PGP_MIME,                       // RFC3156
     4.6      PEP_enc_PEP,                            // pEp encryption format
     4.7 -    PEP_enc_PGP_MIME_Outlook1               // Message B0rken by Outlook type 1
     4.8 +    PEP_enc_PGP_MIME_Outlook1,              // Message B0rken by Outlook type 1
     4.9 +    PEP_enc_sign_only                       // signed, but not encrypted, PGP messages
    4.10  } PEP_enc_format;
    4.11  
    4.12  struct _message_ref_list;
     5.1 --- a/src/message_api.c	Sun Sep 22 15:02:37 2019 +0200
     5.2 +++ b/src/message_api.c	Sun Sep 22 21:41:35 2019 +0200
     5.3 @@ -1030,7 +1030,7 @@
     5.4      if (status != PEP_STATUS_OK)
     5.5          goto pEp_error;
     5.6  
     5.7 -    if (free_ptext){
     5.8 +    if (free_ptext){ 
     5.9          free(ptext);
    5.10          free_ptext=0;
    5.11      }
    5.12 @@ -1084,6 +1084,91 @@
    5.13      return status;
    5.14  }
    5.15  
    5.16 +static PEP_STATUS sign_PGP_MIME(
    5.17 +    PEP_SESSION session,
    5.18 +    const message *src,
    5.19 +    const char* sign_fpr,
    5.20 +    message *dst
    5.21 +    )
    5.22 +{
    5.23 +    PEP_STATUS status = PEP_STATUS_OK;
    5.24 +    char *stext = NULL;
    5.25 +    char *mimetext = NULL;
    5.26 +    size_t ssize;
    5.27 +    assert(dst->longmsg == NULL);
    5.28 +    dst->enc_format = PEP_enc_none;
    5.29 +
    5.30 +    if (src->shortmsg)
    5.31 +        dst->shortmsg = strdup(src->shortmsg);
    5.32 +        
    5.33 +    message *_src = calloc(1, sizeof(message));
    5.34 +    assert(_src);
    5.35 +    if (_src == NULL)
    5.36 +        goto enomem;
    5.37 +    _src->longmsg = src->longmsg;
    5.38 +    _src->longmsg_formatted = src->longmsg_formatted;
    5.39 +    _src->attachments = src->attachments;
    5.40 +    _src->enc_format = PEP_enc_none;
    5.41 +    
    5.42 +    // These vars are here to be clear, and because I don't know how this may change in the near future.
    5.43 +    status = _mime_encode_message_internal(_src, true, &mimetext, true, true);
    5.44 +    assert(status == PEP_STATUS_OK);
    5.45 +    if (status != PEP_STATUS_OK)
    5.46 +        goto pEp_error;
    5.47 +
    5.48 +    free(_src);
    5.49 +    _src = NULL;
    5.50 +    assert(mimetext);
    5.51 +    if (EMPTYSTR(mimetext))
    5.52 +        goto pEp_error;
    5.53 +        
    5.54 +    PEP_HASH_ALGO micalg = UNKNOWN_HASH_ALGO;
    5.55 +        
    5.56 +    status = sign_only(session, mimetext,
    5.57 +                       strlen(mimetext),
    5.58 +                       sign_fpr, 
    5.59 +                       &stext, &ssize, &micalg);
    5.60 +        
    5.61 +    if (stext == NULL)
    5.62 +        goto pEp_error;
    5.63 +
    5.64 +    dst->longmsg = strdup(mimetext);
    5.65 +    assert(dst->longmsg);
    5.66 +    if (dst->longmsg == NULL)
    5.67 +        goto enomem;
    5.68 +
    5.69 +    const char* micalg_string = get_micalg_string(micalg);
    5.70 +    if (!micalg_string) {
    5.71 +        status = PEP_UNKNOWN_ERROR;
    5.72 +        goto pEp_error;    
    5.73 +    }
    5.74 +        
    5.75 +    char *v = strdup(micalg_string);
    5.76 +    assert(v);
    5.77 +    if (v == NULL)
    5.78 +        goto enomem;
    5.79 +
    5.80 +    bloblist_t *_a = new_bloblist(v, strlen(v), "multipart/signed", NULL);
    5.81 +    if (_a == NULL)
    5.82 +        goto enomem;
    5.83 +    dst->attachments = _a;
    5.84 +
    5.85 +    _a = bloblist_add(_a, stext, ssize, "application/pgp-signature",
    5.86 +        "file://signature.asc");
    5.87 +    if (_a == NULL)
    5.88 +        goto enomem;
    5.89 +
    5.90 +    return PEP_STATUS_OK;
    5.91 +
    5.92 +enomem:
    5.93 +    status = PEP_OUT_OF_MEMORY;
    5.94 +
    5.95 +pEp_error:
    5.96 +    free(_src);
    5.97 +    free(stext);
    5.98 +    return status;
    5.99 +}
   5.100 +
   5.101  /*
   5.102  static bool _has_PGP_MIME_format(message* msg) {
   5.103      if (!msg || !msg->attachments || !msg->attachments->next)
     6.1 --- a/src/pEpEngine.c	Sun Sep 22 15:02:37 2019 +0200
     6.2 +++ b/src/pEpEngine.c	Sun Sep 22 21:41:35 2019 +0200
     6.3 @@ -4360,7 +4360,8 @@
     6.4                       size_t data_size, 
     6.5                       const char *fpr, 
     6.6                       char **sign, 
     6.7 -                     size_t *sign_size) {
     6.8 +                     size_t *sign_size,
     6.9 +                     PEP_HASH_ALGO* hash_algo) {
    6.10      assert(session);
    6.11      assert(fpr);
    6.12      assert(data);
    6.13 @@ -4372,7 +4373,7 @@
    6.14          return PEP_ILLEGAL_VALUE;
    6.15  
    6.16      return session->cryptotech[PEP_crypt_OpenPGP].sign_only(session,
    6.17 -                                fpr, data, data_size, sign, sign_size);
    6.18 +                                fpr, data, data_size, sign, sign_size, hash_algo);
    6.19                           
    6.20  }
    6.21  
     7.1 --- a/src/pEpEngine.h	Sun Sep 22 15:02:37 2019 +0200
     7.2 +++ b/src/pEpEngine.h	Sun Sep 22 21:41:35 2019 +0200
     7.3 @@ -1406,12 +1406,47 @@
     7.4          const char *fpr,
     7.5          identity_list **identities);
     7.6          
     7.7 +/*
     7.8 +    'pgp-md5',
     7.9 +    'pgp-sha1',
    7.10 +    'pgp-ripemd160',
    7.11 +    'pgp-md2',
    7.12 +    'pgp-tiger192',
    7.13 +    'pgp-haval',
    7.14 +    'pgp-sha256',
    7.15 +    'pgp-sha384',
    7.16 +    'pgp-sha512',
    7.17 +    'pgp-md4',
    7.18 +    'pgp-crc32',
    7.19 +    'pgp-crc32rfc1510',
    7.20 +    'pgp-crc24rfc2440'
    7.21 +*/
    7.22 +           
    7.23 +typedef enum {
    7.24 +    MD5,
    7.25 +    SHA1,
    7.26 +    RMD160,
    7.27 +    MD2,
    7.28 +    TIGER,
    7.29 +    HAVAL,
    7.30 +    SHA256,
    7.31 +    SHA384,
    7.32 +    SHA512,
    7.33 +    SHA224,
    7.34 +    MD4,
    7.35 +    CRC32,
    7.36 +    CRC32_RFC1510,
    7.37 +    CRC32_RFC2440,
    7.38 +    UNKNOWN_HASH_ALGO
    7.39 +} PEP_HASH_ALGO;
    7.40 +        
    7.41  PEP_STATUS sign_only(PEP_SESSION session, 
    7.42                       const char *data, 
    7.43                       size_t data_size, 
    7.44                       const char *fpr, 
    7.45                       char **sign, 
    7.46 -                     size_t *sign_size);
    7.47 +                     size_t *sign_size,
    7.48 +                     PEP_HASH_ALGO* hash_algo);
    7.49  
    7.50  #ifdef __cplusplus
    7.51  }
     8.1 --- a/src/pEp_internal.h	Sun Sep 22 15:02:37 2019 +0200
     8.2 +++ b/src/pEp_internal.h	Sun Sep 22 21:41:35 2019 +0200
     8.3 @@ -573,3 +573,38 @@
     8.4      } while (rc == SQLITE_BUSY || rc == SQLITE_LOCKED);
     8.5      return rc;
     8.6  }
     8.7 +
     8.8 +static inline const char* get_micalg_string(PEP_HASH_ALGO micalg) {
     8.9 +    switch (micalg) {
    8.10 +        case MD5:
    8.11 +            return "pgp-md5";
    8.12 +        case SHA1:    
    8.13 +            return "pgp-sha1";
    8.14 +        case RMD160:
    8.15 +            return "pgp-ripemd160";
    8.16 +        case MD2:    
    8.17 +            return "pgp-md2";
    8.18 +        case TIGER:    
    8.19 +            return "pgp-tiger192";
    8.20 +        case HAVAL:    
    8.21 +            return "pgp-haval";
    8.22 +        case SHA256:    
    8.23 +            return "pgp-sha256";
    8.24 +        case SHA384:    
    8.25 +            return "pgp-sha384";
    8.26 +        case SHA512:    
    8.27 +            return "pgp-sha512";
    8.28 +        case SHA224:    
    8.29 +            return "pgp-sha224";
    8.30 +        case MD4:                
    8.31 +            return "pgp-md4";
    8.32 +        case CRC32:    
    8.33 +            return "pgp-crc32";
    8.34 +        case CRC32_RFC1510:    
    8.35 +            return "pgp-crc32rfc1510";
    8.36 +        case CRC32_RFC2440:    
    8.37 +            return "pgp-crc24rfc2440";
    8.38 +        default:
    8.39 +            return NULL;
    8.40 +    }
    8.41 +}
     9.1 --- a/src/pgp_gpg.c	Sun Sep 22 15:02:37 2019 +0200
     9.2 +++ b/src/pgp_gpg.c	Sun Sep 22 21:41:35 2019 +0200
     9.3 @@ -356,6 +356,7 @@
     9.4          DLOAD(gpgme_op_encrypt_sign);
     9.5          DLOAD(gpgme_op_encrypt);
     9.6          DLOAD(gpgme_op_sign);
     9.7 +        DLOAD(gpgme_op_sign_result);
     9.8          DLOAD(gpgme_op_verify_result);
     9.9          DLOAD(gpgme_signers_clear);
    9.10          DLOAD(gpgme_signers_add);
    9.11 @@ -935,9 +936,44 @@
    9.12      return result;
    9.13  }
    9.14  
    9.15 +static PEP_HASH_ALGO convert_hash_algo_enum(gpgme_hash_algo_t gpg_enum) {
    9.16 +    switch (gpg_enum) {
    9.17 +        case GPGME_MD_MD5:
    9.18 +            return MD5;
    9.19 +        case GPGME_MD_SHA1:
    9.20 +            return SHA1;
    9.21 +        case GPGME_MD_RMD160:
    9.22 +            return RMD160;
    9.23 +        case GPGME_MD_MD2:
    9.24 +            return MD2;
    9.25 +        case GPGME_MD_TIGER:
    9.26 +            return TIGER;
    9.27 +        case GPGME_MD_HAVAL:
    9.28 +            return HAVAL;
    9.29 +        case GPGME_MD_SHA256:
    9.30 +            return SHA256;
    9.31 +        case GPGME_MD_SHA384:
    9.32 +            return SHA384;
    9.33 +        case GPGME_MD_SHA512:
    9.34 +            return SHA512;
    9.35 +        case GPGME_MD_SHA224:
    9.36 +            return SHA224;
    9.37 +        case GPGME_MD_MD4:
    9.38 +            return MD4;
    9.39 +        case GPGME_MD_CRC32:
    9.40 +            return CRC32;
    9.41 +        case GPGME_MD_CRC32_RFC1510:
    9.42 +            return CRC32_RFC1510;
    9.43 +        case GPGME_MD_CRC24_RFC2440:
    9.44 +            return CRC32_RFC2440;
    9.45 +        default:
    9.46 +            return UNKNOWN_HASH_ALGO;
    9.47 +    }
    9.48 +}
    9.49 +
    9.50  PEP_STATUS pgp_sign_only(    
    9.51      PEP_SESSION session, const char* fpr, const char *ptext,
    9.52 -    size_t psize, char **stext, size_t *ssize
    9.53 +    size_t psize, char **stext, size_t *ssize, PEP_HASH_ALGO* micalg
    9.54  )
    9.55  {
    9.56      assert(session);
    9.57 @@ -953,6 +989,10 @@
    9.58      gpgme_key_t* signer_key_ptr;
    9.59  
    9.60      gpgme_sig_mode_t sign_mode = GPGME_SIG_MODE_DETACH;
    9.61 +    gpgme_sign_result_t sign_result;
    9.62 +    
    9.63 +    if (micalg)
    9.64 +        *micalg = UNKNOWN_HASH_ALGO;
    9.65         
    9.66      *stext = NULL;
    9.67      *ssize = 0;
    9.68 @@ -1034,6 +1074,14 @@
    9.69      switch (gpgme_error) {
    9.70      case GPG_ERR_NO_ERROR:
    9.71      {
    9.72 +        sign_result = gpg.gpgme_op_sign_result(session->ctx);
    9.73 +        if (!sign_result) {
    9.74 +            result = PEP_UNKNOWN_ERROR;
    9.75 +            break;
    9.76 +        }
    9.77 +        if (micalg && sign_result->signatures && sign_result->signatures->hash_algo)
    9.78 +            *micalg = convert_hash_algo_enum(sign_result->signatures->hash_algo);
    9.79 +        
    9.80          char *_buffer = NULL;
    9.81          size_t reading;
    9.82          size_t length = gpg.gpgme_data_seek(signed_text, 0, SEEK_END);
    10.1 --- a/src/pgp_gpg.h	Sun Sep 22 15:02:37 2019 +0200
    10.2 +++ b/src/pgp_gpg.h	Sun Sep 22 21:41:35 2019 +0200
    10.3 @@ -101,7 +101,7 @@
    10.4  
    10.5  PEP_STATUS pgp_sign_only(
    10.6          PEP_SESSION session, const char* fpr, const char *ptext,
    10.7 -        size_t psize, char **stext, size_t *ssize
    10.8 +        size_t psize, char **stext, size_t *ssize, PEP_HASH_ALGO* micalg
    10.9      );
   10.10  
   10.11  // pgp_encrypt_only() - encrypt plaintext
    11.1 --- a/src/pgp_gpg_internal.h	Sun Sep 22 15:02:37 2019 +0200
    11.2 +++ b/src/pgp_gpg_internal.h	Sun Sep 22 21:41:35 2019 +0200
    11.3 @@ -47,7 +47,8 @@
    11.4          gpgme_key_t RECP[], gpgme_encrypt_flags_t FLAGS, gpgme_data_t PLAIN,
    11.5          gpgme_data_t CIPHER);
    11.6  typedef gpgme_error_t(*gpgme_op_sign_t)(gpgme_ctx_t CTX,
    11.7 -        gpgme_data_t PLAIN, gpgme_data_t SIG, gpgme_sig_mode_t MODE);        
    11.8 +        gpgme_data_t PLAIN, gpgme_data_t SIG, gpgme_sig_mode_t MODE);
    11.9 +typedef gpgme_sign_result_t(*gpgme_op_sign_result_t)(gpgme_ctx_t CTX);                
   11.10  typedef gpgme_verify_result_t(*gpgme_op_verify_result_t)(gpgme_ctx_t CTX);
   11.11  typedef void(*gpgme_signers_clear_t)(gpgme_ctx_t CTX);
   11.12  typedef gpgme_error_t(*gpgme_signers_add_t)(gpgme_ctx_t CTX, const gpgme_key_t KEY);
   11.13 @@ -126,7 +127,8 @@
   11.14      gpgme_op_decrypt_result_t gpgme_op_decrypt_result;
   11.15      gpgme_op_encrypt_sign_t gpgme_op_encrypt_sign;
   11.16      gpgme_op_encrypt_t gpgme_op_encrypt;
   11.17 -    gpgme_op_sign_t gpgme_op_sign;    
   11.18 +    gpgme_op_sign_t gpgme_op_sign;
   11.19 +    gpgme_op_sign_result_t gpgme_op_sign_result;    
   11.20      gpgme_op_verify_result_t gpgme_op_verify_result;
   11.21      gpgme_signers_clear_t gpgme_signers_clear;
   11.22      gpgme_signers_add_t gpgme_signers_add;
    12.1 --- a/src/pgp_netpgp.c	Sun Sep 22 15:02:37 2019 +0200
    12.2 +++ b/src/pgp_netpgp.c	Sun Sep 22 21:41:35 2019 +0200
    12.3 @@ -768,7 +768,7 @@
    12.4  
    12.5  PEP_STATUS pgp_sign_only(
    12.6      PEP_SESSION session, const char* fpr, const char *ptext,
    12.7 -    size_t psize, char **stext, size_t *ssize
    12.8 +    size_t psize, char **stext, size_t *ssize, PEP_HASH_ALGO micalg
    12.9      )
   12.10  {
   12.11      pgp_key_t *signer = NULL;
    13.1 --- a/src/pgp_netpgp.h	Sun Sep 22 15:02:37 2019 +0200
    13.2 +++ b/src/pgp_netpgp.h	Sun Sep 22 21:41:35 2019 +0200
    13.3 @@ -27,7 +27,7 @@
    13.4  
    13.5  PEP_STATUS pgp_sign_only(
    13.6          PEP_SESSION session, const char* fpr, const char *ptext,
    13.7 -        size_t psize, char **stext, size_t *ssize
    13.8 +        size_t psize, char **stext, size_t *ssize, PEP_HASH_ALGO* micalg
    13.9      );
   13.10  
   13.11  PEP_STATUS pgp_verify_text(
    14.1 --- a/src/pgp_sequoia.h	Sun Sep 22 15:02:37 2019 +0200
    14.2 +++ b/src/pgp_sequoia.h	Sun Sep 22 21:41:35 2019 +0200
    14.3 @@ -22,7 +22,7 @@
    14.4  
    14.5  PEP_STATUS pgp_sign_only(
    14.6          PEP_SESSION session, const char* fpr, const char *ptext,
    14.7 -        size_t psize, char **stext, size_t *ssize
    14.8 +        size_t psize, char **stext, size_t *ssize, PEP_HASH_ALGO* micalg
    14.9      );
   14.10  
   14.11  PEP_STATUS pgp_encrypt_only(
    15.1 --- a/test/src/Message2_1Test.cc	Sun Sep 22 15:02:37 2019 +0200
    15.2 +++ b/test/src/Message2_1Test.cc	Sun Sep 22 21:41:35 2019 +0200
    15.3 @@ -6,6 +6,7 @@
    15.4  #include <string>
    15.5  
    15.6  #include "test_util.h"
    15.7 +#include "mime.h"
    15.8  #include "TestConstants.h"
    15.9  
   15.10  #include "pEpEngine.h"
   15.11 @@ -276,6 +277,11 @@
   15.12      status = encrypt_message(session, msg, NULL, &enc_msg, PEP_enc_PGP_MIME, 0);
   15.13      ASSERT_EQ(status , PEP_STATUS_OK);
   15.14  
   15.15 +    char* testme = NULL;
   15.16 +    
   15.17 +    mime_encode_message(enc_msg, false, &testme);
   15.18 +    output_stream << testme << endl;
   15.19 +    
   15.20      // ensure sent message is in 2.0 format
   15.21      unsigned int major = 2;
   15.22      unsigned int minor = 1;
    16.1 --- a/test/src/SignOnlyTest.cc	Sun Sep 22 15:02:37 2019 +0200
    16.2 +++ b/test/src/SignOnlyTest.cc	Sun Sep 22 21:41:35 2019 +0200
    16.3 @@ -97,7 +97,7 @@
    16.4  
    16.5      stringlist_t* keylist = NULL;
    16.6  
    16.7 -    PEP_STATUS status = sign_only(session, msg_text.c_str(), msg_text.size(), alice_fpr, &signed_text, &signed_text_size);
    16.8 +    PEP_STATUS status = sign_only(session, msg_text.c_str(), msg_text.size(), alice_fpr, &signed_text, &signed_text_size, NULL);
    16.9      ASSERT_EQ(status , PEP_STATUS_OK);
   16.10      output_stream << signed_text << endl;
   16.11      test_file.open("tmp/signature.txt");