Browse Source

...

async_key_management
vb 7 years ago
parent
commit
238b2d914d
14 changed files with 730 additions and 451 deletions
  1. +12
    -12
      src/cryptotech.h
  2. +204
    -0
      src/etpan_mime.c
  3. +24
    -0
      src/etpan_mime.h
  4. +12
    -148
      src/message_api.c
  5. +14
    -39
      src/message_api.h
  6. +180
    -0
      src/mime.c
  7. +40
    -0
      src/mime.h
  8. +4
    -0
      src/pEp_internal.h
  9. +12
    -12
      src/transport.c
  10. +34
    -28
      src/transport.h
  11. +105
    -106
      test/DF9B1541-sec.key
  12. +65
    -52
      test/DF9B1541.key
  13. +8
    -37
      test/Makefile
  14. +16
    -17
      test/message_api_test.cc

+ 12
- 12
src/cryptotech.h View File

@ -13,38 +13,38 @@ typedef enum _PEP_cryptotech {
} PEP_cryptotech;
typedef PEP_STATUS (*decrypt_and_verify_t)(
PEP_SESSION session, const char *ctext, size_t csize,
char **ptext, size_t *psize, stringlist_t **keylist
PEP_SESSION session, const char *ctext, size_t csize,
char **ptext, size_t *psize, stringlist_t **keylist
);
typedef PEP_STATUS (*verify_text_t)(
PEP_SESSION session, const char *text, size_t size,
const char *signature, size_t sig_size, stringlist_t **keylist
PEP_SESSION session, const char *text, size_t size,
const char *signature, size_t sig_size, stringlist_t **keylist
);
typedef PEP_STATUS (*encrypt_and_sign_t)(
PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
size_t psize, char **ctext, size_t *csize
PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
size_t psize, char **ctext, size_t *csize
);
typedef PEP_STATUS (*delete_keypair_t)(PEP_SESSION session, const char *fpr);
typedef PEP_STATUS (*export_key_t)(
PEP_SESSION session, const char *fpr, char **key_data, size_t *size
PEP_SESSION session, const char *fpr, char **key_data, size_t *size
);
typedef PEP_STATUS (*find_keys_t)(
PEP_SESSION session, const char *pattern, stringlist_t **keylist
PEP_SESSION session, const char *pattern, stringlist_t **keylist
);
typedef PEP_STATUS (*generate_keypair_t)(
PEP_SESSION session, pEp_identity *identity
PEP_SESSION session, pEp_identity *identity
);
typedef PEP_STATUS (*get_key_rating_t)(
PEP_SESSION session,
const char *fpr,
PEP_comm_type *comm_type
PEP_SESSION session,
const char *fpr,
PEP_comm_type *comm_type
);
typedef PEP_STATUS (*import_key_t)(PEP_SESSION session, const char *key_data, size_t size);


+ 204
- 0
src/etpan_mime.c View File

