ENGINE-9: reverting to default after memory mess. ENGINE-9
authorKrista Bennett <krista@pep-project.org>
Mon, 19 Jun 2017 09:01:06 +0200
branchENGINE-9
changeset 187151337eb65533
parent 1870 4334908a5f9f
child 1872 23b14ab93b11
ENGINE-9: reverting to default after memory mess.
src/baseprotocol.c
src/bloblist.c
src/bloblist.h
src/etpan_mime.c
src/etpan_mime.h
src/message_api.c
src/mime.c
src/sync_impl.c
test/bloblist_test.cc
test/decorate_test.cc
test/encrypt_for_identity_test.cc
test/external_revoke_test.cc
test/message_api_test.cc
     1.1 --- a/src/baseprotocol.c	Fri Jun 16 15:34:34 2017 +0200
     1.2 +++ b/src/baseprotocol.c	Mon Jun 19 09:01:06 2017 +0200
     1.3 @@ -18,7 +18,7 @@
     1.4          return PEP_ILLEGAL_VALUE;
     1.5  
     1.6      bloblist_t *bl = bloblist_add(msg->attachments, payload, size,
     1.7 -            "application/pEp.sync", "ignore_this_attachment.pEp", NULL);
     1.8 +            "application/pEp.sync", "ignore_this_attachment.pEp");
     1.9      if (bl == NULL)
    1.10          goto enomem;
    1.11  
    1.12 @@ -84,3 +84,4 @@
    1.13      free_message(msg);
    1.14      return PEP_OUT_OF_MEMORY;
    1.15  }
    1.16 +
     2.1 --- a/src/bloblist.c	Fri Jun 16 15:34:34 2017 +0200
     2.2 +++ b/src/bloblist.c	Mon Jun 19 09:01:06 2017 +0200
     2.3 @@ -10,7 +10,7 @@
     2.4  #include "bloblist.h"
     2.5  
     2.6  DYNAMIC_API bloblist_t *new_bloblist(char *blob, size_t size, const char *mime_type,
     2.7 -        const char *filename, const char *content_id)
     2.8 +        const char *filename)
     2.9  {
    2.10      bloblist_t * bloblist = calloc(1, sizeof(bloblist_t));
    2.11      assert(bloblist);
    2.12 @@ -34,16 +34,6 @@
    2.13          }
    2.14      }
    2.15  
    2.16 -    if (content_id) {
    2.17 -        bloblist->content_id = strdup(content_id);
    2.18 -        if (bloblist->content_id == NULL) {
    2.19 -            free(bloblist->filename);
    2.20 -            free(bloblist->mime_type);
    2.21 -            free(bloblist);
    2.22 -            return NULL;
    2.23 -        }
    2.24 -    }
    2.25 -
    2.26      if (blob) {
    2.27          bloblist->value = blob;
    2.28          bloblist->size = size;
    2.29 @@ -61,7 +51,6 @@
    2.30          free(curr->value);
    2.31          free(curr->mime_type);
    2.32          free(curr->filename);
    2.33 -        free(curr->content_id);
    2.34          free(curr);
    2.35          curr = next;
    2.36      }
    2.37 @@ -83,8 +72,7 @@
    2.38  
    2.39      memcpy(blob2, src->value, src->size);
    2.40  
    2.41 -    bloblist = new_bloblist(blob2, src->size, src->mime_type, src->filename,
    2.42 -                            src->content_id);
    2.43 +    bloblist = new_bloblist(blob2, src->size, src->mime_type, src->filename);
    2.44      if (bloblist == NULL)
    2.45          goto enomem;
    2.46      blob2 = NULL;
    2.47 @@ -101,8 +89,7 @@
    2.48              goto enomem;
    2.49  
    2.50          memcpy(blob2, src_curr->value, src_curr->size);
    2.51 -        *dst_curr_ptr = new_bloblist(blob2, src_curr->size, src_curr->mime_type, 
    2.52 -                                     src_curr->filename, src_curr->content_id);
    2.53 +        *dst_curr_ptr = new_bloblist(blob2, src_curr->size, src_curr->mime_type, src_curr->filename);
    2.54          if (*dst_curr_ptr == NULL)
    2.55              goto enomem;
    2.56  
    2.57 @@ -119,14 +106,14 @@
    2.58  }
    2.59  
    2.60  DYNAMIC_API bloblist_t *bloblist_add(bloblist_t *bloblist, char *blob, size_t size,
    2.61 -        const char *mime_type, const char *filename, const char *content_id)
    2.62 +        const char *mime_type, const char *filename)
    2.63  {
    2.64      assert(blob);
    2.65      if (blob == NULL)
    2.66          return NULL;
    2.67  
    2.68      if (bloblist == NULL)
    2.69 -        return new_bloblist(blob, size, mime_type, filename, content_id);
    2.70 +        return new_bloblist(blob, size, mime_type, filename);
    2.71  
    2.72      if (bloblist->value == NULL) { // empty list
    2.73          if (bloblist->next != NULL)
    2.74 @@ -147,15 +134,6 @@
    2.75                  return NULL;
    2.76              }
    2.77          }
    2.78 -        if (content_id) {
    2.79 -            bloblist->content_id = strdup(content_id);
    2.80 -            if (bloblist->content_id == NULL) {
    2.81 -                free(bloblist->content_id);
    2.82 -                free(bloblist->mime_type);
    2.83 -                free(bloblist);
    2.84 -                return NULL;
    2.85 -            }
    2.86 -        }
    2.87  
    2.88          bloblist->value = blob;
    2.89          bloblist->size = size;
    2.90 @@ -168,8 +146,7 @@
    2.91      while (list_curr->next)
    2.92          list_curr = list_curr->next;
    2.93  
    2.94 -    list_curr->next = new_bloblist(blob, size, mime_type, 
    2.95 -                                   filename, content_id);
    2.96 +    list_curr->next = new_bloblist(blob, size, mime_type, filename);
    2.97  
    2.98      assert(list_curr->next);
    2.99      if (list_curr->next == NULL)
     3.1 --- a/src/bloblist.h	Fri Jun 16 15:34:34 2017 +0200
     3.2 +++ b/src/bloblist.h	Mon Jun 19 09:01:06 2017 +0200
     3.3 @@ -17,8 +17,6 @@
     3.4                                      // NULL if unknown
     3.5      char *filename;                // UTF-8 string of file name of blob or
     3.6                                      // NULL if unknown
     3.7 -    char *content_id;              // UTF-8 string of content id or NULL if
     3.8 -                                   // unknown
     3.9      struct _bloblist_t *next;
    3.10  } bloblist_t;
    3.11  
    3.12 @@ -26,11 +24,10 @@
    3.13  // new_bloblist() - allocate a new bloblist
    3.14  //
    3.15  //  parameters:
    3.16 -//      blob (in)           blob to add to the list
    3.17 -//      size (in)           size of the blob
    3.18 -//      mime_type (in)      MIME type of the blob data or NULL if unknown
    3.19 -//      filename (in)       file name of origin of blob data or NULL if unknown
    3.20 -//      content_id (in)     content_id of attachment blob or NULL if known
    3.21 +//      blob (in)       blob to add to the list
    3.22 +//      size (in)       size of the blob
    3.23 +//      mime_type (in)  MIME type of the blob data or NULL if unknown
    3.24 +//      filename (in)  file name of origin of blob data or NULL if unknown
    3.25  //
    3.26  //  return value:
    3.27  //      pointer to new bloblist_t or NULL if out of memory
    3.28 @@ -40,7 +37,7 @@
    3.29  //      are being copied, the originals remain in the ownership of the caller
    3.30  
    3.31  DYNAMIC_API bloblist_t *new_bloblist(char *blob, size_t size, const char *mime_type,
    3.32 -        const char *filename, const char *content_id);
    3.33 +        const char *filename);
    3.34  
    3.35  
    3.36  // free_bloblist() - free bloblist
    3.37 @@ -67,12 +64,11 @@
    3.38  // bloblist_add() - add reference to a blob to bloblist
    3.39  //
    3.40  //  parameters:
    3.41 -//      bloblist (in)       bloblist to add to
    3.42 -//      blob (in)           blob
    3.43 -//      size (in)           size of the blob
    3.44 -//      mime_type (in)      MIME type of the blob or NULL if unknown
    3.45 -//      filename (in)       file name of the blob or NULL if unknown
    3.46 -//      content_id (in)     content_id of attachment blob or NULL if known
    3.47 +//      bloblist (in)   bloblist to add to
    3.48 +//      blob (in)       blob
    3.49 +//      size (in)       size of the blob
    3.50 +//      mime_type (in)  MIME type of the blob or NULL if unknown
    3.51 +//      filename (in)  file name of the blob or NULL if unknown
    3.52  //
    3.53  //  return value:
    3.54  //      pointer to the last element of bloblist or NULL if out of memory or
    3.55 @@ -85,7 +81,7 @@
    3.56  //      empty input list.
    3.57  
    3.58  DYNAMIC_API bloblist_t *bloblist_add(bloblist_t *bloblist, char *blob, size_t size,
    3.59 -        const char *mime_type, const char *filename, const char *content_id);
    3.60 +        const char *mime_type, const char *filename);
    3.61  
    3.62  
    3.63  // bloblist_length() - get length of bloblist
    3.64 @@ -101,3 +97,4 @@
    3.65  #ifdef __cplusplus
    3.66  }
    3.67  #endif
    3.68 +
     4.1 --- a/src/etpan_mime.c	Fri Jun 16 15:34:34 2017 +0200
     4.2 +++ b/src/etpan_mime.c	Mon Jun 19 09:01:06 2017 +0200
     4.3 @@ -630,29 +630,6 @@
     4.4      return NULL;
     4.5  }
     4.6  
     4.7 -// FIXME: We should combine this with _get_filename, IMHO
     4.8 -char * _get_content_id(struct mailmime *mime) {
     4.9 -    clist * _fieldlist = NULL;
    4.10 -
    4.11 -    assert(mime);
    4.12 -
    4.13 -    if (mime->mm_mime_fields && mime->mm_mime_fields->fld_list)
    4.14 -        _fieldlist = mime->mm_mime_fields->fld_list;
    4.15 -    else
    4.16 -        return NULL;
    4.17 -
    4.18 -    clistiter *cur;
    4.19 -    for (cur = clist_begin(_fieldlist); cur; cur = clist_next(cur)) {
    4.20 -        struct mailmime_field * _field = clist_content(cur);
    4.21 -        if (_field && _field->fld_type == MAILMIME_FIELD_ID) {
    4.22 -            return _field->fld_data.fld_id; // returns NULL if it's not there, so...
    4.23 -        }
    4.24 -    }
    4.25 -
    4.26 -    return NULL;
    4.27 -}
    4.28 -
    4.29 -
    4.30  static bool parameter_has_value(
    4.31          struct mailmime_content *content,       
    4.32          const char *name,
    4.33 @@ -807,3 +784,4 @@
    4.34  
    4.35      return EINVAL;
    4.36  }
    4.37 +
     5.1 --- a/src/etpan_mime.h	Fri Jun 16 15:34:34 2017 +0200
     5.2 +++ b/src/etpan_mime.h	Mon Jun 19 09:01:06 2017 +0200
     5.3 @@ -71,7 +71,6 @@
     5.4  clist * _get_fields(struct mailmime * mime);
     5.5  struct mailmime_content * _get_content(struct mailmime * mime);
     5.6  char * _get_filename(struct mailmime *mime);
     5.7 -char * _get_content_id(struct mailmime *mime);
     5.8  bool _is_multipart(struct mailmime_content *content, const char *subtype);
     5.9  bool _is_PGP_MIME(struct mailmime_content *content);
    5.10  bool _is_text_part(struct mailmime_content *content, const char *subtype);
    5.11 @@ -81,3 +80,4 @@
    5.12          char **type,
    5.13          char **charset
    5.14      );
    5.15 +
     6.1 --- a/src/message_api.c	Fri Jun 16 15:34:34 2017 +0200
     6.2 +++ b/src/message_api.c	Mon Jun 19 09:01:06 2017 +0200
     6.3 @@ -421,14 +421,13 @@
     6.4      if (v == NULL)
     6.5          goto enomem;
     6.6  
     6.7 -    bloblist_t *_a = new_bloblist(v, strlen(v), "application/pgp-encrypted", NULL,
     6.8 -                                  NULL);
     6.9 +    bloblist_t *_a = new_bloblist(v, strlen(v), "application/pgp-encrypted", NULL);
    6.10      if (_a == NULL)
    6.11          goto enomem;
    6.12      dst->attachments = _a;
    6.13  
    6.14      _a = bloblist_add(_a, ctext, csize, "application/octet-stream",
    6.15 -        "msg.asc", NULL);
    6.16 +        "msg.asc");
    6.17      if (_a == NULL)
    6.18          goto enomem;
    6.19  
    6.20 @@ -529,7 +528,7 @@
    6.21          if (ctext) {
    6.22  
    6.23              bloblist_t *_a = bloblist_add(dst->attachments, ctext, csize,
    6.24 -                "application/octet-stream", "PGPexch.htm.pgp", NULL);
    6.25 +                "application/octet-stream", "PGPexch.htm.pgp");
    6.26              if (_a == NULL)
    6.27                  goto enomem;
    6.28              if (dst->attachments == NULL)
    6.29 @@ -542,7 +541,7 @@
    6.30  
    6.31      if (src->attachments) {
    6.32          if (dst->attachments == NULL) {
    6.33 -            dst->attachments = new_bloblist(NULL, 0, NULL, NULL, NULL);
    6.34 +            dst->attachments = new_bloblist(NULL, 0, NULL, NULL);
    6.35              if (dst->attachments == NULL)
    6.36                  goto enomem;
    6.37          }
    6.38 @@ -552,8 +551,7 @@
    6.39  
    6.40          for (int n = 0; _s; _s = _s->next) {
    6.41              if (_s->value == NULL && _s->size == 0) {
    6.42 -                _d = bloblist_add(_d, NULL, 0, _s->mime_type, _s->filename,
    6.43 -                                  _s->content_id);
    6.44 +                _d = bloblist_add(_d, NULL, 0, _s->mime_type, _s->filename);
    6.45                  if (_d == NULL)
    6.46                      goto enomem;
    6.47              }
    6.48 @@ -590,7 +588,7 @@
    6.49                      }
    6.50  
    6.51                      _d = bloblist_add(_d, ctext, csize, "application/octet-stream",
    6.52 -                        filename, NULL);
    6.53 +                        filename);
    6.54                      free(filename);
    6.55                      if (_d == NULL)
    6.56                          goto enomem;
    6.57 @@ -1022,7 +1020,7 @@
    6.58      assert(size);
    6.59  
    6.60       bloblist_t *bl = bloblist_add(msg->attachments, keydata, size, "application/pgp-keys",
    6.61 -                      "pEpkey.asc", NULL);
    6.62 +                      "pEpkey.asc");
    6.63  
    6.64      if (msg->attachments == NULL && bl)
    6.65          msg->attachments = bl;
    6.66 @@ -1867,15 +1865,14 @@
    6.67  
    6.68                  bloblist_t *_m = msg->attachments;
    6.69                  if (_m == NULL && src->attachments && src->attachments->value) {
    6.70 -                    msg->attachments = new_bloblist(NULL, 0, NULL, NULL, NULL);
    6.71 +                    msg->attachments = new_bloblist(NULL, 0, NULL, NULL);
    6.72                      _m = msg->attachments;
    6.73                  }
    6.74  
    6.75                  bloblist_t *_s;
    6.76                  for (_s = src->attachments; _s; _s = _s->next) {
    6.77                      if (_s->value == NULL && _s->size == 0){
    6.78 -                        _m = bloblist_add(_m, NULL, 0, _s->mime_type, _s->filename,
    6.79 -                                          _s->content_id);
    6.80 +                        _m = bloblist_add(_m, NULL, 0, _s->mime_type, _s->filename);
    6.81                          if (_m == NULL)
    6.82                              goto enomem;
    6.83  
    6.84 @@ -1907,7 +1904,7 @@
    6.85                                      goto enomem;
    6.86  
    6.87                                  _m = bloblist_add(_m, ptext, psize, mime_type,
    6.88 -                                    filename, NULL);
    6.89 +                                    filename);
    6.90                                  free(filename);
    6.91                                  if (_m == NULL)
    6.92                                      goto enomem;
    6.93 @@ -1924,8 +1921,7 @@
    6.94                              if (copy == NULL)
    6.95                                  goto enomem;
    6.96                              memcpy(copy, _s->value, _s->size);
    6.97 -                            _m = bloblist_add(_m, copy, _s->size, _s->mime_type, 
    6.98 -                                              _s->filename, _s->content_id);
    6.99 +                            _m = bloblist_add(_m, copy, _s->size, _s->mime_type, _s->filename);
   6.100                              if (_m == NULL)
   6.101                                  goto enomem;
   6.102                          }
   6.103 @@ -1936,8 +1932,7 @@
   6.104                          if (copy == NULL)
   6.105                              goto enomem;
   6.106                          memcpy(copy, _s->value, _s->size);
   6.107 -                        _m = bloblist_add(_m, copy, _s->size, _s->mime_type, 
   6.108 -                                          _s->filename, _s->content_id);
   6.109 +                        _m = bloblist_add(_m, copy, _s->size, _s->mime_type, _s->filename);
   6.110                          if (_m == NULL)
   6.111                              goto enomem;
   6.112                      }
     7.1 --- a/src/mime.c	Fri Jun 16 15:34:34 2017 +0200
     7.2 +++ b/src/mime.c	Mon Jun 19 09:01:06 2017 +0200
     7.3 @@ -1323,7 +1323,6 @@
     7.4                  char * mime_type;
     7.5                  char * charset;
     7.6                  char * filename;
     7.7 -                char * content_id;
     7.8                  int r;
     7.9  
    7.10                  r = _get_content_type(content, &mime_type, &charset);
    7.11 @@ -1345,7 +1344,6 @@
    7.12                      return status;
    7.13  
    7.14                  filename = _get_filename(mime);
    7.15 -                
    7.16                  char *_filename = NULL;
    7.17                  if (filename) {
    7.18                      size_t index = 0;
    7.19 @@ -1355,18 +1353,8 @@
    7.20                          goto enomem;
    7.21                  }
    7.22  
    7.23 -                content_id = _get_content_id(mime);
    7.24 -                char *_content_id = NULL;
    7.25 -                if (content_id) {
    7.26 -                    size_t index = 0;
    7.27 -                    r = mailmime_encoded_phrase_parse("utf-8", content_id,
    7.28 -                            strlen(content_id), &index, "utf-8", &_content_id);
    7.29 -                    if (r)
    7.30 -                        goto enomem;                    
    7.31 -                }
    7.32 -                
    7.33                  bloblist_t *_a = bloblist_add(msg->attachments, data, size,
    7.34 -                        mime_type, _filename, _content_id);
    7.35 +                        mime_type, _filename);
    7.36                  free(_filename);
    7.37                  if (_a == NULL)
    7.38                      return PEP_OUT_OF_MEMORY;
     8.1 --- a/src/sync_impl.c	Fri Jun 16 15:34:34 2017 +0200
     8.2 +++ b/src/sync_impl.c	Mon Jun 19 09:01:06 2017 +0200
     8.3 @@ -697,7 +697,6 @@
     8.4                      last->next = bl;
     8.5                  free(b->mime_type);
     8.6                  free(b->filename);
     8.7 -                free(b->content_id);
     8.8                  free(b->value);
     8.9                  free(b);
    8.10              }
    8.11 @@ -861,7 +860,7 @@
    8.12                  if (status != PEP_STATUS_OK)
    8.13                      goto error;
    8.14                  bloblist_t *bl = bloblist_add(_message->attachments,
    8.15 -                        (char *) key, size, "application/pgp-keys", filename, NULL);
    8.16 +                        (char *) key, size, "application/pgp-keys", filename);
    8.17                  if (!bl)
    8.18                      goto enomem;
    8.19                  if (!_message->attachments)
     9.1 --- a/test/bloblist_test.cc	Fri Jun 16 15:34:34 2017 +0200
     9.2 +++ b/test/bloblist_test.cc	Mon Jun 19 09:01:06 2017 +0200
     9.3 @@ -49,10 +49,10 @@
     9.4      char* text2 = strdup("More text.");
     9.5      char* text3 = strdup("Unpleasant news and witty one-liners.");
     9.6      char* text4 = strdup("I AM URDNOT WREX AND THIS IS MY PLANET!");
     9.7 -    bloblist_t* bl1 = new_bloblist(text1, strlen(text1) + 1, "text/plain", NULL, "<julio12345@iglesias.com>");
     9.8 -    bloblist_t* bl2 = new_bloblist(text2, strlen(text2) + 1, "text/richtext", "bob.rtf",NULL);
     9.9 -    bloblist_t* bl3 = new_bloblist(text3, strlen(text3) + 1, NULL, "dummy.bin",NULL);
    9.10 -    bloblist_t* bl4 = new_bloblist(text4, strlen(text4) + 1, NULL, NULL,NULL);
    9.11 +    bloblist_t* bl1 = new_bloblist(text1, strlen(text1) + 1, "text/plain", NULL);
    9.12 +    bloblist_t* bl2 = new_bloblist(text2, strlen(text2) + 1, "text/richtext", "bob.rtf");
    9.13 +    bloblist_t* bl3 = new_bloblist(text3, strlen(text3) + 1, NULL, "dummy.bin");
    9.14 +    bloblist_t* bl4 = new_bloblist(text4, strlen(text4) + 1, NULL, NULL);
    9.15      
    9.16      bloblist_t* bl_arr[4] = {bl1, bl2, bl3, bl4};
    9.17          
    9.18 @@ -67,7 +67,6 @@
    9.19      assert(bl1->value != new_bl->value);
    9.20      assert(bl1->mime_type != new_bl->mime_type || !(bl1->mime_type || new_bl->mime_type));
    9.21      assert(bl1->filename != new_bl->filename || !(bl1->filename || new_bl->filename));
    9.22 -    assert(bl1->content_id != new_bl->content_id || !(bl1->content_id || new_bl->content_id));
    9.23      cout << "one-element bloblist duplicated.\n\n";
    9.24      
    9.25      cout << "freeing bloblist...\n";
    9.26 @@ -77,10 +76,10 @@
    9.27      bloblist_t* p;
    9.28      cout << "\ncreating four-element list...\n";
    9.29      bloblist_t* to_copy = bl_arr[0];
    9.30 -    new_bl = bloblist_add(new_bl, strdup(to_copy->value), to_copy->size, to_copy->mime_type, to_copy->filename, to_copy->content_id);
    9.31 +    new_bl = bloblist_add(new_bl, strdup(to_copy->value), to_copy->size, to_copy->mime_type, to_copy->filename);
    9.32      for (i = 1; i < 4; i++) {
    9.33          to_copy = bl_arr[i];
    9.34 -        p = bloblist_add(new_bl, strdup(to_copy->value), to_copy->size, to_copy->mime_type, to_copy->filename, to_copy->content_id);
    9.35 +        p = bloblist_add(new_bl, strdup(to_copy->value), to_copy->size, to_copy->mime_type, to_copy->filename);
    9.36  
    9.37          assert(p);
    9.38      }
    9.39 @@ -94,7 +93,6 @@
    9.40          assert(p->value != bl_arr[i]->value);
    9.41          assert(p->mime_type != bl_arr[i]->mime_type || !(p->mime_type || bl_arr[i]->mime_type));
    9.42          assert(p->filename != bl_arr[i]->filename || !(p->filename || bl_arr[i]->filename));
    9.43 -        assert(p->content_id != bl_arr[i]->content_id || !(p->content_id || bl_arr[i]->content_id));
    9.44          
    9.45          p = p->next;
    9.46      }
    9.47 @@ -112,7 +110,6 @@
    9.48          assert(p->value != dup_p->value);
    9.49          assert(p->mime_type != dup_p->mime_type || !(p->mime_type || dup_p->mime_type));
    9.50          assert(p->filename != dup_p->filename || !(p->filename || dup_p->filename));
    9.51 -        assert(p->content_id != dup_p->content_id || !(p->content_id || dup_p->content_id));
    9.52  
    9.53          dup_p = dup_p->next;
    9.54          p = p->next;
    9.55 @@ -134,3 +131,4 @@
    9.56      
    9.57      return 0;
    9.58  }
    9.59 +
    10.1 --- a/test/decorate_test.cc	Fri Jun 16 15:34:34 2017 +0200
    10.2 +++ b/test/decorate_test.cc	Mon Jun 19 09:01:06 2017 +0200
    10.3 @@ -36,7 +36,7 @@
    10.4      outgoing_message->from = alice;
    10.5      outgoing_message->to = to_list;
    10.6      outgoing_message->shortmsg = strdup("Greetings, humans!");
    10.7 -    outgoing_message->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL, NULL);
    10.8 +    outgoing_message->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL);
    10.9      outgoing_message->longmsg = strdup("This is a dumb message.\nBut it's done.\n");
   10.10      assert(outgoing_message->longmsg);
   10.11      cout << "message created.\n";
    11.1 --- a/test/encrypt_for_identity_test.cc	Fri Jun 16 15:34:34 2017 +0200
    11.2 +++ b/test/encrypt_for_identity_test.cc	Mon Jun 19 09:01:06 2017 +0200
    11.3 @@ -50,7 +50,7 @@
    11.4      outgoing_message->to = to_list;
    11.5      outgoing_message->shortmsg = strdup("Greetings, humans!");
    11.6      outgoing_message->longmsg = strdup("This is a test of the emergency message system. This is only a test. BEEP.");
    11.7 -    outgoing_message->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL, NULL);
    11.8 +    outgoing_message->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL);
    11.9      cout << "message created.\n";
   11.10  
   11.11      char* encoded_text = nullptr;
    12.1 --- a/test/external_revoke_test.cc	Fri Jun 16 15:34:34 2017 +0200
    12.2 +++ b/test/external_revoke_test.cc	Mon Jun 19 09:01:06 2017 +0200
    12.3 @@ -92,7 +92,7 @@
    12.4      outgoing_msg->to = to_list;
    12.5      outgoing_msg->shortmsg = strdup("Greetings, humans!");
    12.6      outgoing_msg->longmsg = strdup("This is a test of the emergency message system. This is only a test. BEEP.");
    12.7 -    outgoing_msg->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL, NULL);
    12.8 +    outgoing_msg->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL);
    12.9      cout << "Message created.\n";
   12.10  
   12.11      message* encrypted_outgoing_msg = NULL;
   12.12 @@ -168,7 +168,7 @@
   12.13      outgoing_msg->to = to_list;
   12.14      outgoing_msg->shortmsg = strdup("Greetings, humans!");
   12.15      outgoing_msg->longmsg = strdup("This is a test of the emergency message system. This is only a test. BEEP.");
   12.16 -    outgoing_msg->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL, NULL);
   12.17 +    outgoing_msg->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL);
   12.18      cout << "message created.\n";
   12.19  
   12.20      encrypted_outgoing_msg = NULL;
   12.21 @@ -255,7 +255,7 @@
   12.22      outgoing_msg->to = to_list;
   12.23      outgoing_msg->shortmsg = strdup("Greetings, humans!");
   12.24      outgoing_msg->longmsg = strdup("This is a test of the emergency message system. This is only a test. BEEP.");
   12.25 -    outgoing_msg->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL, NULL);
   12.26 +    outgoing_msg->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL);
   12.27      cout << "Message created.\n";
   12.28  
   12.29      status = encrypt_message(session, outgoing_msg, NULL, &encrypted_outgoing_msg, PEP_enc_PGP_MIME, 0);
    13.1 --- a/test/message_api_test.cc	Fri Jun 16 15:34:34 2017 +0200
    13.2 +++ b/test/message_api_test.cc	Mon Jun 19 09:01:06 2017 +0200
    13.3 @@ -36,7 +36,7 @@
    13.4      msg2->from = me2;
    13.5      msg2->to = to2;
    13.6      msg2->shortmsg = strdup("hello, world");
    13.7 -    msg2->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL, NULL);
    13.8 +    msg2->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL);
    13.9      cout << "message created.\n";
   13.10  
   13.11      char *text2 = nullptr;