@ -0,0 +1,204 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "etpan_mime.h"
#define MAX_MESSAGE_ID 512
static char * generate_boundary(const char * boundary_prefix)
{
char id[MAX_MESSAGE_ID];
time_t now;
char name[MAX_MESSAGE_ID];
long value;
now = time(NULL);
#ifndef WIN32
value = random();
gethostname(name, MAX_MESSAGE_ID);
#else
value = now;
strcpy(name, "WINDOWS");
#endif
if (boundary_prefix == NULL)
boundary_prefix = "";
snprintf(id, MAX_MESSAGE_ID, "%s%lx_%lx_%x", boundary_prefix, now, value,
getpid());
return strdup(id);
}
struct mailmime * part_new_empty(
struct mailmime_content * content,
struct mailmime_fields * mime_fields,
const char * boundary_prefix,
int force_single
)
{
struct mailmime * build_info;
clist * list;
int r;
int mime_type;
list = NULL;
if (force_single) {
mime_type = MAILMIME_SINGLE;
}
else {
switch (content->ct_type->tp_type) {
case MAILMIME_TYPE_DISCRETE_TYPE:
mime_type = MAILMIME_SINGLE;
break;
case MAILMIME_TYPE_COMPOSITE_TYPE:
switch (content->ct_type->tp_data.tp_composite_type->ct_type) {
case MAILMIME_COMPOSITE_TYPE_MULTIPART:
mime_type = MAILMIME_MULTIPLE;
break;
case MAILMIME_COMPOSITE_TYPE_MESSAGE:
if (strcasecmp(content->ct_subtype, "rfc822") == 0)
mime_type = MAILMIME_MESSAGE;
else
mime_type = MAILMIME_SINGLE;
break;
default:
goto err;
}
break;
default:
goto err;
}
}
if (mime_type == MAILMIME_MULTIPLE) {
char * attr_name;
char * attr_value;
struct mailmime_parameter * param;
clist * parameters;
char * boundary;
list = clist_new();
if (list == NULL)
goto err;
attr_name = strdup("boundary");
boundary = generate_boundary(boundary_prefix);
attr_value = boundary;
if (attr_name == NULL) {
free(attr_name);
goto free_list;
}
param = mailmime_parameter_new(attr_name, attr_value);
if (param == NULL) {
free(attr_value);
free(attr_name);
goto free_list;
}
if (content->ct_parameters == NULL) {
parameters = clist_new();
if (parameters == NULL) {
mailmime_parameter_free(param);
goto free_list;
}
}
else
parameters = content->ct_parameters;
r = clist_append(parameters, param);
if (r != 0) {
clist_free(parameters);
mailmime_parameter_free(param);
goto free_list;
}
if (content->ct_parameters == NULL)
content->ct_parameters = parameters;
}
build_info = mailmime_new(mime_type,
NULL, 0, mime_fields, content,
NULL, NULL, NULL, list,
NULL, NULL);
if (build_info == NULL) {
clist_free(list);
return NULL;
}
return build_info;
free_list:
clist_free(list);
err:
return NULL;
}
struct mailmime * get_text_part(
const char * mime_type,
const char * text,
size_t length,
int encoding_type
)
{
struct mailmime_fields * mime_fields;
struct mailmime * mime;
struct mailmime_content * content;
struct mailmime_parameter * param;
struct mailmime_disposition * disposition;
struct mailmime_mechanism * encoding;
encoding = mailmime_mechanism_new(encoding_type, NULL);
disposition = mailmime_disposition_new_with_data(MAILMIME_DISPOSITION_TYPE_INLINE,
NULL, NULL, NULL, NULL, (size_t) -1);
mime_fields = mailmime_fields_new_with_data(encoding,
NULL, NULL, disposition, NULL);
content = mailmime_content_new_with_str(mime_type);
param = mailmime_param_new_with_data("charset", "utf-8");
clist_append(content->ct_parameters, param);
mime = part_new_empty(content, mime_fields, NULL, 1);
mailmime_set_body_text(mime, (char *) text, length);
return mime;
}
struct mailmime * part_multiple_new(
const char * type,
const char * boundary_prefix
)
{
struct mailmime_fields * mime_fields;
struct mailmime_content * content;
struct mailmime * mp;
mime_fields = mailmime_fields_new_empty();
if (mime_fields == NULL)
goto err;
content = mailmime_content_new_with_str(type);
if (content == NULL)
goto free_fields;
mp = part_new_empty(content, mime_fields, boundary_prefix, 0);
if (mp == NULL)
goto free_content;
return mp;
free_content:
mailmime_content_free(content);
free_fields:
mailmime_fields_free(mime_fields);
err:
return NULL;
}

+ 24
- 0
src/etpan_mime.h View File

@ -0,0 +1,24 @@
#pragma once
#include <libetpan/libetpan.h>
struct mailmime * part_new_empty(
struct mailmime_content * content,
struct mailmime_fields * mime_fields,
const char * boundary_prefix,
int force_single
);
struct mailmime * get_text_part(
const char * mime_type,
const char * text,
size_t length,
int encoding_type
);
struct mailmime * part_multiple_new(
const char * type,
const char * boundary_prefix
);

+ 12
- 148
src/message_api.c View File

@ -11,149 +11,8 @@
#define NOT_IMPLEMENTED assert(0);
PEP_STATUS mime_encode_parts(const message *src, message **dst)
{
struct mailmime * mime_body;
assert(src);
assert(src->enc_format == PEP_enc_none);
assert(dst);
if (src->enc_format != PEP_enc_none)
return PEP_ILLEGAL_VALUE;
*dst = NULL;
if (src->longmsg && src->longmsg_formatted) {
struct mailmime * mime_text;
struct mailmime * mime_html;
NOT_IMPLEMENTED
}
else if (src->longmsg) {
struct mailmime_fields * mime_fields
= mailmime_fields_new_encoding(MAILMIME_MECHANISM_8BIT);
assert(mime_fields);
if (mime_fields == NULL)
return PEP_OUT_OF_MEMORY;
struct mailmime_content * content
= mailmime_content_new_with_str("text/plain");
assert(content);
if (content == NULL) {
mailmime_fields_free(mime_fields);
return PEP_OUT_OF_MEMORY;
}
struct mailmime_parameter * param
= mailmime_param_new_with_data("charset", "utf-8");
assert(param);
if (param == NULL) {
mailmime_fields_free(mime_fields);
mailmime_content_free(content);
return PEP_OUT_OF_MEMORY;
}
int r = clist_append(content->ct_parameters, param);
if (r < 0) {
mailmime_fields_free(mime_fields);
mailmime_content_free(content);
mailmime_parameter_free(param);
return PEP_OUT_OF_MEMORY;
}
mime_body = mailmime_new_empty(content, mime_fields);
if (mime_body == NULL) {
mailmime_fields_free(mime_fields);
mailmime_content_free(content);
return PEP_OUT_OF_MEMORY;
}
r = mailmime_set_body_text(mime_body, src->longmsg, strlen(src->longmsg));
if (r != MAILIMF_NO_ERROR) {
mailmime_free(mime_body);
return PEP_OUT_OF_MEMORY;
}
}
else if (src->longmsg_formatted) {
NOT_IMPLEMENTED
}
char *fn = strdup("/tmp/pEp.XXXXXXXXXX");
assert(fn);
if (fn == NULL) {
mailmime_free(mime_body);
return PEP_OUT_OF_MEMORY;
}
int f = mkstemp(fn);
assert(f != -1);
free(fn);
if (f == -1) {
mailmime_free(mime_body);
return PEP_CANNOT_CREATE_TEMP_FILE;
}
FILE *fp = fdopen(f, "w+");
assert(fp);
if (fp == NULL) {
return PEP_CANNOT_CREATE_TEMP_FILE;
}
// unlink(fn);
int col = 0;
int r = mailmime_write_file(fp, &col, mime_body);
assert(r == MAILIMF_NO_ERROR);
mailmime_free(mime_body);
if (r != MAILIMF_NO_ERROR) {
fclose(fp);
return PEP_CANNOT_CREATE_TEMP_FILE;
}
rewind(fp);
char *buf = (char *) calloc(1, col + 1);
assert(buf);
if (buf == NULL) {
fclose(fp);
return PEP_OUT_OF_MEMORY;
}
size_t size = fread(buf, col, 1, fp);
assert(size);
fclose(fp);
if (size == 0L) {
free(buf);
return PEP_CANNOT_CREATE_TEMP_FILE;
}
message *msg = new_message(src->dir, src->from, src->to, src->shortmsg);
if (msg == NULL) {
free(buf);
return PEP_OUT_OF_MEMORY;
}
msg->longmsg = buf;
*dst = msg;
return PEP_STATUS_OK;
}
PEP_STATUS mime_decode_parts(const message *src, message **dst)
{
PEP_STATUS status = PEP_STATUS_OK;
assert(src);
assert(src->enc_format == PEP_enc_none_MIME);
assert(dst);
if (src->enc_format != PEP_enc_none_MIME)
return PEP_ILLEGAL_VALUE;
*dst = NULL;
return status;
}
PEP_STATUS encrypt_message(
DYNAMIC_API PEP_STATUS encrypt_message(
PEP_SESSION session,
const message *src,
stringlist_t * extra,
@ -182,6 +41,7 @@ PEP_STATUS encrypt_message(
message *msg = new_message(src->dir, from, to, NULL);
if (msg == NULL)
return PEP_OUT_OF_MEMORY;
msg->enc_format = PEP_enc_pieces;
from->me = true;
@ -234,15 +94,20 @@ PEP_STATUS encrypt_message(
char *ptext;
char *ctext = NULL;
size_t csize = 0;
msg->enc_format = PEP_enc_pieces;
switch (format) {
case PEP_enc_MIME_multipart: {
*dst = msg;
break;
message *interim;
// status = mime_encode_parts(src, &interim);
// assert(status == PEP_STATUS_OK);
// if (status != PEP_STATUS_OK)
// break;
msg->enc_format = PEP_enc_MIME_multipart;
}
case PEP_enc_pieces:
if (src->shortmsg && src->longmsg) {
if (src->shortmsg && src->longmsg && strcmp(src->shortmsg, "pEp") != 0) {
ptext = calloc(1, strlen(src->shortmsg) + strlen(src->longmsg)
+ 12);
if (ptext == NULL) {
@ -270,7 +135,7 @@ PEP_STATUS encrypt_message(
msg = NULL;
}
}
else if (src->shortmsg) {
else if (src->shortmsg && strcmp(src->shortmsg, "pEp") != 0) {
ptext = calloc(1, strlen(src->shortmsg) + 12);
if (ptext == NULL) {
free_message(msg);
@ -366,7 +231,6 @@ PEP_STATUS encrypt_message(
}
}
}
msg->enc_format = PEP_enc_pieces;
*dst = msg;
}
break;
@ -382,7 +246,7 @@ PEP_STATUS encrypt_message(
return status;
}
PEP_STATUS decrypt_message(
DYNAMIC_API PEP_STATUS decrypt_message(
PEP_SESSION session,
const message *src,
message **dst


+ 14
- 39
src/message_api.h View File

@ -7,47 +7,22 @@ extern "C" {
#include "transport.h"
// mime_encode_parts() - encode message with MIME
// parameters:
// src message to encode
// dst encoded message or NULL on error
//
// return value:
// error status or PEP_STATUS_OK on success
//
// caveat:
// message must be unencrypted
DYNAMIC_API PEP_STATUS mime_encode_parts(const message *src, message **dst);
// mime_decode_parts() - decode MIME message
// parameters:
// src message to decode
// dst decoded message or NULL on error
//
// return value:
// error status or PEP_STATUS_OK on success
//
// caveat:
// message must be unencrypted
DYNAMIC_API PEP_STATUS mime_decode_parts(const message *src, message **dst);
// encrypt_message() - encrypt message in memory
//
// parameters:
// session session handle
// src message to encrypt
// extra extra keys for encryption
// dst pointer to encrypted message or NULL on failure
// format encryption format
// session (in) session handle
// src (in) message to encrypt
// extra (in) extra keys for encryption
// dst (out) pointer to encrypted message or NULL on failure
// format (in) encryption format
//
// return value:
// error status or PEP_STATUS_OK on success; PEP_KEY_NOT_FOUND if one
// or more keys couldn't be found, but the message could be encrypted
// with other keys
// PEP_STATUS_OK on success
// PEP_KEY_NOT_FOUND at least one of the receipient keys
// could not be found
// PEP_KEY_HAS_AMBIG_NAME at least one of the receipient keys has
// an ambiguous name
// PEP_GET_KEY_FAILED cannot retrieve key
DYNAMIC_API PEP_STATUS encrypt_message(
PEP_SESSION session,
@ -61,9 +36,9 @@ DYNAMIC_API PEP_STATUS encrypt_message(
// decrypt_message() - decrypt message in memory
//
// parameters:
// session session handle
// src message to decrypt
// dst pointer to decrypted message or NULL on failure
// session (in) session handle
// src (in) message to decrypt
// dst (out) pointer to decrypted message or NULL on failure
//
// return value:
// error status or PEP_STATUS_OK on success


+ 180
- 0
src/mime.c View File

@ -0,0 +1,180 @@
#include "mime.h"
#include <libetpan/libetpan.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <errno.h>
#include <unistd.h>
#include "etpan_mime.h"
DYNAMIC_API PEP_STATUS mime_encode_text(
const char *plaintext,
const char *htmltext,
char **resulttext
)
{
struct mailmime * msg_mime = NULL;
struct mailimf_fields * fields = NULL;
struct mailmime * mime = NULL;
struct mailmime * submime = NULL;
int col;
int r;
int fd;
FILE *file = NULL;
size_t size;
char *buf = NULL;
PEP_STATUS error = PEP_OUT_OF_MEMORY;
assert(plaintext);
assert(resulttext);
*resulttext = NULL;
msg_mime = mailmime_new_message_data(NULL);
assert(msg_mime);
if (msg_mime == NULL)
goto enomem;
fields = mailimf_fields_new_empty();
assert(fields);
if (fields == NULL)
goto enomem;
mailmime_set_imf_fields(msg_mime, fields);
mime = part_multiple_new("multipart/mixed", NULL);
assert(mime);
if (mime == NULL)
goto enomem;
submime = get_text_part("text/plain", plaintext, strlen(plaintext),
MAILMIME_MECHANISM_QUOTED_PRINTABLE);
assert(submime);
if (submime == NULL) {
mailmime_free(msg_mime);
goto enomem;
}
r = mailmime_smart_add_part(mime, submime);
assert(r == MAILIMF_NO_ERROR);
if (r == MAILIMF_ERROR_MEMORY) {
mailmime_free(msg_mime);
goto enomem;
}
else {
// mailmime_smart_add_part() takes ownership of submime
submime = NULL;
}
r = mailmime_add_part(msg_mime, mime);
assert(r == MAILIMF_NO_ERROR);
if (r == MAILIMF_ERROR_MEMORY) {
goto enomem;
}
// mailmime_add_part() takes ownership of mime
char *template = strdup("/tmp/temp.XXXXXXXXXXXXXXXXXXXX");
assert(template);
if (template == NULL)
goto enomem;
do {
fd = mkstemp(template);
} while (fd == -1 && errno == EINTR);
assert(fd != -1);
if (fd == -1)
goto err_file;
r = unlink(template);
assert(r == 0);
if (r == -1)
goto err_file;
free(template);
template = NULL;
do {
file = fdopen(fd, "w+");
} while (file == NULL && errno == EINTR);
assert(file);
if (file == NULL) {
switch (errno) {
case ENOMEM:
goto enomem;
default:
goto err_file;
}
}
fd = -1;
col = 0;
r = mailmime_write_file(file, &col, mime);
assert(r == MAILIMF_NO_ERROR);
if (r == MAILIMF_ERROR_MEMORY)
goto enomem;
else if (r != MAILIMF_NO_ERROR)
goto err_file;
off_t len = ftello(file);
assert(len != -1);
if (len == -1 && errno == EOVERFLOW)
goto err_file;
if (len + 1 > SIZE_T_MAX)
goto err_buffer;
size = (size_t) len;
rewind(file);
buf = calloc(1, size + 1);
assert(buf);
if (buf == NULL)
goto enomem;
char *_buf = buf;
size_t rest = size;
for (size_t bytes_read = 0; rest > 0; rest -= bytes_read, _buf += rest) {
assert(feof(file) == 0);
if (feof(file))
goto err_file;
bytes_read = fread(_buf, rest, 1, file);
if (ferror(file))
goto err_file;
}
fclose(file);
mailmime_free(msg_mime);
*resulttext = buf;
return PEP_STATUS_OK;
err_buffer:
error = PEP_BUFFER_TOO_SMALL;
goto enomem;
err_file:
error = PEP_CANNOT_CREATE_TEMP_FILE;
enomem:
free(buf);
free(template);
if (file)
fclose(file);
else if (fd != -1)
close(fd);
if (msg_mime)
mailmime_free(msg_mime);
if (fields)
mailimf_fields_free(fields);
if (submime)
mailmime_free(submime);
return error;
}

+ 40
- 0
src/mime.h View File

@ -0,0 +1,40 @@
#pragma once
#include "pEpEngine.h"
#ifdef __cplusplus
extern "C" {
#endif
// mime_encode_text() - encode a MIME message
//
// parameters:
// plaintext (in) plaintext of message as UTF-8 string
// htmltext (in) optional HTML version of message as UTF-8
// string or NULL if it does not apply
// resulttext (out) the resulting encoded text
//
// return value:
// PEP_STATUS_OK if everything worked
// PEP_BUFFER_TOO_SMALL if encoded message size is too big to handle
// PEP_CANNOT_CREATE_TEMP_FILE
// if there are issues with temp files; in
// this case errno will contain the underlying
// error
// PEP_OUT_OF_MEMORY if not enough memory could be allocated
//
// caveat:
// the resulttext will go to the ownership of the caller; plaintext
// and htmltext will remain in the ownership of the caller
DYNAMIC_API PEP_STATUS mime_encode_text(
const char *plaintext,
const char *htmltext,
char **resulttext
);
#ifdef __cplusplus
}
#endif

+ 4
- 0
src/pEp_internal.h View File

@ -84,3 +84,7 @@ typedef struct _pEpSession {
sqlite3_stmt *set_trust;
sqlite3_stmt *get_trust;
} pEpSession;
PEP_STATUS init_transport_system(PEP_SESSION session);
void release_transport_system(PEP_SESSION session);

+ 12
- 12
src/transport.c View File

@ -27,7 +27,7 @@ void release_transport_system(PEP_SESSION session)
// nothing yet
}
identity_list *new_identity_list(pEp_identity *ident)
DYNAMIC_API identity_list *new_identity_list(pEp_identity *ident)
{
identity_list *id_list = calloc(1, sizeof(identity_list));
assert(id_list);
@ -41,7 +41,7 @@ identity_list *new_identity_list(pEp_identity *ident)
return id_list;
}
identity_list *identity_list_dup(const identity_list *src)
DYNAMIC_API identity_list *identity_list_dup(const identity_list *src)
{
assert(src);
@ -61,7 +61,7 @@ identity_list *identity_list_dup(const identity_list *src)
return id_list;
}
void free_identity_list(identity_list *id_list)
DYNAMIC_API void free_identity_list(identity_list *id_list)
{
if (id_list) {
free_identity_list(id_list->next);
@ -70,7 +70,7 @@ void free_identity_list(identity_list *id_list)
}
}
identity_list *identity_list_add(identity_list *id_list, pEp_identity *ident)
DYNAMIC_API identity_list *identity_list_add(identity_list *id_list, pEp_identity *ident)
{
assert(ident);
@ -90,7 +90,7 @@ identity_list *identity_list_add(identity_list *id_list, pEp_identity *ident)
}
}
bloblist_t *new_bloblist(char *blob, size_t size, const char *mime_type,
DYNAMIC_API bloblist_t *new_bloblist(char *blob, size_t size, const char *mime_type,
const char *file_name)
{
bloblist_t * bloblist = calloc(1, sizeof(bloblist_t));
@ -116,7 +116,7 @@ bloblist_t *new_bloblist(char *blob, size_t size, const char *mime_type,
return bloblist;
}
void free_bloblist(bloblist_t *bloblist)
DYNAMIC_API void free_bloblist(bloblist_t *bloblist)
{
if (bloblist) {
if (bloblist->next)
@ -128,7 +128,7 @@ void free_bloblist(bloblist_t *bloblist)
}
}
bloblist_t *bloblist_add(bloblist_t *bloblist, char *blob, size_t size,
DYNAMIC_API bloblist_t *bloblist_add(bloblist_t *bloblist, char *blob, size_t size,
const char *mime_type, const char *file_name)
{
assert(blob);
@ -165,7 +165,7 @@ bloblist_t *bloblist_add(bloblist_t *bloblist, char *blob, size_t size,
return bloblist_add(bloblist->next, blob, size, mime_type, file_name);
}
message *new_message(
DYNAMIC_API message *new_message(
PEP_msg_direction dir,
pEp_identity *from,
identity_list *to,
@ -193,7 +193,7 @@ message *new_message(
return msg;
}
void free_message(message *msg)
DYNAMIC_API void free_message(message *msg)
{
free(msg->id);
free(msg->shortmsg);
@ -210,7 +210,7 @@ void free_message(message *msg)
free(msg);
}
message_ref_list *new_message_ref_list(message *msg)
DYNAMIC_API message_ref_list *new_message_ref_list(message *msg)
{
message_ref_list *msg_list = calloc(1, sizeof(message_ref_list));
assert(msg_list);
@ -222,7 +222,7 @@ message_ref_list *new_message_ref_list(message *msg)
return msg_list;
}
void free_message_ref_list(message_ref_list *msg_list)
DYNAMIC_API void free_message_ref_list(message_ref_list *msg_list)
{
if (msg_list) {
free_message_ref_list(msg_list->next);
@ -230,7 +230,7 @@ void free_message_ref_list(message_ref_list *msg_list)
}
}
message_ref_list *message_ref_list_add(message_ref_list *msg_list, message *msg)
DYNAMIC_API message_ref_list *message_ref_list_add(message_ref_list *msg_list, message *msg)
{
assert(msg);


+ 34
- 28
src/transport.h View File

@ -1,9 +1,13 @@
#pragma once
#include "pEpEngine.h"
#include <time.h>
#include "pEpEngine.h"
#ifdef __cplusplus
extern "C" {
#endif
// all functions are using POSIX struct tm
// for time values all functions are using POSIX struct tm
typedef struct tm timestamp;
@ -27,7 +31,7 @@ typedef struct _identity_list {
// new_identity_list() - allocate a new identity list
//
// parameters:
// ident identity to move for first element
// ident (in) identity to move for first element
//
// return value:
// new identity_list or NULL if out of memory
@ -41,7 +45,7 @@ DYNAMIC_API identity_list *new_identity_list(pEp_identity *ident);
// identity_list_dup() - duplicate identity_list (deep copy)
//
// parameters:
// id_list identity_list to copy
// id_list (in) identity_list to copy
//
// return value:
// new identity_list or NULL if out of memory
@ -52,7 +56,7 @@ DYNAMIC_API identity_list *identity_list_dup(const identity_list *src);
// free_identity_list() - free memory allocated by identity_list
//
// parameters:
// id_list identity_list to free
// id_list (in) identity_list to free
//
// caveat:
// this function frees all identities in the list additional to the
@ -64,8 +68,8 @@ DYNAMIC_API void free_identity_list(identity_list *id_list);
// identity_list_add - add identity to an identity_list
//
// parameters:
// id_list identity_list to add to
// ident identity being added
// id_list (in) identity_list to add to
// ident (in) identity being added
//
// return value:
// pointer to the last element in identity_list or NULL if out of memory
@ -99,10 +103,10 @@ typedef struct _bloblist_t {
// new_bloblist() - allocate a new bloblist
//
// parameters:
// blob blob to add to the list
// size size of the blob
// mime_type MIME type of the blob data or NULL if unknown
// file_name file name of origin of blob data or NULL if unknown
// blob (in) blob to add to the list
// size (in) size of the blob
// mime_type (in) MIME type of the blob data or NULL if unknown
// file_name (in) file name of origin of blob data or NULL if unknown
//
// return value:
// pointer to new bloblist_t or NULL if out of memory
@ -118,7 +122,7 @@ DYNAMIC_API bloblist_t *new_bloblist(char *blob, size_t size, const char *mime_t
// free_bloblist() - free bloblist
//
// parameters:
// bloblist bloblist to free
// bloblist (in) bloblist to free
DYNAMIC_API void free_bloblist(bloblist_t *bloblist);
@ -126,11 +130,11 @@ DYNAMIC_API void free_bloblist(bloblist_t *bloblist);
// bloblist_add() - add reference to a blob to bloblist
//
// parameters:
// bloblist bloblist to add to
// blob blob
// size size of the blob
// mime_type MIME type of the blob or NULL if unknown
// file_name file name of the blob or NULL if unknown
// bloblist (in) bloblist to add to
// blob (in) blob
// size (in) size of the blob
// mime_type (in) MIME type of the blob or NULL if unknown
// file_name (in) file name of the blob or NULL if unknown
//
// return value:
// pointer to the last element of bloblist or NULL if out of memory
@ -176,6 +180,7 @@ typedef struct _message {
// is received
identity_list *cc; // whom a CC is being sent
identity_list *bcc; // whom a BCC is being sent
pEp_identity *reply_to; // where a reply should go to
char * refering_id; // UTF-8 string of refering message ID
struct _message *refering_msg_ref; // reference to refering message
struct _message_ref_list *refered_by; // list of references to messages being
@ -192,10 +197,10 @@ typedef struct _message_ref_list {
// new_message() - allocate new message
//
// parameters:
// dir PEP_dir_incoming or PEP_dir_outgoing
// from identity whom the message is from
// to identity list whom the message is sent to
// shortmsg UTF-8 string of short message
// dir (in) PEP_dir_incoming or PEP_dir_outgoing
// from (in) identity whom the message is from
// to (in) identity list whom the message is sent to
// shortmsg (in) UTF-8 string of short message
//
// return value:
// pointer to new message or NULL if out of memory
@ -216,7 +221,7 @@ DYNAMIC_API message *new_message(
// free_message() - free message struct
//
// parameters:
// msg message struct to free
// msg (in) message struct to free
//
// caveat:
// raw data as well as referenced other messages aren't freed and remain
@ -228,7 +233,7 @@ DYNAMIC_API void free_message(message *msg);
// new_message_ref_list() - allocate new message reference list
//
// parameters:
// msg message to add a reference to or NULL
// msg (in) message to add a reference to or NULL
//
// return value:
// pointer to new message_ref_list or NULL if out of memory
@ -239,7 +244,7 @@ DYNAMIC_API message_ref_list *new_message_ref_list(message *msg);
// free_message_ref_list() - free message reference list
//
// parameters:
// msg_list message_ref_list to free
// msg_list (in) message_ref_list to free
DYNAMIC_API void free_message_ref_list(message_ref_list *msg_list);
@ -248,8 +253,8 @@ DYNAMIC_API void free_message_ref_list(message_ref_list *msg_list);
// list
//
// parameters:
// msg_list message_ref_list to add to
// msg message to add a reference to
// msg_list (in) message_ref_list to add to
// msg (in) message to add a reference to
//
// return value:
// pointer to the last element of message_ref_list or NULL if out of
@ -276,6 +281,7 @@ struct _PEP_transport_t {
typedef uint64_t transports_mask;
PEP_STATUS init_transport_system(PEP_SESSION session);
void release_transport_system(PEP_SESSION session);
#ifdef __cplusplus
}
#endif

+ 105
- 106
test/DF9B1541-sec.key View File

@ -1,106 +1,105 @@
-----BEGIN PGP PRIVATE KEY BLOCK-----
Version: GnuPG v2.0.22 (MingW32)
lQcYBFLefd0BEADB97Pmcz0yfkOWD2978HRUCUa7H4JpuDHZs+hurMlkuE7mLGh5
PAQ61/nL5gppl0cHFNlO7doG2gcRixWZfeQZywkJia5xNzcdjyAiC5jZ6IQpXk2T
wwzBIDYrU+9DhppY5hnE90yDv0MBS2SVjDergZTPDBbIYPTtPf5h51pVULCAtiyN
2Htv3M3tDwJJ9IrLFpJL+ClocgrmeDANKbico63qlBl9NjiUqdnt5INoE6/SnKSu
zaBE37C+/10bswFpjjVffyhu+hplxp6MlalZZYJEip6rmDe0P+nMbEmNvNuUmZwc
sPwvr1vRwhGGpZao2j4/SnDsKNNmsLrwyVEQboHYcKIgLEuHY4WtHDUt6umu7zdt
I6VDUoiSuNkVB+TM51HeQOoLZJ4Evcrdh6zKB2wWMW1RJQIknlMDwnRhHj+WJD06
texTzvAfDdsHV6NNs2WeUKesyivCyaKMPU7o95D+ZMi22CQ2qUCSLegivpnk/gKS
pM+JqwyAPnzJBW43qr13zA0tWMO2nzSzcYnRhTNTGeqkxn7t2Uc0ItMk360Xy7n6
yI2AL79daP0NGM9P0F4wD44FCnrvcDO0gbk3zJJnynnfFSF6Dk4/2sRUPsp2gm9B
hiHFt4w13mySETjd0sbcQYbpHZbJE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+/zLY8QbTSOS6S0prdpcXQ1tNsd4q
bvJN6oJAcJKMKa5BIeWmM6Tf1SDzpmr9cNSqOH66ZML4QSkd36A6qWExj1TBQC/I
7JBovzUJZJyJqGGn3Z0o9HsOOxBOP/x5r5iocBkgSXG/lrcGOAwPzzKJasmOxtOV
TXTFSory++SkgbexYYz7sd52p3PzVAf2Yueup2krBl/zSOcVfgPke5lDtZENqkBc
BewebdigBRUzPHGeiUV+yh+T5d7opvPcavCPabff5vwRJpc18nYmavtXXKL/Zm5a
XF1HGCUh2EEl9ZM03KJeX6biC+n3uqpI6vZ3eGvv7q/td5Hlr+qJ4gtLQ0vqUaY8
QCgi17ssHOkh3nWJTM4GoocoX4zQVo28hN5dEi0voU2ShIjEafha3fFzkxniSavw
zh/s4f1rpbQXO+ueWPlsLWVTIOEfsqMO3O1HpdZyHIsAvDeMWkPbEWoYsvPlItnb
n7MzXc4oJ1F+R1tsgGVvgu/Q45MtNxZ8CXftS95a/J61MVY103yI5gpGgNLj+X0U
+N3C7yIoyB94aBWuQF/F53IQVNIo
=Onin
-----END PGP PRIVATE KEY BLOCK-----

+ 65
- 52
test/DF9B1541.key View File

@ -1,52 +1,65 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.22 (MingW32)
mQINBFLefd0BEADB97Pmcz0yfkOWD2978HRUCUa7H4JpuDHZs+hurMlkuE7mLGh5
PAQ61/nL5gppl0cHFNlO7doG2gcRixWZfeQZywkJia5xNzcdjyAiC5jZ6IQpXk2T
wwzBIDYrU+9DhppY5hnE90yDv0MBS2SVjDergZTPDBbIYPTtPf5h51pVULCAtiyN
2Htv3M3tDwJJ9IrLFpJL+ClocgrmeDANKbico63qlBl9NjiUqdnt5INoE6/SnKSu
zaBE37C+/10bswFpjjVffyhu+hplxp6MlalZZYJEip6rmDe0P+nMbEmNvNuUmZwc
sPwvr1vRwhGGpZao2j4/SnDsKNNmsLrwyVEQboHYcKIgLEuHY4WtHDUt6umu7zdt
I6VDU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ShIjEafha3fFzkxniSavwzh/s4f1rpbQXO+ueWPlsLWVTIOEfsqMO3O1H
pdZyHIsAvDeMWkPbEWoYsvPlItnbn7MzXc4oJ1F+R1tsgGVvgu/Q45MtNxZ8CXft
S95a/J61MVY103yI5gpGgNLj+X0U+N3C7yIoyB94aBWuQF/F53IQVNIo
=6vQn
-----END PGP PUBLIC KEY BLOCK-----

+ 8
- 37
test/Makefile View File

@ -1,55 +1,26 @@
include ../Makefile.conf
ifeq ($(BUILD_FOR),Windoze)
CXX=i686-w64-mingw32-g++
LD=i686-w64-mingw32-c++
LDFLAGS=-lstdc++
else ifeq ($(BUILD_FOR),MINGW32_NT-6.1)
CXX=g++ -std=gnu++11 -DWIN32 -pthread
LD=g++
LDFLAGS=-L../src -lpEpEngine -lstdc++
else
CC=g++ -std=gnu++11 -pthread
CXX=g++ -std=gnu++11 -pthread
LD=g++
LD=$(CXX)
LDFLAGS=-L$(HOME)/lib -lpEpEngine -lstdc++
endif
CXXFLAGS=-g -O0 -I../src
# CXXFLAGS=-O3 -DNDEBUG
TARGET=pEpEngineTest
ifeq ($(BUILD_FOR),Windoze)
all: $(TARGET).exe
UNIT_TEST_SOURCE=$(wildcard *_test.cc)
UNIT_TESTS=$(subst .cc,,$(UNIT_TEST_SOURCE))
$(TARGET).exe: $(TARGET).o ../src/libpEpEngine.a
$(CXX) $(LDFLAGS) -o $(TARGET).exe $(TARGET).o ../src/libpEpEngine.a
else ifeq ($(BUILD_FOR),MINGW32_NT-6.1)
all: $(TARGET).exe pEpEngine.dll
$(TARGET).exe: $(TARGET).o ../src/libpEpEngine.a
$(CXX) $(LDFLAGS) -o $(TARGET).exe $(TARGET).o ../src/libpEpEngine.a
else
all: $(TARGET)
$(TARGET): $(TARGET).o
$(CXX) $(LDFLAGS) -o $(TARGET) $(TARGET).o
endif
%.o: %.cc ../pEpEngine.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
pEpEngine.dll: ../src/pEpEngine.dll
cp $< $@
all: $(TARGET) $(UNIT_TESTS)
.PHONY: clean
clean:
rm -f *.o $(TARGET) *.exe *.a *~ pEpEngine.dll message_api_test
rm -f *.o $(TARGET) *.a *~ $(UNIT_TESTS)
test: all
test: pEpEngineTest
LD_LIBRARY_PATH=~/lib:../src ./pEpEngineTest
message_api_test: message_api_test.o
$(LD) $(LDFLAGS) -o message_api_test message_api_test.o
unit_tests: $(UNIT_TESTS)
LD_LIBRARY_PATH=~/lib:../src ./unit_tests

+ 16
- 17
test/message_api_test.cc View File

@ -21,27 +21,26 @@ int main() {
assert(msg);
cout << "message created.\n";
cout << "encrypting message…\n";
message *enc_msg;
// cout << "encrypting message in pieces…\n";
// message *enc_msg;
// cout << "calling encrypt_message()\n";
// PEP_STATUS status2 = encrypt_message(session, msg, NULL, &enc_msg, PEP_enc_pieces);
// assert(status2 == PEP_STATUS_OK);
// assert(enc_msg);
// cout << "message encrypted.\n";
cout << "encrypting message as MIME multipart…\n";
message *enc_msg2;
cout << "calling encrypt_message()\n";
PEP_STATUS status2 = encrypt_message(session, msg, NULL, &enc_msg, PEP_enc_pieces);
assert(status2 == PEP_STATUS_OK);
assert(enc_msg);
PEP_STATUS status3 = encrypt_message(session, msg, NULL, &enc_msg2, PEP_enc_MIME_multipart);
assert(status3 == PEP_STATUS_OK);
assert(enc_msg2);
cout << "message encrypted.\n";
// cout << "MIME encoding message…\n";
// message *mmsg;
// PEP_STATUS status3 = mime_encode_parts(msg, &mmsg);
// assert(mmsg);
// assert(status3 == PEP_STATUS_OK);
// cout << "message:\n";
// cout << mmsg->longmsg;
// cout << "\n";
cout << "freeing messages…\n";
free_message(msg);
free_message(enc_msg);
// free_message(mmsg);
// free_message(enc_msg);
free_message(enc_msg2);
cout << "done.\n";
cout << "calling release()\n";


Loading…
Cancel
Save