From 3286368683000cc7778a4bce8dd5ad312f08a5d9 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Thu, 23 Jun 2016 22:55:45 +0200 Subject: [PATCH 01/53] constants: backup keysize and nonce --- lib/constants.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/constants.h b/lib/constants.h index a9cfb1b2..a6f9315d 100644 --- a/lib/constants.h +++ b/lib/constants.h @@ -39,8 +39,10 @@ #define PUBLIC_KEY_SIZE crypto_box_PUBLICKEYBYTES #define PUBLIC_MASTER_KEY_SIZE crypto_sign_PUBLICKEYBYTES #define PRIVATE_MASTER_KEY_SIZE crypto_sign_SECRETKEYBYTES +#define BACKUP_KEY_SIZE crypto_secretbox_KEYBYTES //nonce sizes #define MESSAGE_NONCE_SIZE crypto_secretbox_NONCEBYTES #define HEADER_NONCE_SIZE crypto_aead_chacha20poly1305_NPUBBYTES +#define BACKUP_NONCE_SIZE crypto_secretbox_NONCEBYTES #endif From ef6fd02ef98e36a66912e5627371834deaa683f4 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Thu, 23 Jun 2016 23:45:52 +0200 Subject: [PATCH 02/53] new function molch_update_backup_key This creates a new key that will be used to encrypt the exported library state --- lib/molch.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++ lib/molch.h | 8 ++++++++ test/molch-test.c | 12 ++++++++++++ 3 files changed, 70 insertions(+) diff --git a/lib/molch.c b/lib/molch.c index ae43f130..12fd0594 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -36,6 +36,7 @@ //global user store static user_store *users = NULL; +static buffer_t *backup_key = NULL; /* * Create a prekey list. @@ -1257,3 +1258,52 @@ return_status molch_get_prekey_list( cleanup: return status; } + +/* + * Generate and return a new key for encrypting the exported library state. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occured. + */ +return_status molch_update_backup_key(unsigned char * const new_key /*output with length of BACKUP_KEY_SIZE */) { + return_status status = return_status_init(); + + buffer_create_with_existing_array(new_key_buffer, new_key, BACKUP_KEY_SIZE); + + if (new_key == NULL) { + throw(INVALID_INPUT, "Invalid input to molch_update_backup_key."); + } + + // create a backup key buffer if it doesnt exist already + if (backup_key == NULL) { + backup_key = buffer_create_with_custom_allocator(BACKUP_KEY_SIZE, 0, sodium_malloc, sodium_free); + if (backup_key == NULL) { + throw(CREATION_ERROR, "Failed to create backup key buffer."); + } + } + + //make backup key buffer writable + if (sodium_mprotect_readwrite(backup_key) != 0) { + throw(GENERIC_ERROR, "Failed to make backup key readwrite."); + } + //make the content of the backup key writable + if (sodium_mprotect_readwrite(backup_key->content) != 0) { + throw(GENERIC_ERROR, "Failed to make backup key content readwrite."); + } + + if (buffer_fill_random(backup_key, BACKUP_KEY_SIZE) != 0) { + throw(KEYGENERATION_FAILED, "Failed to generate new backup key."); + } + + if (buffer_clone(new_key_buffer, backup_key) != 0) { + throw(BUFFER_ERROR, "Failed to copy new backup key."); + } + +cleanup: + if (backup_key != NULL) { + sodium_mprotect_readonly(backup_key); + sodium_mprotect_readonly(backup_key->content); + } + + return status; +} diff --git a/lib/molch.h b/lib/molch.h index 8a7ca103..26471a67 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -283,4 +283,12 @@ return_status molch_get_prekey_list( unsigned char * const public_signing_key, unsigned char ** const prekey_list, //output, free after use size_t * const prekey_list_length) __attribute__((warn_unused_result)); + +/* + * Generate and return a new key for encrypting the exported library state. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occured. + */ +return_status molch_update_backup_key(unsigned char * const new_key /*output with length of BACKUP_KEY_SIZE */) __attribute__((warn_unused_result)); #endif diff --git a/test/molch-test.c b/test/molch-test.c index a1439d08..59aa5d6f 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -36,6 +36,9 @@ int main(void) { int status_int = 0; return_status status = return_status_init(); + //backup key buffer + buffer_t *backup_key = buffer_create_on_heap(BACKUP_KEY_SIZE, BACKUP_KEY_SIZE); + //create conversation buffers buffer_t *alice_conversation = buffer_create_on_heap(CONVERSATION_ID_SIZE, CONVERSATION_ID_SIZE); buffer_t *bob_conversation = buffer_create_on_heap(CONVERSATION_ID_SIZE, CONVERSATION_ID_SIZE); @@ -106,6 +109,14 @@ int main(void) { throw(INVALID_VALUE, "Wrong user count."); } + //create a new backup key + status = molch_update_backup_key(backup_key->content); + throw_on_error(KEYGENERATION_FAILED, "Failed to update the backup key."); + + printf("Updated backup key:\n"); + print_hex(backup_key); + putchar('\n'); + //create another user buffer_create_from_string(bob_head_on_keyboard, "jnu8h77z6ht56ftgnujh"); status = molch_create_user( @@ -383,6 +394,7 @@ int main(void) { buffer_destroy_from_heap(bob_conversation); buffer_destroy_from_heap(alice_public_identity); buffer_destroy_from_heap(bob_public_identity); + buffer_destroy_from_heap(backup_key); if (status.status != SUCCESS) { print_errors(&status); From 06c2ee0c54586ef8bcb0cd8ec3762cf293250dff Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 26 Jun 2016 15:26:10 +0200 Subject: [PATCH 03/53] Temporarily disable Lua bindings --- bindings/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt index cc7a7d09..bc4a2aca 100644 --- a/bindings/CMakeLists.txt +++ b/bindings/CMakeLists.txt @@ -1,6 +1,6 @@ option(GENERATE_LUA_BINDINGS "Enable the Lua binding for testing purposes" ON) -if(GENERATE_LUA_BINDINGS AND (NOT APPLE)) +if(GENERATE_LUA_BINDINGS AND (NOT APPLE) AND FALSE) find_package(SWIG) if(SWIG_FOUND) include(${SWIG_USE_FILE}) From 76991aaef1d9d528d08b41381061bd5a9957d743 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 26 Jun 2016 19:34:48 +0200 Subject: [PATCH 04/53] utils: print_to_file: enable writing binary data --- test/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils.c b/test/utils.c index 4aa47c1b..038b3d6a 100644 --- a/test/utils.c +++ b/test/utils.c @@ -54,7 +54,7 @@ void print_to_file(const buffer_t * const data, const char * const filename) { return; } - fprintf(file, "%.*s", (int)data->content_length, (char*)data->content); + fwrite(data->content, 1, data->content_length, file); fclose(file); } From ea0e160d73dccfe31ec356cf8d68e2b48137ade2 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 26 Jun 2016 20:03:36 +0200 Subject: [PATCH 05/53] molch: new functions molch_export and molch_import Those functions to encrypted export and import. This commit also enables encryption when exporting the entire library state via other functions. --- lib/molch.c | 222 ++++++++++++++++++++++----- lib/molch.h | 44 +++--- test/molch-init-test.c | 63 +++++--- test/molch-test.c | 137 +++++++++++------ test/test-data/CMakeLists.txt | 2 +- test/test-data/molch-init-backup.key | Bin 0 -> 32 bytes test/test-data/molch-init.backup | Bin 0 -> 19209 bytes test/test-data/molch-init.json | 1 - 8 files changed, 341 insertions(+), 128 deletions(-) create mode 100644 test/test-data/molch-init-backup.key create mode 100644 test/test-data/molch-init.backup delete mode 100644 test/test-data/molch-init.json diff --git a/lib/molch.c b/lib/molch.c index 12fd0594..26975e46 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -38,6 +38,12 @@ static user_store *users = NULL; static buffer_t *backup_key = NULL; +//function prototypes +return_status molch_json_import(const unsigned char* const json, const size_t length) __attribute__((warn_unused_result)); +return_status molch_json_export( + unsigned char ** const json, + size_t *length) __attribute__((warn_unused_result)); + /* * Create a prekey list. */ @@ -133,8 +139,8 @@ return_status molch_create_user( size_t *const prekey_list_length, const unsigned char *const random_data, const size_t random_data_length, - unsigned char **const json_export, //optional, can be NULL, exports the entire library state as json, free with sodium_free, check if NULL before use! - size_t *const json_export_length //optional, can be NULL + unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! + size_t *const backup_length //optional, can be NULL ) { return_status status = return_status_init(); bool user_store_created = false; @@ -168,12 +174,12 @@ return_status molch_create_user( prekey_list_length); throw_on_error(CREATION_ERROR, "Failed to create prekey list."); - if (json_export != NULL) { - if (json_export_length == NULL) { - *json_export = NULL; + if (backup != NULL) { + if (backup_length == 0) { + *backup = NULL; } else { - status = molch_json_export(json_export, json_export_length); - throw_on_error(EXPORT_ERROR, "Failed to export JSON."); + status = molch_export(backup, backup_length); + throw_on_error(EXPORT_ERROR, "Failed to export."); } } @@ -194,8 +200,8 @@ return_status molch_create_user( */ return_status molch_destroy_user( const unsigned char *const public_signing_key, - unsigned char **const json_export, //optional, can be NULL, exports the entire library state as json, free with sodium_free, check if NULL before use! - size_t *const json_export_length //optional, can be NULL + unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! + size_t *const backup_length //optional, can be NULL ) { return_status status = return_status_init(); @@ -209,12 +215,12 @@ return_status molch_destroy_user( status = user_store_remove_by_key(users, public_signing_key_buffer); throw_on_error(REMOVE_ERROR, "Failed to remoe user from user store by key."); - if (json_export != NULL) { - if (json_export_length == NULL) { - *json_export = NULL; + if (backup != NULL) { + if (backup_length == 0) { + *backup = NULL; } else { - status = molch_json_export(json_export, json_export_length); - throw_on_error(EXPORT_ERROR, "Failed to export JSON."); + status = molch_export(backup, backup_length); + throw_on_error(EXPORT_ERROR, "Failed to export."); } } @@ -395,8 +401,8 @@ return_status molch_create_send_conversation( const size_t prekey_list_length, const unsigned char *const sender_public_signing_key, //signing key of the sender (user) const unsigned char *const receiver_public_signing_key, //signing key of the receiver - unsigned char **const json_export, //optional, can be NULL, exports the entire library state as json, free with sodium_free, check if NULL before use! - size_t *const json_export_length //optional, can be NULL + unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! + size_t *const backup_length //optional, can be NULL ) { //create buffers wrapping the raw input buffer_create_with_existing_array(conversation_id_buffer, (unsigned char*)conversation_id, CONVERSATION_ID_SIZE); @@ -467,12 +473,12 @@ return_status molch_create_send_conversation( *packet = packet_buffer->content; *packet_length = packet_buffer->content_length; - if (json_export != NULL) { - if (json_export_length == NULL) { - *json_export = NULL; + if (backup != NULL) { + if (backup_length == 0) { + *backup = NULL; } else { - status = molch_json_export(json_export, json_export_length); - throw_on_error(EXPORT_ERROR, "Failed to export JSON."); + status = molch_export(backup, backup_length); + throw_on_error(EXPORT_ERROR, "Failed to export."); } } @@ -522,8 +528,8 @@ return_status molch_create_receive_conversation( size_t * const prekey_list_length, const unsigned char * const sender_public_signing_key, //signing key of the sender const unsigned char * const receiver_public_signing_key, //signing key of the receiver (user) - unsigned char ** const json_export, //optional, can be NULL, exports the entire library state as json, free with sodium_free, check if NULL before use! - size_t * const json_export_length //optional, can be NULL + unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! + size_t * const backup_length //optional, can be NULL ) { return_status status = return_status_init(); @@ -578,12 +584,12 @@ return_status molch_create_receive_conversation( *message = message_buffer->content; *message_length = message_buffer->content_length; - if (json_export != NULL) { - if (json_export_length == NULL) { - *json_export = NULL; + if (backup != NULL) { + if (backup_length == 0) { + *backup = NULL; } else { - status = molch_json_export(json_export, json_export_length); - throw_on_error(EXPORT_ERROR, "Failed to export JSON."); + status = molch_export(backup, backup_length); + throw_on_error(EXPORT_ERROR, "Failed to export."); } } @@ -704,7 +710,7 @@ return_status molch_encrypt_message( *packet_length = packet_buffer->content_length; if (json_export_conversation != NULL) { - if (json_export_conversation_length == NULL) { + if (json_export_conversation_length == 0) { *json_export_conversation = NULL; } else { status = molch_conversation_json_export(json_export_conversation, conversation->id->content, json_export_conversation_length); @@ -770,7 +776,7 @@ return_status molch_decrypt_message( *message_length = message_buffer->content_length; if (json_export_conversation != NULL) { - if (json_export_conversation_length == NULL) { + if (json_export_conversation_length == 0) { *json_export_conversation = NULL; } else { status = molch_conversation_json_export(json_export_conversation, conversation->id->content, json_export_conversation_length); @@ -798,8 +804,8 @@ return_status molch_decrypt_message( */ void molch_end_conversation( const unsigned char * const conversation_id, - unsigned char ** const json_export, //optional, can be NULL, exports the entire library state as json, free with sodium_free, check if NULL before use! - size_t * const json_export_length + unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! + size_t * const backup_length ) { return_status status = return_status_init(); @@ -822,13 +828,13 @@ void molch_end_conversation( ) conversation_store_remove_by_id(user->conversations, conversation->id); - if (json_export != NULL) { - if (json_export_length == NULL) { - *json_export = NULL; + if (backup != NULL) { + if (backup_length == 0) { + *backup = NULL; } else { - return_status status = molch_json_export(json_export, json_export_length); + return_status status = molch_export(backup, backup_length); if (status.status != SUCCESS) { - *json_export = NULL; + *backup = NULL; } return_status_destroy_errors(&status); } @@ -1171,6 +1177,89 @@ return_status molch_json_export( return status; } +/* + * Serialise molch's internal state. The output is encrypted with the backup key. + * + * Don't forget to free the output after use. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occured. + */ +return_status molch_export( + unsigned char ** const backup, //output, free after use + size_t *length) { + return_status status = return_status_init(); + + unsigned char *json = NULL; + size_t json_length = 0; + + //buffers + buffer_t *backup_buffer = NULL; + buffer_t *backup_nonce = buffer_create_on_heap(BACKUP_NONCE_SIZE, 0); + + if ((backup == NULL) || (length == NULL)) { + throw(INVALID_INPUT, "Invalid input to molch_export."); + } + + if ((backup_key == NULL) || (backup_key->content_length == 0)) { + throw(INCORRECT_DATA, "No backup key found."); + } + + status = molch_json_export(&json, &json_length); + throw_on_error(EXPORT_ERROR, "Failed to export the library state to JSON."); + + backup_buffer = buffer_create_on_heap(json_length + BACKUP_NONCE_SIZE + crypto_secretbox_MACBYTES, json_length + BACKUP_NONCE_SIZE + crypto_secretbox_MACBYTES); + if (backup_buffer == NULL) { + throw(ALLOCATION_FAILED, "Failed to create backup buffer."); + } + + //generate the nonce + if (buffer_fill_random(backup_nonce, BACKUP_NONCE_SIZE) != 0) { + throw(GENERIC_ERROR, "Failed to generate backup nonce."); + } + + //encrypt the JSON + int status_int = crypto_secretbox_easy( + backup_buffer->content, + json, + json_length, + backup_nonce->content, + backup_key->content); + if (status_int != 0) { + throw(ENCRYPT_ERROR, "Failed to encrypt library state."); + } + + //copy the nonce at the end of the output + status_int = buffer_copy_to_raw( + backup_buffer->content, + json_length + crypto_secretbox_MACBYTES, + backup_nonce, + 0, + BACKUP_NONCE_SIZE); + if (status_int != 0) { + throw(BUFFER_ERROR, "Failed to copy nonce to backup."); + } + + *backup = backup_buffer->content; + *length = backup_buffer->content_length; + + free(backup_buffer); + +cleanup: + on_error( + if (backup_buffer != NULL) { + buffer_destroy_from_heap(backup_buffer); + } + ); + + buffer_destroy_from_heap(backup_nonce); + if (json != NULL) { + sodium_free(json); + } + + return status; +} + /* * Import the molch's state from JSON (overwrites the current state!) * @@ -1230,6 +1319,65 @@ return_status molch_json_import(const unsigned char *const json, const size_t le return status; } +/* + * Import molch's internal state from a backup (overwrites the current state) + * and generates a new backup key. + * + * The backup key is needed to decrypt the backup. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occured. + */ +return_status molch_import( + unsigned char * const backup, + const size_t backup_length, + const unsigned char * const local_backup_key, //BACKUP_KEY_SIZE + unsigned char * const new_backup_key //BACKUP_KEY_SIZE, can be the same pointer as the backup key + ) { + return_status status = return_status_init(); + + buffer_t *json = buffer_create_with_custom_allocator(backup_length, 0, sodium_malloc, sodium_free); + + //check input + if ((backup == NULL) || (local_backup_key == NULL)) { + throw(INVALID_INPUT, "Invalid input to molch_import."); + } + + + //check the lengths + if (backup_length < BACKUP_NONCE_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Backup is too short."); + } + + size_t json_length = backup_length - BACKUP_NONCE_SIZE - crypto_secretbox_MACBYTES; + + //decrypt the backup + int status_int = crypto_secretbox_open_easy( + json->content, + backup, + backup_length - BACKUP_NONCE_SIZE, + backup + backup_length - BACKUP_NONCE_SIZE, + local_backup_key); + if (status_int != 0) { + throw(DECRYPT_ERROR, "Failed to decrypt backup."); + } + + json->content_length = json_length; + + status = molch_update_backup_key(new_backup_key); + throw_on_error(KEYGENERATION_FAILED, "Faild to generate a new backup key."); + + status = molch_json_import( + json->content, + json->content_length); + throw_on_error(IMPORT_ERROR, "Failed to import from decrypted JSON."); + +cleanup: + buffer_destroy_with_custom_deallocator(json, sodium_free); + + return status; +} + /* * Get a signed list of prekeys for a given user. * diff --git a/lib/molch.h b/lib/molch.h index 26471a67..377fa99b 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -53,8 +53,8 @@ return_status molch_create_user( size_t *const prekey_list_length, const unsigned char *const random_data, const size_t random_data_length, - unsigned char **const json_export, //optional, can be NULL, exports the entire library state as json, free with sodium_free, check if NULL before use! - size_t *const json_export_length //optional, can be NULL + unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! + size_t *const backup_length //optional, can be NULL ) __attribute__((warn_unused_result)); /* @@ -65,8 +65,8 @@ return_status molch_create_user( */ return_status molch_destroy_user( const unsigned char *const public_signing_key, - unsigned char **const json_export, //optional, can be NULL, exports the entire library state as json, free with sodium_free, check if NULL before use - size_t *const json_export_length //optional, can be NULL + unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use + size_t *const backup_length //optional, can be NULL ); /* @@ -122,8 +122,8 @@ return_status molch_create_send_conversation( const size_t prekey_list_length, const unsigned char * const sender_public_signing_key, //signing key of the sender (user) const unsigned char * const receiver_public_signing_key, //signing key of the receiver - unsigned char ** const json_export, //optional, can be NULL, exports the entire library state as json, free with sodium_free, check if NULL before use! - size_t * const json_export_length //optional, can be NULL + unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! + size_t * const backup_length //optional, can be NULL ) __attribute__((warn_unused_result)); /* @@ -148,8 +148,8 @@ return_status molch_create_receive_conversation( size_t * const prekey_list_length, const unsigned char * const sender_public_signing_key, //signing key of the sender const unsigned char * const receiver_public_signing_key, //signing key of the receiver (user) - unsigned char ** const json_export, //optional, can be NULL, exports the entire library state as json, free with sodium_free, check if NULL before use! - size_t * const json_export_length //optional, can be NULL + unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! + size_t * const backup_length //optional, can be NULL ) __attribute__((warn_unused_result)); /* @@ -193,8 +193,8 @@ return_status molch_decrypt_message( */ void molch_end_conversation( const unsigned char * const conversation_id, - unsigned char ** const json_export, //optional, can be NULL, exports the entire library state as json, free with sodium_free, check if NULL before use! - size_t * const json_export_length + unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! + size_t * const backup_length ); /* @@ -246,15 +246,15 @@ return_status molch_conversation_json_export( size_t * const length) __attribute__((warn_unused_result)); /* - * Serialise molch's state into JSON. + * Serialise molch's internal state. The output is encrypted with the backup key. * - * Use sodium_free to free json after use. + * Don't forget to free the output after use. * * Don't forget to destroy the return status with molch_destroy_return_status() - * if an error has occurred. + * if an error has occured. */ -return_status molch_json_export( - unsigned char ** const json, +return_status molch_export( + unsigned char ** const backup, //output, free after use size_t *length) __attribute__((warn_unused_result)); /* @@ -266,12 +266,20 @@ return_status molch_json_export( return_status molch_conversation_json_import(const unsigned char * const json, const size_t length) __attribute__((warn_unused_result)); /* - * Import the molch's state from JSON (overwrites the current state!) + * Import molch's internal state from a backup (overwrites the current state) + * and generates a new backup key. + * + * The backup key is needed to decrypt the backup. * * Don't forget to destroy the return status with molch_destroy_return_status() - * if an error has occurred. + * if an error has occured. */ -return_status molch_json_import(const unsigned char* const json, const size_t length) __attribute__((warn_unused_result)); +return_status molch_import( + unsigned char * const backup, + const size_t backup_length, + const unsigned char * const backup_key, //BACKUP_KEY_SIZE + unsigned char * const new_backup_key //BACKUP_KEY_SIZE, can be the same pointer as the backup key + ) __attribute__((warn_unused_result)); /* * Get a signed list of prekeys for a given user. diff --git a/test/molch-init-test.c b/test/molch-init-test.c index 2b2f3190..afa27a0c 100644 --- a/test/molch-init-test.c +++ b/test/molch-init-test.c @@ -29,27 +29,43 @@ int main(void) { /* don't initialize libsodium here */ buffer_t *user_id = buffer_create_on_heap(PUBLIC_MASTER_KEY_SIZE, PUBLIC_MASTER_KEY_SIZE); - buffer_t *json_backup = NULL; //json backup to import from - unsigned char *json = NULL; + buffer_t *backup_file = NULL; //backup to import from + buffer_t *backup_key_file = NULL; + + unsigned char *backup = NULL; unsigned char *prekey_list = NULL; + unsigned char *backup_key = malloc(BACKUP_KEY_SIZE); return_status status = return_status_init(); - //load the json backup from a file - read_file(&json_backup, "test-data/molch-init.json"); - if (json_backup == NULL) { - throw(DATA_FETCH_ERROR, "Failed to read JSON backup from a file."); + if (sodium_init() != 0) { + throw(INIT_ERROR, "Failed to initialize libsodium."); + } + + //load the backup from a file + read_file(&backup_file, "test-data/molch-init.backup"); + if (backup_file == NULL) { + throw(DATA_FETCH_ERROR, "Failed to read backup from a file."); + } + + //load the backup key from a file + read_file(&backup_key_file, "test-data/molch-init-backup.key"); + if (backup_key_file == NULL) { + throw(DATA_FETCH_ERROR, "Failed to read backup key from a file."); + } + if (backup_key_file->content_length != BACKUP_KEY_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Backup key from file has an incorrect length."); } //try to import the backup - status = molch_json_import(json_backup->content, json_backup->content_length); - throw_on_error(IMPORT_ERROR, "Failed to import backup from JSON."); + status = molch_import(backup_file->content, backup_file->content_length, backup_key_file->content, backup_key); + throw_on_error(IMPORT_ERROR, "Failed to import backup from backup."); //destroy again molch_destroy_all_users(); //create a new user - size_t json_length; + size_t backup_length; size_t prekey_list_length; status = molch_create_user( user_id->content, @@ -57,28 +73,35 @@ int main(void) { &prekey_list_length, (unsigned char*)"random", sizeof("random"), - &json, - &json_length); + &backup, + &backup_length); throw_on_error(CREATION_ERROR, "Failed to create user."); - if (json == NULL) { - throw(EXPORT_ERROR, "Failed to export JSON."); + if (backup == NULL) { + throw(EXPORT_ERROR, "Failed to export backup."); } - //print the json to a file - buffer_create_with_existing_array(json_buffer, json, json_length); - print_to_file(json_buffer, "molch-init.json"); + //print the backup to a file + buffer_create_with_existing_array(backup_buffer, backup, backup_length); + buffer_create_with_existing_array(backup_key_buffer, backup_key, BACKUP_KEY_SIZE); + print_to_file(backup_buffer, "molch-init.backup"); + print_to_file(backup_key_buffer, "molch-init-backup.key"); cleanup: buffer_destroy_from_heap(user_id); - if (json != NULL) { - sodium_free(json); + if (backup != NULL) { + free(backup); } if (prekey_list != NULL) { free(prekey_list); } - if (json_backup != NULL) { - buffer_destroy_from_heap(json_backup); + if (backup_file != NULL) { + buffer_destroy_from_heap(backup_file); } + if (backup_key_file != NULL) { + buffer_destroy_from_heap(backup_key_file); + } + + free(backup_key); on_error( print_errors(&status); diff --git a/test/molch-test.c b/test/molch-test.c index 59aa5d6f..d6e4fb2d 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -38,6 +38,7 @@ int main(void) { //backup key buffer buffer_t *backup_key = buffer_create_on_heap(BACKUP_KEY_SIZE, BACKUP_KEY_SIZE); + buffer_t *new_backup_key = buffer_create_on_heap(BACKUP_KEY_SIZE, BACKUP_KEY_SIZE); //create conversation buffers buffer_t *alice_conversation = buffer_create_on_heap(CONVERSATION_ID_SIZE, CONVERSATION_ID_SIZE); @@ -63,15 +64,17 @@ int main(void) { unsigned char *printed_status = NULL; - // JSON for empty library - buffer_create_from_string(empty_array, "[]"); - size_t empty_json_length; - unsigned char *empty_json = NULL; - status = molch_json_export(&empty_json, &empty_json_length); - throw_on_error(EXPORT_ERROR, "Failed to export to JSON."); - printf("%.*s\n", (int)empty_json_length, (char*)empty_json); - if (buffer_compare_to_raw(empty_array, empty_json, empty_json_length) != 0) { - throw(INCORRECT_DATA, "Incorrect JSON output when there is no user."); + status = molch_update_backup_key(backup_key->content); + throw_on_error(KEYGENERATION_FAILED, "Failed to update backup key."); + + //backup for empty library + size_t empty_backup_length; + unsigned char *empty_backup= NULL; + status = molch_export(&empty_backup, &empty_backup_length); + throw_on_error(EXPORT_ERROR, "Failed to export empty library."); + free(empty_backup); + if (empty_backup_length != (sizeof("[]") + BACKUP_NONCE_SIZE + crypto_secretbox_MACBYTES)) { + throw(INCORRECT_DATA, "Incorrect output length when there is no user."); } //check user count @@ -82,26 +85,25 @@ int main(void) { //create a new user buffer_create_from_string(alice_head_on_keyboard, "mn ujkhuzn7b7bzh6ujg7j8hn"); - unsigned char *complete_json_export = NULL; - size_t complete_json_export_length = 0; + unsigned char *complete_export = NULL; + size_t complete_export_length = 0; status = molch_create_user( alice_public_identity->content, &alice_public_prekeys, &alice_public_prekeys_length, alice_head_on_keyboard->content, alice_head_on_keyboard->content_length, - &complete_json_export, - &complete_json_export_length); + &complete_export, + &complete_export_length); throw_on_error(status.status, "Failed to create Alice!"); printf("Alice public identity (%zu Bytes):\n", alice_public_identity->content_length); print_hex(alice_public_identity); putchar('\n'); - if (complete_json_export == NULL) { + if (complete_export == NULL) { throw(EXPORT_ERROR, "Failed to export the librarys state as JSON after creating alice."); } - printf("%.*s\n", (int)complete_json_export_length, (char*)complete_json_export); - sodium_free(complete_json_export); + free(complete_export); //check user count @@ -286,71 +288,103 @@ int main(void) { } free(alice_receive_message); - //test JSON export - printf("Test JSON export:\n"); - size_t json_length; - unsigned char *json = NULL; - status = molch_json_export(&json, &json_length); - throw_on_error(EXPORT_ERROR, "Failed to export to JSON."); - - printf("%.*s\n", (int)json_length, json); + //test export + printf("Test export!\n"); + size_t backup_length; + unsigned char *backup = NULL; + status = molch_export(&backup, &backup_length); + throw_on_error(EXPORT_ERROR, "Failed to export."); - //test JSON import - printf("Test JSON import:\n"); - status = molch_json_import(json, json_length); + //test import + printf("Test import!\n"); + status = molch_import(backup, backup_length, backup_key->content, new_backup_key->content); on_error( - sodium_free(json); - throw(IMPORT_ERROR, "Failed to import JSON."); + free(backup); + throw(IMPORT_ERROR, "Failed to import backup."); ) + //decrypt the first export (for comparison later on) + status_int = crypto_secretbox_open_easy( + backup, + backup, + backup_length - BACKUP_NONCE_SIZE, + backup + backup_length - BACKUP_NONCE_SIZE, + backup_key->content); + if (status_int != 0) { + throw(DECRYPT_ERROR, "Failed to decrypt the backup.") + } + backup_length -= BACKUP_NONCE_SIZE + crypto_secretbox_MACBYTES; + + //compare the keys + if (buffer_compare(backup_key, new_backup_key) == 0) { + throw(INCORRECT_DATA, "New backup key expected."); + } + + //copy the backup key + if (buffer_clone(backup_key, new_backup_key) != 0) { + throw(BUFFER_ERROR, "Failed to copy backup key."); + } + //now export again - size_t imported_json_length; - unsigned char *imported_json = NULL; - status = molch_json_export(&imported_json, &imported_json_length); + size_t imported_backup_length; + unsigned char *imported_backup = NULL; + status = molch_export(&imported_backup, &imported_backup_length); on_error( - sodium_free(json); - throw(EXPORT_ERROR, "Failed to export imported JSON."); + free(backup); + throw(EXPORT_ERROR, "Failed to export imported backup."); ) + //decrypt the secondt export (for comparison later on) + status_int = crypto_secretbox_open_easy( + imported_backup, + imported_backup, + imported_backup_length - BACKUP_NONCE_SIZE, + imported_backup + imported_backup_length - BACKUP_NONCE_SIZE, + backup_key->content); + if (status_int != 0) { + throw(DECRYPT_ERROR, "Failed to decrypt the backup.") + } + imported_backup_length -= BACKUP_NONCE_SIZE + crypto_secretbox_MACBYTES; + //compare - if ((json_length != imported_json_length) || (sodium_memcmp(json, imported_json, json_length) != 0)) { - sodium_free(json); - sodium_free(imported_json); - throw(IMPORT_ERROR, "Imported JSON is incorrect."); + if ((backup_length != imported_backup_length) || (sodium_memcmp(backup, imported_backup, backup_length) != 0)) { + free(backup); + free(imported_backup); + throw(IMPORT_ERROR, "Imported backup is incorrect."); } - sodium_free(json); - sodium_free(imported_json); + free(backup); + free(imported_backup); //test conversation JSON export - status = molch_conversation_json_export(&json, alice_conversation->content, &json_length); + status = molch_conversation_json_export(&backup, alice_conversation->content, &backup_length); throw_on_error(EXPORT_ERROR, "Failed to export Alice' conversation as JSON."); printf("Alice' conversation exported to JSON:\n"); - printf("%.*s\n", (int)json_length, (char*)json); + printf("%.*s\n", (int)backup_length, (char*)backup); //import again - status = molch_conversation_json_import(json, json_length); + status = molch_conversation_json_import(backup, backup_length); on_error( - sodium_free(json); + sodium_free(backup); throw(IMPORT_ERROR, "Failed to import Alice' conversation from JSON."); ) //export again - status = molch_conversation_json_export(&imported_json, alice_conversation->content, &imported_json_length); + status = molch_conversation_json_export(&imported_backup, alice_conversation->content, &imported_backup_length); on_error( - sodium_free(json); + sodium_free(backup); throw(EXPORT_ERROR, "Failed to export Alice imported conversation as JSON."); ) //compare - if ((json_length != imported_json_length) || (sodium_memcmp(json, imported_json, json_length) != 0)) { - sodium_free(json); - sodium_free(imported_json); + if ((backup_length != imported_backup_length) || (sodium_memcmp(backup, imported_backup, backup_length) != 0)) { + sodium_free(backup); + sodium_free(imported_backup); throw(IMPORT_ERROR, "JSON of imported conversation is incorrect."); } - sodium_free(imported_json); - sodium_free(json); + sodium_free(imported_backup); + sodium_free(backup); //destroy the conversations molch_end_conversation(alice_conversation->content, NULL, NULL); @@ -395,6 +429,7 @@ int main(void) { buffer_destroy_from_heap(alice_public_identity); buffer_destroy_from_heap(bob_public_identity); buffer_destroy_from_heap(backup_key); + buffer_destroy_from_heap(new_backup_key); if (status.status != SUCCESS) { print_errors(&status); diff --git a/test/test-data/CMakeLists.txt b/test/test-data/CMakeLists.txt index 63788c09..d42d2281 100644 --- a/test/test-data/CMakeLists.txt +++ b/test/test-data/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 2.6) -set(test-files molch-init.json) +set(test-files molch-init.backup molch-init-backup.key) # copy all test files to the test binary dir foreach(test-file ${test-files}) diff --git a/test/test-data/molch-init-backup.key b/test/test-data/molch-init-backup.key new file mode 100644 index 0000000000000000000000000000000000000000..1b3c736f9d2893234f63d5ca8d099be37df00397 GIT binary patch literal 32 ocmZ<_zQ5YW;f3Tk2N%7pw}neTWgZsZChFO@*W_ZJEyMYF0REB>VgLXD literal 0 HcmV?d00001 diff --git a/test/test-data/molch-init.backup b/test/test-data/molch-init.backup new file mode 100644 index 0000000000000000000000000000000000000000..026a940ff11cd8b43cae3ea508e03810774c0817 GIT binary patch literal 19209 zcmV(zK<2+lYiH6dCJMermwm%(GntoI840E^D0oKvpt|_~g_9=|OcwKL0?L5~3`q6= zGm{q3ue>{&>qpBkomg6B)(a|t8>(M}*z1tpd^xLOK&`2a10qc1eAv9F1EEKnn z%=TcxHoIWVrJaek_*xnSz1PL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L|}}vmw6_ z#=!&paa*Z%9P;L49{)bH`jp^NJfirHife8Dw?RCz&FTfAZH$-(a@#;HLvd)uw_Gdm zR37q{xTbCLBaxQQ!2G19c)NTIu{NWWNDwIhDkp zz_13l4}Qc!gO7^HsmUX`Vw?9Y;kL}ho}6{clx@SLRT17%&84|y=NFo~;qelyanXBH zZ;x@bzfeypJt>SFGR#ti{z=L82%~msHyWK^S7%CM(zdI6{G}PK8&+an%Wn(s69rCn zg6!y#bM)u-VQ<0}N3r6U?~}GsV}O4MX!6V!CYN|GM0ktwF0?&~b8*U+FLR-xhC07H z$9}Ub#=w>l=;;VUMvs%yD9jLLQv{hE#Z;)doi1J6N88OkzHw zt&$n`X#BBd5e+zPI;I)z2bqv$WZ(CU3-e4ef}RCr^O^O_;$6XK(b)^QgV+%t;{-x+ z$agB|K&G5}XXN5~t3+8&q%&T&9c@cg$uqOb!{9M@*t{Jd*10FEx75<&hk6J5moBdQozg5 z8&E=>oOjM2<0av!Z)T@UHKs*mH1+0;*?n^-*oLrw{?FDt-awO}j^RPxX^bke#3|2iej zKJu;!r)Jllhtd>2%|<%53ISuZ{k_0G)~hjeo*E33Q<^ZDXT#8#_IlhnAX5&P$^N1U zQgXd4ad+RGK_blzB6pMkdtAWGQ?^JE_+Kk(lByyiw~d-}TKaQw9NMfs|F|GXqa%h^ zTWjNmDm7Xo*=+a*u*n)qZTK1&rwG?+Kp}J6{TuCu-H!f`)j_-k@j!nQ%a1mAUA z^V93<^b$G7LOo0xSwm>!_plweEShExzE)U#Cr4za0^om!7`yuxR%aVKViq>vtgdsh;v)O~`9StpS;d%n kC71xIcMV=Vp_bYf1_D?T{{zqz(MM^Lq9-mEfBtJ#uhyPs0RR91 literal 0 HcmV?d00001 diff --git a/test/test-data/molch-init.json b/test/test-data/molch-init.json deleted file mode 100644 index a1a082d4..00000000 --- a/test/test-data/molch-init.json +++ /dev/null @@ -1 +0,0 @@ -[{"master_keys":{"public_signing_key":"92e0c3de25a1c6546297c669a25b40928cfed6e4f0b64c82b1b434c3c233ce5e","private_signing_key":"55a032857d65ae128bf24a36492a542e66664e2c7573d17f4db7f4452b587c9a92e0c3de25a1c6546297c669a25b40928cfed6e4f0b64c82b1b434c3c233ce5e","public_identity_key":"3d136d6eb71d9c0d3a84680be3158188e5d4ed4483fc3014d78b6fe5e4f62b78","private_identity_key":"e34551d7f2a4d1b207653fb13048087875887a89014f1d33e2c8602216f7b16f"},"prekeys":{"oldest_timestamp":1458678563,"oldest_deprecated_timestamp":0,"prekeys":[{"timestamp":1458678563,"public_key":"cf7fb07665aec9e4c498b6cfef50f40c6ee3c5939bb7a205b44ddb4288effa5e","private_key":"48ecdbd49701ea76615f812daea81452634ceacb8a81b6ec212d19536b4581be"},{"timestamp":1458678563,"public_key":"2622b33c587c55c7853bdc01ce71d24d234fd0dae2e7139cc46c888ecfcd4a42","private_key":"7e3c765dfba1e46c377fdc9ecde0fae7de9dc604f342b16da1d0e0403f151de5"},{"timestamp":1458678563,"public_key":"909b02c163f9631de1160c5bec508b2b6033911b5268509c54170ef96fa4d17e","private_key":"9e0f1d1910b56c2e1efb85fb9892add1af43b4faa6b29ddb5ab8e924355af2eb"},{"timestamp":1458678563,"public_key":"a9a38f8d2da4fc1f62bf7fee397332dd30a073278ac7c247b36415a7a70e2212","private_key":"09bf5cb20421792ea8f15b23ab3fa707e6329eb52d78f40c663f2bb0e7be8d77"},{"timestamp":1458678563,"public_key":"3d46c01c496aec4a18697e74524fbb7dc05a372e2e02f66115d2a01707c23b4b","private_key":"5b01d7d3d40bf202622fa43f24e540a4c39742fa61e23112883cc06e497db6b2"},{"timestamp":1458678563,"public_key":"b1febab5a9919fdcfd4d1f8bf9f1423370180cf19d938e6863d90c0171860d6d","private_key":"769ee9fabe95e022eda8ae72da35bce7bb3c652f2c03e3a40146bdd6d73b6891"},{"timestamp":1458678563,"public_key":"90e83ba4348ccc4a9e99f1f86a5265ec8825da9053d0187d8cbe5bd23c335f5b","private_key":"46462fdc778cdc7453ac48597aa39acc7ab8cfbc1a38b6bb1c257e4f25e3a15b"},{"timestamp":1458678563,"public_key":"5dfbf4403914912213f17ea57d97b7d7fb350f468d20686c5dfca2e3264d1317","private_key":"541336384c0a072301406f772f0e6d1e110d44a17640e27b3991ba12cb09bc8e"},{"timestamp":1458678563,"public_key":"d08ebae05f9c92f461e4f897a255e23f71328f7f1886d6fec8022d1267a0d726","private_key":"a9cb5b9ebd3624c8cbe9a8041c459d3bc6a1e0cc30b08b6098f73b41600a0f41"},{"timestamp":1458678563,"public_key":"41618986da169314533474c17eb2e78da2dcdb9fbdc567829939df4f013f3933","private_key":"fa0f9a3dd6af443b777c6428afd8959a708c92b60448929a3779e197c339859a"},{"timestamp":1458678563,"public_key":"e5fa73f97c32727b2091c1d49ea047429ed7e3da464dc49ac19b89c512a25c21","private_key":"6b15e84cca9287a569183483c156a332d40cefcdd453e62b559fdc3a74e1dbea"},{"timestamp":1458678563,"public_key":"8460ec82f02c97f73f0d133d853cb423b320b046a8ea76f4a2d2febbfe38fb04","private_key":"86e1747db66693640975b068ac13c27a5b943b31ff2185ea00e0b4830e2618dc"},{"timestamp":1458678563,"public_key":"6baa7a2455e4ca0a132c04c16ebe0ae0d2550a1e25702094f0a6d7fba8c0a414","private_key":"d0a0eed78ccd9db69e3901b99be09cec9128009a0ded76583292cce4a1d12200"},{"timestamp":1458678563,"public_key":"d9bef7d85f483fb080d794239be2025fed947803acd1cc595165dcf9def6796f","private_key":"f28481d3ded948453aed9ca1f10040c296b341cbe824bca2ee967e64664fc390"},{"timestamp":1458678563,"public_key":"5444f13a60b74846f161525941cb20eb1e820d30f383aac64d37788a890bc729","private_key":"2b33210efaf2d9cc980518d8eb8a7bd44fa5358adeac2faba18f9d72184230f1"},{"timestamp":1458678563,"public_key":"e0c56cf995b78490f92e527d743261cd9fd609bff6745f40feadc75fcb3a5a2f","private_key":"3fe77bf37aedab57b9f8872e167ace18b15acd6ca056144a29ae8d3dd695e3b6"},{"timestamp":1458678564,"public_key":"1bf53c2ce440036803ea835e3723425026c11b96c30daa34acf8373bcd64ac0f","private_key":"8b3bfa74dd6c998c22d252d883bcdff1c0943fce0c22f3e6eb3f838e45d6f169"},{"timestamp":1458678564,"public_key":"12c2921ee3f7b1c68be341ebde542a0135476066e827b8f89e17a15c5b89fb6a","private_key":"5321241204028689d7a2d10addbefe015fe83002c163fb8ed207407aa39097c6"},{"timestamp":1458678564,"public_key":"ad4ed49d467e7058124a9f509c22f01a9dd9aacf7d6ef80b67745cbf36a7f315","private_key":"c44dc3b317c8649c875d238f1c5c1826b26c057595a60c1aef64a91bbd8f8786"},{"timestamp":1458678564,"public_key":"926b9c8556a703e0bac457c9abd6a07a49642b58ef17e274e2dbfc6b12a0fb43","private_key":"383ff62b5b939bcfcd99fab1d98300af2f60c5595bee54f3778ad5bd4db0326f"},{"timestamp":1458678564,"public_key":"35be66122c31e580e61711f43bfbdd39783b8facd61d21b87c0caae12d471741","private_key":"79b96a109dd2c6efad033c42da5c59bf15d38c1cc0d565046fe6bc4e70f0154c"},{"timestamp":1458678564,"public_key":"43b0cb11327d32c9a5b649e28ed201ae3d11442ffaa2165072aa6ef47e86692b","private_key":"ade3835afab4dd814733b29973a5deac8a98697fb81ba3bb174addfb519eb274"},{"timestamp":1458678564,"public_key":"93168f9d897dd610f35b3810875581089f74f36a2d0f24d94b7c460e9cf1bc07","private_key":"502114de1473d511b01724dbdc58ea1f3a8e4d45ad48bba1aa22c7a02b460890"},{"timestamp":1458678564,"public_key":"f0f2b475be33d04d4c99b59e3b85c429c9a99c5e112abbd684600ef43a48075a","private_key":"1a5e594c1a3673bb2b0636b1ed8e04d5b31b46a1468e0459a3fbde2fbc1e4544"},{"timestamp":1458678564,"public_key":"36d714bd6c97d01606f3d85d6bb1b383a66bafcda84e37f59ba94988f2d80a13","private_key":"14be749e585116fcc7e48b6d214f083a0fce6895e09f3c5f6548e4004a7dd19f"},{"timestamp":1458678564,"public_key":"a1ccc22c99c9c0386cf9853a9566ca596d8f0ad42a6dc75d9b2b14c61e55712c","private_key":"f132bf9d1cba5e04a2e44cf4d3b00f904e147cc4164fbd5dbfa9637805f93ef9"},{"timestamp":1458678564,"public_key":"8e1449a14405202bee1822c994ef9a3a2835757023fc57af36175ae13eac3507","private_key":"e08e9b68e048a4e14ee8b4a2031f88c4f18a8c7ba6b198f6b3bdecec3a8df40c"},{"timestamp":1458678564,"public_key":"0feeb7643cc2466586fd9f6dbdf8dffb2952988d356d9c7dc0632457cf7b2619","private_key":"669dec5861f0c396c723c9f5d85fd4fed8d86ad5f5e1be386e4a6695e8e1f01f"},{"timestamp":1458678564,"public_key":"68da748b925b9e4aa55c2a97734a1346cc9c52c0a987404b19ce30e1150f9479","private_key":"af46217016904eb23b77eefea0d5a56b87084f51785612f65ae5b2aea2be96bf"},{"timestamp":1458678564,"public_key":"cc798d09f390d08f99247ffab17749c3ba7c20c2fa1cbec7077e3faf6596f919","private_key":"83aeee2ed6026668129eba9b480d5a32afb96594f57061a85e1ee1823089ce26"},{"timestamp":1458678564,"public_key":"a3ae5b8327a5a90b60f4dc2b76aead634bc178d34dd150a34b9a9a55aa91464a","private_key":"947bcdcbed95cb444708e49a75ce745785c7b32f178093d9bebd4ceee0f2e260"},{"timestamp":1458678564,"public_key":"f6bcbfb5f6907600a320f1de41d0fd9302e6945caba3ec6c394d24924b9d990c","private_key":"73dee9aab1d17c854a8b0f52f3b8830a3ad5c0f6346c5b5f562e379e08fc0534"},{"timestamp":1458678564,"public_key":"9ac2e43ac79af6219bbf5974dd615061dcdea7409a5f42a59f8dacf06826e834","private_key":"988fd29a925095c1496b9cadadff13e631f9e347c52f1717992d774f6174dc7d"},{"timestamp":1458678564,"public_key":"2c4c17e34870d9874c7415b790d8e5dd04db2a7f252b13bfc3e0732817033b50","private_key":"9356a76e1b752c2290b635ffa186823d1549088fc5377d6b38c05d464d3d1a83"},{"timestamp":1458678564,"public_key":"8fecae0daf3cea1b79120f37d6b8b5d154b6f73e0429fdf7df079363f5d8be43","private_key":"e2be0156ea8e54ec7c806e1d01e2c4628fa643312f9b1606e0511798c0b0c01a"},{"timestamp":1458678564,"public_key":"c4f7d571d72df3e05629b523a52f11672d4037aa092ee77a8109d20cc42d2418","private_key":"ada39b177c47ecd8ffe7d08e9e40fca84816cc4f99a10b768f56f06231536dd3"},{"timestamp":1458678564,"public_key":"8e7a6d06e8ec2fcd34d4542098b8b098470f8b540d1e991bec448b61bf4fbd0a","private_key":"949264083665dc91cfb5c377f0e2dc16cd0abe214b4f6eda6152f44305ba3df2"},{"timestamp":1458678564,"public_key":"fab66c98677ebbb2ad215818c3f11288ca9ed6e61e60efad38f658c2b5939436","private_key":"2a2725f156b87d48f2c981d8fdfda0ddd00fda96023b64433538268555758c5e"},{"timestamp":1458678564,"public_key":"6e905a708a76d0258c391a032d39fdcb75616f8bb6e85c7a0c3e738bb8e88757","private_key":"0664b3ed9836bd3b562888808c42801e5cad087d72f221f5644565a6342df577"},{"timestamp":1458678564,"public_key":"83619429b5f07a15cf82ed7baed8681e7a6488235ed872288d096f4c6dc7332c","private_key":"e3e9f046d233a81bbf8f80220095132e7c6d5ff7b872969e0b7f23e3b4278705"},{"timestamp":1458678564,"public_key":"0c5407ecc995534f40ded483590fca8760c51149cdcbe607672b28bd5293f11e","private_key":"775f2e4a9e17e49a40700e75e885cbe8b9ecb88b735a813c0d26fdc5028d4f92"},{"timestamp":1458678564,"public_key":"a34ae229493dbf7ec61fa5b8e723e645c958b27123c70d0170938e60ff812160","private_key":"b9d66f2a2fc00eec43528a0b848f31757390584b95feac1de12540f6ef49e33d"},{"timestamp":1458678564,"public_key":"8f0ca8c114de16f6ab945dd6b61b74498694a102aa44fd18f4c0071922bf7507","private_key":"062b172e3ee9178612bedaa4468d44f892c6a3aab8accee688fd7314358adaf1"},{"timestamp":1458678564,"public_key":"d049ec311265063bbdef227d3f3618e9e08f358f2733ceb9900f9795794c9d38","private_key":"82f2f134a71f4270bd306d8e1caef377fad43e5ced4d8b3c28137cf49b798a74"},{"timestamp":1458678564,"public_key":"053c33346b8d2dd9b1e268e56d260fbee16f088a3f04e588a43cf423d624d558","private_key":"e046fb6fceef402ce5ddaa7f666d720bea69cc9974fc5023804eb40546eb9675"},{"timestamp":1458678564,"public_key":"833425ebfd44036edce246d363be750e8c386439233e347e64f7f1f4cf88482c","private_key":"39e0a76e7b348892562de13f586f6e4a51d4fd5ff49154aead7a27ac5383ac15"},{"timestamp":1458678564,"public_key":"3e5cdfacf08a9db6d86699779d226abbde7ed0bc3e4d69bccec59e0c448e8246","private_key":"22f14b3c682231facce37e875623b913c0e37257d2bb8775979126cd0f858fb8"},{"timestamp":1458678564,"public_key":"3bb9c4b2503b47905326c36e88efcb99998d37857d530a1e8c3ae1255f305f1d","private_key":"4c59b7d9427148ea8a45be8aeec257e67f7e6dc3c894bcfa76410536dcb04f3b"},{"timestamp":1458678564,"public_key":"ec7d8e2a2003af0e945ea8a58098e9397260f53ea03ebba5cfaa7d6554f2dd46","private_key":"2a74ec844a4fdd2d09d6dfa1ba69bf1dccb429f856c0d335fa1107e46832a210"},{"timestamp":1458678564,"public_key":"b049ff6efd9d002b3b2b60778f65d869ec25e1e638dedcf5f860e57c71f2967e","private_key":"5fe519f53fea0943fe3a932b533181c17815d6a05cf1e74ee2ef207430bc329c"},{"timestamp":1458678564,"public_key":"a94190be731cdaf5dfd37ec43f264f83f348d992d9ed7bc4ddf91bc659fb1a76","private_key":"2179d5579d1f7cc6717fa426e82cc9b1cfa48545e5525f170166a4508797c7af"},{"timestamp":1458678564,"public_key":"45f7273083037e579e7e4b72da38983a6493004f7aa432ec3d65abe58bf9570f","private_key":"7336f4121c61d926ecd477c5ba752ee9ee1c9738c256e102a5a7810ff6c53f06"},{"timestamp":1458678564,"public_key":"54327dd4c2aeed901905e3c93f9eaa5e7b694d8a156aab15312ff419d8673952","private_key":"94627e0920e7eaf5d2d31f3602dfa60a2be3f889d6323ac22ecdbb62cb86a17a"},{"timestamp":1458678564,"public_key":"7efe4d7489bbfb5525304de58c6770fbce1b28507e35028e7eac5db0e23cbf46","private_key":"be901927d88e98eaebeef8670b78bbfbc109d4b7e1082df6699efb6665d0439e"},{"timestamp":1458678564,"public_key":"489f57368480b8ca6f8fa95196a2ec9551caee3a02ad0d2c50db7c1bd8b12509","private_key":"94c5cb87f4de06a30fe4cd4bce29981c0f8b23aed9b38ce208ed09c2e2ed82b1"},{"timestamp":1458678564,"public_key":"2360c4277efabffb21bead4d5908171f855e68a52bff4f90d4783c14214fb20b","private_key":"62748cc8b9d05f33b065179e533e2563b029e96c026a2398cbb490286d1b88ec"},{"timestamp":1458678564,"public_key":"6b8df0afe769163e6b49a1844ba3834a161be58d3c88f79e982e4dfbd6a2622d","private_key":"58d3427a3b15330f0567cca9cbb95d162e4a649fd4e42080013130aac376bf2f"},{"timestamp":1458678564,"public_key":"b778b50dfc6a01992625482b77d3d0e79447b15b3937fb78b706dfd3c80ded6d","private_key":"9eefa8d27ebea2db7a3b3bbb15abc7a3a385d186b47becea7ec9c4d37bfa455e"},{"timestamp":1458678564,"public_key":"cdb3bf8693117212c8a8c3702ca334b0e87f5c51d069691fae980d4a54f10c60","private_key":"5608339c61ba4fdca36c427c0c08d9050b595ec67645bb0595d12934463ed3aa"},{"timestamp":1458678564,"public_key":"ebeb02304b0ef31dd33ab68fa5d7e71bf06667de2c838ce9e9b30b00ab4fff1a","private_key":"4198e614e5f833a26456d636abee0bed5adc3c38d269ae9f0d33e7aa70509970"},{"timestamp":1458678564,"public_key":"efdafa8473613bb8f0c2657a809bc7ad3435fba9bc414946852b921247b4262e","private_key":"3fe5a441c7c34830be8fdf3e1d861a0a3de1414b75b35769a3cf9f5c39557e30"},{"timestamp":1458678564,"public_key":"0402e65c22623ffe23fd0dabf155cbb370f7760b70fad4b30cdefe2375f4231b","private_key":"ae29432cfbe10725cfeb50a6166aeeba4134441f1db9fadd4c0376547eceb764"},{"timestamp":1458678564,"public_key":"30c8d29c689284e6d3fec9c4c6911df20f70424dcc186440a3638a5ee9e3785d","private_key":"b65c0100919bb387ea972297a26ff35e7a7787dfdf74a1860d5a1948592115a9"},{"timestamp":1458678564,"public_key":"378dbd5c704eb69a0e515dd68bdba457ad85f3b1d14a194431ae231053f11f40","private_key":"d5f5d4f40c940bdf6f93b72202a5f2034ebe91b8ff2a25c6eb6ec492df5f08f1"},{"timestamp":1458678564,"public_key":"2ea11643d285b5e41b1e7d65822af913cdfedc64424ef30162074b34dc09b921","private_key":"81c864b78728c0a0ba1905b7806a9dd86474f2ccb6a05d354b133156d0880113"},{"timestamp":1458678564,"public_key":"e037d6f248562e7c2ef50e94a1ba4771299b50e93a22e1bbfc3d9ed90863ed2a","private_key":"fe6d9b54e6103221ca8204fa320bca0a16d880c093f46d7ff5a3bb557d611249"},{"timestamp":1458678564,"public_key":"a7808bb26909a2519413fd9f2c9d0bb1ab3a2ef9cc111fbc19432b7e38dacf36","private_key":"026f0f55f280a538a4458b8ae5b74256057a9437d1a5fe7b832a4ae846a04670"},{"timestamp":1458678564,"public_key":"6393e98c17c26e4408fea7c0347ef04768ad7a727339f1441fe21b3814ee2d3f","private_key":"a053986f844f0d6f39db07309a975e514b45688c8caa3cbfa7350308821f813d"},{"timestamp":1458678564,"public_key":"def8235ae7113b2e571d3c1d3913213041d4a2bf80f0b62d4cae2e9773904970","private_key":"7fc26e3c6598b4e57bf1454884cb00fb9fdda7b7ed2216c4d88ffb26f6d1cf66"},{"timestamp":1458678564,"public_key":"22fa328e9206fac9ddddb1e5c8285312bf818f893cf92d70419a232c2743bd05","private_key":"bb9e6e762696ec5743fd71e882f14ccc9aaca253aea07dc954e3c5ede01b8d72"},{"timestamp":1458678564,"public_key":"db7296255de2d6eb7302c59b6a7f79434708b3c8b9c3884e74c64c29ae81cb7d","private_key":"00fe9a8965c49316a889e8836d760524e4052b239960d179f559fa738d669a66"},{"timestamp":1458678564,"public_key":"35604c00fe4c58242762a2faf54b400558f7e279480bf3e66e353b5b03038240","private_key":"a003ab40d8eff937c000c14acb726f3c2a82672407c69a55b8893a1315dd3acb"},{"timestamp":1458678564,"public_key":"a79f14be8ca728c21dec78a2b359e20593a84dca613051b927e38db73618ab39","private_key":"9d228bd7567763d9ea6a958d214d1485e8465a338824453e870abcdb970af88a"},{"timestamp":1458678564,"public_key":"3b7f07507ce9bab88c3c8c59b51e168526549174d65827238b5a7c47606a6c3f","private_key":"51cb4d878894e62e9416c7463d2eec65a7c2bffe05329a49787e0c5dde54d406"},{"timestamp":1458678564,"public_key":"ceeeb1f4378d4b07a886eee0a72eef4cf228ea80eab0be7737df7384f201fe6a","private_key":"a593c171e82799951745fdeabb2a1baca0d196c01bdf66e31bf1653d4e91c039"},{"timestamp":1458678564,"public_key":"c47ce2012b4441d315694fb617d68f6a96ad9b31037ada70714d72b05594cc48","private_key":"75ea8f025edeaaa3420b601ba02d70533f8b21c51206c5b68e3a34dba38fdb10"},{"timestamp":1458678564,"public_key":"6ebb1d2e7d78417a8f9d46c11ceaa60860516be97fcb216c2244e66fb0e0f07b","private_key":"55b24d11928fd399af87fd41959cbb9994792f87183cf869b11c2a531ff07ecd"},{"timestamp":1458678564,"public_key":"c4bac906ecfe4137d025435b47671f91642088fcf24a5b17f4d0dd355375b102","private_key":"96b765691ee89e5da759d3694f1b900ae2e0c9998afba55be8b09163166337c8"},{"timestamp":1458678564,"public_key":"180f31389115fa5fc5f729efc6447099ceb1f4de2457def158e477e0bdee6070","private_key":"1ce3413b2de3f1686ce23343173ef40e816d988280abced37346da8e9f65e51b"},{"timestamp":1458678564,"public_key":"cb9f23ce7db7b89ab80f6c3ddbcd33e5cec8e244aea74478f2079f477347e21e","private_key":"180d1a72269d28ac4f752785947d5ce9366498b84a671dcae4ac5e93c7d0d391"},{"timestamp":1458678564,"public_key":"225d133f42ff0db9e58fe765dc1203e99a4fd09f7a1976b3e7a1e04663c9c24f","private_key":"fc2638eb40f4242a0ea6eac5915558e81d65d9bf8fac8cf7073a4fe337cf278f"},{"timestamp":1458678564,"public_key":"44a8a8f18b62f4cfa7c09d1f7974820d656fd81ae9252f231604c53cf5a3895c","private_key":"d9aae3921afe837d70c3b0ffe1659f6871abd2eb41ba9c3822eaf7eb54704dd4"},{"timestamp":1458678564,"public_key":"f1ec3d8f09c240f0b812fb500343e3656f43ee49ff128c7f9f918abea5249f0c","private_key":"19cdf493910f520274699b9e85af93e5dac53199e9f37e9a096b83eedbfb4f0b"},{"timestamp":1458678564,"public_key":"f7952765eb1b2588159ea5c944840f48ce4d9f54557d8a0ec377d5da959e4b77","private_key":"8643155878da91359309171c3c015844e8ca87be6425580b6a0ffdf35043ca75"},{"timestamp":1458678564,"public_key":"c0840cbd2cbf822c129b5fdeaf3c2461994d7e7f08b961239ad7c85dc7df2f63","private_key":"df2bf40de46083541b73fc3b5e5a258da20ba3ee8fcd7349a2f261fcea04b795"},{"timestamp":1458678564,"public_key":"ac2f9209c45072c1fd2fe3a365b524f78777d8f5c87694b6d2190c715f92b453","private_key":"53642dec35ba6cc86ecef7650b9f70bb087b35467c2ee1a2e5c088dceb2d9def"},{"timestamp":1458678564,"public_key":"ab594a4ed940768d99f3b756c870d798f782b7954d5a86d264135eb427a79728","private_key":"288bdae524f78d382f845c8075ba07428b3ff9d446b3e8b2dd4f3aa8b00595e1"},{"timestamp":1458678564,"public_key":"14ae00178ee45b924cbb42efa3cca487aee6ea223ee3b72fbad2de927a57d712","private_key":"fb5c55fb56563c6a98f30818c28b57090738d0657af49c8e4ad45b1b02d8b948"},{"timestamp":1458678564,"public_key":"beb94bf26472caaeb73879606a09faa69485648ae9e4b66f02d34cd3526e9236","private_key":"c25d539b5621c6347fc818883bfd52f11c7f520932736dddf836657d69161c07"},{"timestamp":1458678564,"public_key":"3cce4a57b44f1250b5e41d4501fa95cfc659d5f6a3031409bc35a0fc8107be13","private_key":"3f62afeab1616ac09157642181b9ebf365e59c0077c7374267422bbdd8da7b6d"},{"timestamp":1458678564,"public_key":"87b8951737113cd384463e1a8801065e22572aa71083450a33e1db3697f82907","private_key":"aacf332ffbd3cd6a6e3f754b37cc1f25a1aa83a93545fcf79d4105a0b96c9f55"},{"timestamp":1458678564,"public_key":"f5467ea3c620bcf1e12c6e0c8a7bcb6a2730922213dd0ffa714550a06bd1ac6e","private_key":"bfc4d157bef93c2bd3efb94c98dba0d4cd02e6b2da1301cb272fb67798db00d5"},{"timestamp":1458678564,"public_key":"a9ecb8630cdea1fc1f39cd4fb84b25849c91c3760212274190a969c7de223f3e","private_key":"690e9650b741065baf8cd7d5baa30218ae159daa4a1102f0c12f1225142e236c"},{"timestamp":1458678564,"public_key":"a45b5c247e6eff96b8a1d8124916c8004c877e90249e56da3c294a831acef21c","private_key":"2aea96785e5881c2d9d874a27cbe7f45b442cff9c7da31ab73456718b750b72c"},{"timestamp":1458678564,"public_key":"74b1321dfc7b543051fc9d733fd31ce9400e72e34c562f5551220009fc4d2e78","private_key":"365fea28dd1aa8c6deebac1afe9549100f67cab801dbeb28d5bc31ba3b2998f5"},{"timestamp":1458678564,"public_key":"ef592bb92d39ffe9bb6a24b16d208e3b7ea138c467e962993fb3e38fa7958036","private_key":"232d055294bc842443e5abd60bf60cd6a04a6ead3c73be6f8c08d24f9ca3e9e8"},{"timestamp":1458678564,"public_key":"02e6cfd88b2faac4a1fa6fe64461a13a16dcdecf4259815bcc957c7ddafa940e","private_key":"be9379215a65c960a14bb3f449f5f3c671a7ba1b3a8f107f34adf834515506f2"},{"timestamp":1458678564,"public_key":"fa20704b78f5994ca65333401b4dda19058188befbf2d20efaa2bdae6c13487a","private_key":"0e667e2f081e3ff36694bdb221dd161e79b4e60add8ddce8da99b74ab4989521"},{"timestamp":1458678564,"public_key":"bfcc6fd3f3eab612984c28d70159767ebafa47d96a5fe515b396d9195aac331c","private_key":"37742a6665f8b5ea929e363d2395619fa1004a9fd4cb679f3674ba31fbd100b2"},{"timestamp":1458678564,"public_key":"da9fdcc9eb5eac60518d7fa8156c6bcedc46a0a06984519ad5ffc8644bd2605a","private_key":"cf5997ff005f7f3dee7b280c680a8eac597eb09c1ab2e5ca51b5a38c4eac0eae"}],"deprecated_prekeys":[]},"conversations":[]}] \ No newline at end of file From cc885bef435e88f4f6e6908d029fb914489cb4f2 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Tue, 28 Jun 2016 17:02:26 +0200 Subject: [PATCH 06/53] molch: Update backup key in molch_create_user --- lib/molch.c | 13 ++++++++++--- lib/molch.h | 3 +++ test/molch-init-test.c | 1 + test/molch-test.c | 11 ++++++++++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/lib/molch.c b/lib/molch.c index 26975e46..99f6feef 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -117,12 +117,12 @@ return_status create_prekey_list( } /* - * Create a new user. The user is identified by the public key. + * Create a new user. The user is identified by the public master key. * * Get's random input (can be in any format and doesn't have * to be uniformly distributed) and uses it in combination * with the OS's random number generator to generate a - * identity keypair for the user. + * signing and identity keypair for the user. * * IMPORTANT: Don't put random numbers provided by the operating * system in there. @@ -130,7 +130,9 @@ return_status create_prekey_list( * This also creates a signed list of prekeys to be uploaded to * the server. * - * Don't forget to destroy the return status with return_status_destroy_errors() + * A new backup key is generated that subsequent backups of the library state will be encrypted with. + * + * Don't forget to destroy the return status with molch_destroy_return_status() * if an error has occurred. */ return_status molch_create_user( @@ -139,6 +141,7 @@ return_status molch_create_user( size_t *const prekey_list_length, const unsigned char *const random_data, const size_t random_data_length, + unsigned char * backup_key, //output, BACKUP_KEY_SIZE unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! size_t *const backup_length //optional, can be NULL ) { @@ -158,6 +161,10 @@ return_status molch_create_user( throw_on_error(CREATION_ERROR, "Failed to create user store.") } + //create a new backup key + status = molch_update_backup_key(backup_key); + throw_on_error(KEYGENERATION_FAILED, "Failed to update backup key."); + //create the user status = user_store_create_user( users, diff --git a/lib/molch.h b/lib/molch.h index 377fa99b..1baa655c 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -44,6 +44,8 @@ * This also creates a signed list of prekeys to be uploaded to * the server. * + * A new backup key is generated that subsequent backups of the library state will be encrypted with. + * * Don't forget to destroy the return status with molch_destroy_return_status() * if an error has occurred. */ @@ -53,6 +55,7 @@ return_status molch_create_user( size_t *const prekey_list_length, const unsigned char *const random_data, const size_t random_data_length, + unsigned char * backup_key, //output, BACKUP_KEY_SIZE unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! size_t *const backup_length //optional, can be NULL ) __attribute__((warn_unused_result)); diff --git a/test/molch-init-test.c b/test/molch-init-test.c index afa27a0c..16b462b8 100644 --- a/test/molch-init-test.c +++ b/test/molch-init-test.c @@ -73,6 +73,7 @@ int main(void) { &prekey_list_length, (unsigned char*)"random", sizeof("random"), + backup_key, &backup, &backup_length); throw_on_error(CREATION_ERROR, "Failed to create user."); diff --git a/test/molch-test.c b/test/molch-test.c index d6e4fb2d..2eae2571 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -82,7 +82,6 @@ int main(void) { throw(INVALID_VALUE, "Wrong user count."); } - //create a new user buffer_create_from_string(alice_head_on_keyboard, "mn ujkhuzn7b7bzh6ujg7j8hn"); unsigned char *complete_export = NULL; @@ -93,10 +92,19 @@ int main(void) { &alice_public_prekeys_length, alice_head_on_keyboard->content, alice_head_on_keyboard->content_length, + new_backup_key->content, &complete_export, &complete_export_length); throw_on_error(status.status, "Failed to create Alice!"); + if (buffer_compare(backup_key, new_backup_key) == 0) { + throw(INCORRECT_DATA, "New backup key is the same as the old one."); + } + + if (buffer_clone(backup_key, new_backup_key) != 0) { + throw(BUFFER_ERROR, "Failed to copy backup key."); + } + printf("Alice public identity (%zu Bytes):\n", alice_public_identity->content_length); print_hex(alice_public_identity); putchar('\n'); @@ -127,6 +135,7 @@ int main(void) { &bob_public_prekeys_length, bob_head_on_keyboard->content, bob_head_on_keyboard->content_length, + backup_key->content, NULL, NULL); throw_on_error(status.status, "Failed to create Bob!"); From 484117385bf57ab890d9b765913b9b5ec3f67775 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Tue, 28 Jun 2016 18:43:05 +0200 Subject: [PATCH 07/53] molch: new functions molch_conversation_{export,import} These functions encrypt the JSON. This commit also enables encryption when exporting conversations via molch_encrypt and molch_decrypt. --- lib/molch.c | 172 ++++++++++++++++++++++++++++++++++++++++++---- lib/molch.h | 27 +++++--- test/molch-test.c | 62 ++++++++++++----- 3 files changed, 219 insertions(+), 42 deletions(-) diff --git a/lib/molch.c b/lib/molch.c index 99f6feef..15934b52 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -43,6 +43,11 @@ return_status molch_json_import(const unsigned char* const json, const size_t le return_status molch_json_export( unsigned char ** const json, size_t *length) __attribute__((warn_unused_result)); +return_status molch_conversation_json_export( + unsigned char ** const json, + const unsigned char * const conversation_id, + size_t * const length) __attribute__((warn_unused_result)); +return_status molch_conversation_json_import(const unsigned char * const json, const size_t length) __attribute__((warn_unused_result)); /* * Create a prekey list. @@ -685,8 +690,8 @@ return_status molch_encrypt_message( const unsigned char * const message, const size_t message_length, const unsigned char * const conversation_id, - unsigned char ** const json_export_conversation, //optional, can be NULL, exports the conversation as json, free with sodium_free, check if NULL before use! - size_t * const json_export_conversation_length //optional, can be NULL + unsigned char ** const backup, //optional, can be NULL, exports the conversation, free after use, check if NULL before use! + size_t * const backup_length //optional, can be NULL ) { //create buffer for message array @@ -716,11 +721,11 @@ return_status molch_encrypt_message( *packet = packet_buffer->content; *packet_length = packet_buffer->content_length; - if (json_export_conversation != NULL) { - if (json_export_conversation_length == 0) { - *json_export_conversation = NULL; + if (backup != NULL) { + if (backup_length == 0) { + *backup = NULL; } else { - status = molch_conversation_json_export(json_export_conversation, conversation->id->content, json_export_conversation_length); + status = molch_conversation_export(backup, conversation->id->content, backup_length); throw_on_error(EXPORT_ERROR, "Failed to export conversation as JSON."); } } @@ -753,8 +758,8 @@ return_status molch_decrypt_message( const unsigned char * const conversation_id, uint32_t * const receive_message_number, //output uint32_t * const previous_receive_message_number, //output - unsigned char ** const json_export_conversation, //optional, can be NULL, exports the conversation as json, free with sodium_free, check if NULL before use! - size_t * const json_export_conversation_length //optional, can be NULL + unsigned char ** const backup, //optional, can be NULL, exports the conversation, free after use, check if NULL before use! + size_t * const backup_length //optional, can be NULL ) { //create buffer for the packet buffer_create_with_existing_array(packet_buffer, (unsigned char*)packet, packet_length); @@ -782,11 +787,11 @@ return_status molch_decrypt_message( *message = message_buffer->content; *message_length = message_buffer->content_length; - if (json_export_conversation != NULL) { - if (json_export_conversation_length == 0) { - *json_export_conversation = NULL; + if (backup != NULL) { + if (backup_length == 0) { + *backup = NULL; } else { - status = molch_conversation_json_export(json_export_conversation, conversation->id->content, json_export_conversation_length); + status = molch_conversation_export(backup, conversation->id->content, backup_length); throw_on_error(EXPORT_ERROR, "Failed to export conversation as JSON."); } } @@ -1016,6 +1021,90 @@ return_status molch_conversation_json_export( return status; } +/* + * Serialize a conversation. + * + * Don't forget to free the output after use. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occurred. + */ +return_status molch_conversation_export( + unsigned char ** const backup, + const unsigned char * const conversation_id, + size_t * const length) { + //FIXME: Less duplication + return_status status = return_status_init(); + + unsigned char *json = NULL; + size_t json_length = 0; + + //buffers + buffer_t *backup_buffer = NULL; + buffer_t *backup_nonce = buffer_create_on_heap(BACKUP_NONCE_SIZE, 0); + + if ((backup == NULL) || (length == NULL) || (conversation_id == NULL)) { + throw(INVALID_INPUT, "Invalid input to molch_conversation_export."); + } + + if ((backup_key == NULL) || (backup_key->content_length == 0)) { + throw(INCORRECT_DATA, "No backup key found."); + } + + status = molch_conversation_json_export(&json, conversation_id, &json_length); + throw_on_error(EXPORT_ERROR, "Failed to export conversation to JSON."); + + backup_buffer = buffer_create_on_heap(json_length + BACKUP_NONCE_SIZE + crypto_secretbox_MACBYTES, json_length + BACKUP_NONCE_SIZE + crypto_secretbox_MACBYTES); + if (backup_buffer == NULL) { + throw(ALLOCATION_FAILED, "Failed to create backup buffer."); + } + + //generate the nonce + if (buffer_fill_random(backup_nonce, BACKUP_NONCE_SIZE) != 0) { + throw(GENERIC_ERROR, "Failed to generate backup nonce."); + } + + //encrypt the JSON + int status_int = crypto_secretbox_easy( + backup_buffer->content, + json, + json_length, + backup_nonce->content, + backup_key->content); + if (status_int != 0) { + throw(ENCRYPT_ERROR, "Failed to encrypt library state."); + } + + //copy the nonce at the end of the output + status_int = buffer_copy_to_raw( + backup_buffer->content, + json_length + crypto_secretbox_MACBYTES, + backup_nonce, + 0, + BACKUP_NONCE_SIZE); + if (status_int != 0) { + throw(BUFFER_ERROR, "Failed to copy nonce to backup."); + } + + *backup = backup_buffer->content; + *length = backup_buffer->content_length; + + free(backup_buffer); + +cleanup: + on_error( + if (backup_buffer != NULL) { + buffer_destroy_from_heap(backup_buffer); + } + ); + + buffer_destroy_from_heap(backup_nonce); + if (json != NULL) { + sodium_free(json); + } + + return status; +} /* * Import a conversation from JSON (overwrites the current one if it exists). * @@ -1107,10 +1196,65 @@ return_status molch_conversation_json_import(const unsigned char * const json, c return status; } +/* + * Import a conversation from a backup (overwrites the current one if it exists). + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occurred. + */ +return_status molch_conversation_import( + const unsigned char * const backup, + const size_t backup_length, + const unsigned char * local_backup_key, //BACKUP_KEY_SIZE + unsigned char * new_backup_key) { //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key + return_status status = return_status_init(); + + buffer_t *json = buffer_create_with_custom_allocator(backup_length, 0, sodium_malloc, sodium_free); + + //check input + if ((backup == NULL) || (local_backup_key == NULL)) { + throw(INVALID_INPUT, "Invalid input to molch_import."); + } + + + //check the lengths + if (backup_length < BACKUP_NONCE_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Backup is too short."); + } + + size_t json_length = backup_length - BACKUP_NONCE_SIZE - crypto_secretbox_MACBYTES; + + //decrypt the backup + int status_int = crypto_secretbox_open_easy( + json->content, + backup, + backup_length - BACKUP_NONCE_SIZE, + backup + backup_length - BACKUP_NONCE_SIZE, + local_backup_key); + if (status_int != 0) { + throw(DECRYPT_ERROR, "Failed to decrypt backup."); + } + + json->content_length = json_length; + + status = molch_update_backup_key(new_backup_key); + throw_on_error(KEYGENERATION_FAILED, "Faild to generate a new backup key."); + + status = molch_conversation_json_import( + json->content, + json->content_length); + throw_on_error(IMPORT_ERROR, "Failed to import conversation from decrypted JSON."); + +cleanup: + buffer_destroy_with_custom_deallocator(json, sodium_free); + + return status; +} + /* * Serialise molch's state into JSON. * - * Use sodium_free to free json after use. + * Don't forget to free after use. * * Don't forget to destroy the return status with return_status_destroy_errors() * if an error has occurred. @@ -1339,7 +1483,7 @@ return_status molch_import( unsigned char * const backup, const size_t backup_length, const unsigned char * const local_backup_key, //BACKUP_KEY_SIZE - unsigned char * const new_backup_key //BACKUP_KEY_SIZE, can be the same pointer as the backup key + unsigned char * const new_backup_key //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key ) { return_status status = return_status_init(); diff --git a/lib/molch.h b/lib/molch.h index 1baa655c..ffae267f 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -167,8 +167,8 @@ return_status molch_encrypt_message( const unsigned char * const message, const size_t message_length, const unsigned char * const conversation_id, - unsigned char ** const json_export_conversation, //optional, can be NULL, exports the conversation as json, free with sodium_free, check if NULL before use! - size_t * const json_export_conversation_length + unsigned char ** const backup, //optional, can be NULL, exports the conversationn, free after use, check if NULL before use! + size_t * const backup_length ) __attribute__((warn_unused_result)); /* @@ -185,8 +185,8 @@ return_status molch_decrypt_message( const unsigned char * const conversation_id, uint32_t * const receive_message_number, //output uint32_t * const previous_receive_message_number, //output - unsigned char ** const json_export_conversation, //optional, can be NULL, exports the conversation as json, free with sodium_free, check if NULL before use! - size_t * const json_export_conversation_length + unsigned char ** const backup, //optional, can be NULL, exports the conversation, free after use, check if NULL before use! + size_t * const backup_length ) __attribute__((warn_unused_result)); /* @@ -236,15 +236,15 @@ const char *molch_print_status_type(status_type type); void molch_destroy_return_status(return_status * const status); /* - * Serialize a conversation into JSON. + * Serialize a conversation. * - * Use sodium_free to free json after use. + * Don't forget to free the output after use. * * Don't forget to destroy the return status with molch_destroy_return_status() * if an error has occurred. */ -return_status molch_conversation_json_export( - unsigned char ** const json, +return_status molch_conversation_export( + unsigned char ** const backup, const unsigned char * const conversation_id, size_t * const length) __attribute__((warn_unused_result)); @@ -261,12 +261,17 @@ return_status molch_export( size_t *length) __attribute__((warn_unused_result)); /* - * Import a conversation from JSON (overwrites the current one if it exists). + * Import a conversation from a backup (overwrites the current one if it exists). * * Don't forget to destroy the return status with molch_destroy_return_status() * if an error has occurred. */ -return_status molch_conversation_json_import(const unsigned char * const json, const size_t length) __attribute__((warn_unused_result)); +return_status molch_conversation_import( + const unsigned char * const backup, + const size_t backup_length, + const unsigned char * backup_key, //BACKUP_KEY_SIZE + unsigned char * new_backup_key //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key + ) __attribute__((warn_unused_result)); /* * Import molch's internal state from a backup (overwrites the current state) @@ -281,7 +286,7 @@ return_status molch_import( unsigned char * const backup, const size_t backup_length, const unsigned char * const backup_key, //BACKUP_KEY_SIZE - unsigned char * const new_backup_key //BACKUP_KEY_SIZE, can be the same pointer as the backup key + unsigned char * const new_backup_key //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key ) __attribute__((warn_unused_result)); /* diff --git a/test/molch-test.c b/test/molch-test.c index 2eae2571..b15bad82 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -256,8 +256,7 @@ int main(void) { if (conversation_json_export == NULL) { throw(EXPORT_ERROR, "Failed to export the conversation after encrypting a message."); } - printf("%.*s\n", (int)conversation_json_export_length, (char*)conversation_json_export); - sodium_free(conversation_json_export); + free(conversation_json_export); //check the message type if (molch_get_message_type(bob_send_packet, bob_send_packet_length) != NORMAL_MESSAGE) { @@ -364,36 +363,65 @@ int main(void) { free(backup); free(imported_backup); - //test conversation JSON export - status = molch_conversation_json_export(&backup, alice_conversation->content, &backup_length); - throw_on_error(EXPORT_ERROR, "Failed to export Alice' conversation as JSON."); + //test conversation export + status = molch_conversation_export(&backup, alice_conversation->content, &backup_length); + throw_on_error(EXPORT_ERROR, "Failed to export Alice' conversation."); - printf("Alice' conversation exported to JSON:\n"); - printf("%.*s\n", (int)backup_length, (char*)backup); + printf("Alice' conversation exported!"); //import again - status = molch_conversation_json_import(backup, backup_length); + status = molch_conversation_import(backup, backup_length, backup_key->content, new_backup_key->content); on_error( - sodium_free(backup); - throw(IMPORT_ERROR, "Failed to import Alice' conversation from JSON."); + free(backup); + throw(IMPORT_ERROR, "Failed to import Alice' conversation from backup."); ) + //decrypt the backup + status_int = crypto_secretbox_open_easy( + backup, + backup, + backup_length - BACKUP_NONCE_SIZE, + backup + backup_length - BACKUP_NONCE_SIZE, + backup_key->content); + if (status_int != 0) { + throw(DECRYPT_ERROR, "Failed to decrypt the backup.") + } + backup_length -= BACKUP_NONCE_SIZE + crypto_secretbox_MACBYTES; + + //copy the backup key + if (buffer_clone(backup_key, new_backup_key) != 0) { + throw(BUFFER_ERROR, "Failed to copy backup key."); + } + + //export again - status = molch_conversation_json_export(&imported_backup, alice_conversation->content, &imported_backup_length); + status = molch_conversation_export(&imported_backup, alice_conversation->content, &imported_backup_length); on_error( - sodium_free(backup); - throw(EXPORT_ERROR, "Failed to export Alice imported conversation as JSON."); + free(backup); + throw(EXPORT_ERROR, "Failed to export Alice imported conversation."); ) + //decrypt the first export (for comparison later on) + status_int = crypto_secretbox_open_easy( + imported_backup, + imported_backup, + imported_backup_length - BACKUP_NONCE_SIZE, + imported_backup + imported_backup_length - BACKUP_NONCE_SIZE, + backup_key->content); + if (status_int != 0) { + throw(DECRYPT_ERROR, "Failed to decrypt the backup.") + } + imported_backup_length -= BACKUP_NONCE_SIZE + crypto_secretbox_MACBYTES; + //compare if ((backup_length != imported_backup_length) || (sodium_memcmp(backup, imported_backup, backup_length) != 0)) { - sodium_free(backup); - sodium_free(imported_backup); + free(backup); + free(imported_backup); throw(IMPORT_ERROR, "JSON of imported conversation is incorrect."); } - sodium_free(imported_backup); - sodium_free(backup); + free(imported_backup); + free(backup); //destroy the conversations molch_end_conversation(alice_conversation->content, NULL, NULL); From 84b7e563b41163e1ce998c8d3f42825fa528fcfb Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Thu, 30 Jun 2016 10:52:14 +0200 Subject: [PATCH 08/53] Lua-Binding: new class "backup" for storing backups --- bindings/molch.lua | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/bindings/molch.lua b/bindings/molch.lua index eaa8f03d..ab01ab5b 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -84,6 +84,54 @@ molch.user.__index = molch.user molch.conversation = {} molch.conversation.__index = molch.conversation +molch.backup = {} +molch.backup.__index = molch.backup + +function molch.backup.new(content, length, key) + local backup = { + content = "", + key = "" + } + + setmetatable(backup, molch.backup) + + if content and (key or users.attributes.last_backup_key) then + backup:set(content, length, key) + end + + + return backup +end + +function molch.backup:set(content, length, key) + key = key or molch.users.attributes.last_backup_key + + if type(content) == "string" then + self.content = content + else + self.content = convert_to_lua_string(content, length) + end + + if type(key) == "string" then + self.key = key + else + self.key = convert_to_lua_string(key, 32) + end +end + +function molch.backup:to_c() + local raw_content, content_length = convert_to_c_string(self.content) + local raw_key, key_length = convert_to_c_string(self.key) + + return raw_content, content_length, raw_key, key_length +end + +function molch.backup:copy() + local copy = molch.backup.new() + copy:set(self.content, nil, self.key) + + return copy +end function molch.user.new(random_spice --[[optional]]) local user = {} From 0d71dfb020f0224cb2aced0d21b3769dd823ab3e Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Thu, 30 Jun 2016 11:55:14 +0200 Subject: [PATCH 09/53] Lua-Binding: Fix molch.export by making it a class method --- bindings/molch.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/molch.lua b/bindings/molch.lua index ab01ab5b..3f54718e 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -227,7 +227,7 @@ function molch.user_list() end molch.user.list = molch.user_list -function molch.json_export() +function molch:json_export() local json_length = molch_interface.size_t() local json From 5198a121ce5683dcb6afa285a6680694b01ba404 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Wed, 29 Jun 2016 21:41:18 +0200 Subject: [PATCH 10/53] Lua-Bindings: Implement changes to molch (encrypted backup) --- bindings/CMakeLists.txt | 2 +- bindings/molch.i | 51 +++--- bindings/molch.lua | 163 ++++++++++--------- bindings/scenarios/CMakeLists.txt | 2 +- bindings/scenarios/double-import | 5 + bindings/scenarios/json-double-import | 5 - bindings/scenarios/{json-restart => restart} | 0 bindings/scenarios/scenarios.lua | 22 +-- 8 files changed, 135 insertions(+), 115 deletions(-) create mode 100644 bindings/scenarios/double-import delete mode 100644 bindings/scenarios/json-double-import rename bindings/scenarios/{json-restart => restart} (100%) diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt index bc4a2aca..cc7a7d09 100644 --- a/bindings/CMakeLists.txt +++ b/bindings/CMakeLists.txt @@ -1,6 +1,6 @@ option(GENERATE_LUA_BINDINGS "Enable the Lua binding for testing purposes" ON) -if(GENERATE_LUA_BINDINGS AND (NOT APPLE) AND FALSE) +if(GENERATE_LUA_BINDINGS AND (NOT APPLE)) find_package(SWIG) if(SWIG_FOUND) include(${SWIG_USE_FILE}) diff --git a/bindings/molch.i b/bindings/molch.i index 27acdc76..a5f7ceb1 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -79,14 +79,15 @@ extern return_status molch_create_user( size_t *const prekey_list_length, const unsigned char *const random_data, const size_t random_data_length, - unsigned char **const json_export, - size_t *const json_export_length + unsigned char * backup_key, + unsigned char **const backup, + size_t *const backup_length ); extern return_status molch_destroy_user( const unsigned char *const public_signing_key, - unsigned char **const json_export, - size_t *const json_export_length + unsigned char **const backup, + size_t *const backup_length ); extern size_t molch_user_count(); @@ -111,8 +112,8 @@ extern return_status molch_create_send_conversation( const size_t prekey_list_length, const unsigned char * const sender_public_signing_key, const unsigned char * const receiver_public_signing_key, - unsigned char ** const json_export, - size_t * const json_export_length + unsigned char ** const backup, + size_t * const backup_length ); extern return_status molch_create_receive_conversation( @@ -125,8 +126,8 @@ extern return_status molch_create_receive_conversation( size_t * const prekey_list_length, const unsigned char * const sender_public_signing_key, const unsigned char * const receiver_public_signing_key, - unsigned char ** const json_export, - size_t * const json_export_length + unsigned char ** const backup, + size_t * const backup_length ); extern return_status molch_encrypt_message( @@ -135,8 +136,8 @@ extern return_status molch_encrypt_message( const unsigned char * const message, const size_t message_length, const unsigned char * const conversation_id, - unsigned char ** const json_export_conversation, - size_t * const json_export_conversation_length + unsigned char ** const backup, + size_t * const backup_length ); extern return_status molch_decrypt_message( @@ -147,14 +148,14 @@ extern return_status molch_decrypt_message( const unsigned char * const conversation_id, uint32_t * const receive_message_number, uint32_t * const previous_receive_message_number, - unsigned char ** const json_export_conversation, - size_t * const json_export_conversation_length + unsigned char ** const backup, + size_t * const backup_length ); extern void molch_end_conversation( const unsigned char * const conversation_id, - unsigned char ** const json_export, - size_t * const json_export_length + unsigned char ** const backup, + size_t * const backup_length ); extern return_status molch_list_conversations( @@ -168,20 +169,28 @@ extern const char *molch_print_status_type(status_type type); extern void molch_destroy_return_status(return_status * const status); -extern return_status molch_conversation_json_export( - unsigned char ** const json, +extern return_status molch_conversation_export( + unsigned char ** const backup, const unsigned char * const conversation_id, size_t * const length); -extern return_status molch_json_export( - unsigned char ** const json, - size_t *length); +extern return_status molch_export(unsigned char ** const backup, size_t *length); -extern return_status molch_conversation_json_import(const unsigned char * const json, const size_t length); +extern return_status molch_conversation_import( + const unsigned char * const backup, + const size_t backup_length, + const unsigned char * backup_key, + unsigned char * new_backup_key); -extern return_status molch_json_import(const unsigned char* const json, const size_t length); +return_status molch_import( + unsigned char * const backup, + const size_t backup_length, + const unsigned char * const backup_key, + unsigned char * const new_backup_key); extern return_status molch_get_prekey_list( unsigned char * const public_signing_key, unsigned char ** const prekey_list, size_t * const prekey_list_length); + +extern return_status molch_update_backup_key(unsigned char * const new_key); diff --git a/bindings/molch.lua b/bindings/molch.lua index 3f54718e..ccead331 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -73,7 +73,8 @@ end -- table containing references to all users local users = { attributes = { - json = "" + backup = {}, + last_backup_key = "" } } molch.users = users @@ -138,15 +139,16 @@ function molch.user.new(random_spice --[[optional]]) setmetatable(user, molch.user) local raw_id = molch_interface.ucstring_array(32) + local raw_backup_key = molch_interface.ucstring_array(32) local prekey_list_length = molch_interface.size_t() - local json_length = molch_interface.size_t() + local backup_length = molch_interface.size_t() local spice_userdata, spice_userdata_length = random_spice and convert_to_c_string(random_spice) or nil, 0 -- this will be allocated by molch! local temp_prekey_list = molch_interface.create_ucstring_pointer() - local temp_json = molch_interface.create_ucstring_pointer() + local temp_backup = molch_interface.create_ucstring_pointer() local status = molch_interface.molch_create_user( raw_id, @@ -154,27 +156,32 @@ function molch.user.new(random_spice --[[optional]]) prekey_list_length, spice_userdata, spice_userdata_length, - temp_json, - json_length + raw_backup_key, + temp_backup, + backup_length ) local status_type = molch_interface.get_status(status) if status_type ~= molch_interface.SUCCESS then molch_interface.molch_destroy_return_status(status) molch_interface.free(temp_prekey_list) - molch_interface.free(temp_json) + molch_interface.free(temp_backup) error(molch.print_errors(status)) end -- copy the prekey list over to an array managed by swig and free the old local raw_prekey_list = copy_callee_allocated_string(temp_prekey_list, prekey_list_length) - -- copy the json over to an array managed by swig and free the old - local raw_json = copy_callee_allocated_string(temp_json, json_length, molch_interface.sodium_free) + -- copy the backup over to an array managed by swig and free the old + local raw_backup = copy_callee_allocated_string(temp_backup, backup_length) -- create lua strings from the data user.id = convert_to_lua_string(raw_id, 32) user.prekey_list = convert_to_lua_string(raw_prekey_list, prekey_list_length) - user.json = convert_to_lua_string(raw_json, json_length) - users.attributes.json = user.json + + -- create backup object + user.backup = molch.backup.new(raw_backup, backup_length, raw_backup_key) + users.attributes.backup = user.backup:copy() + + users.attributes.last_backup_key = user.backup.key -- add to global list of users users[user.id] = user @@ -227,33 +234,27 @@ function molch.user_list() end molch.user.list = molch.user_list -function molch:json_export() - local json_length = molch_interface.size_t() +function molch:export() + local backup_length = molch_interface.size_t() - local json - if molch.user_count() == 0 then -- work around ugly bug that makes it crash under some circumstances when using sodium_malloc - users.attributes.json = "[]\0" - json = convert_to_c_string(users.attributes.json) - else - local temp_json = molch_interface.create_ucstring_pointer() - local status = molch_interface.molch_json_export(temp_json, json_length) - local status_type = molch_interface.get_status(status) - if status_type ~= molch_interface.SUCCESS then - error(molch.print_errors(status)) - end - - json = copy_callee_allocated_string(temp_json, json_length, molch_interface.sodium_free) - users.attributes.json = convert_to_lua_string(json, json_length) + local backup + local raw_backup = molch_interface.create_ucstring_pointer() + local status = molch_interface.molch_export(raw_backup, backup_length) + local status_type = molch_interface.get_status(status) + if status_type ~= molch_interface.SUCCESS then + error(molch.print_errors(status)) end + raw_backup = copy_callee_allocated_string(raw_backup, backup_length) + users.attributes.backup = molch.backup.new(raw_backup, backup_length) if self then -- called on an object - self.json = users.attributes.json + self.backup = users.attributes.backup:copy() end - return users.attributes.json + return users.attributes.backup:copy() end -molch.user.json_export = molch.json_export +molch.user.backup_export = molch.backup_export function molch.destroy_all_users() for user_id,user in pairs(users) do @@ -267,7 +268,7 @@ function molch.destroy_all_users() recursively_delete_table(users) users.attributes = { - json = "" + backup = "" } end @@ -308,15 +309,23 @@ function molch.user:list_conversations() return list end -function molch.json_import(json) - local json_string, json_length = convert_to_c_string(json) +function molch.import(backup) + local backup_string, backup_length, raw_backup_key = backup:to_c() + local new_backup_key = molch_interface.ucstring_array(32) - local status = molch_interface.molch_json_import(json_string, json_length) + local status = molch_interface.molch_import( + backup_string, + backup_length, + raw_backup_key, + new_backup_key) local status_type = molch_interface.get_status(status) if status_type ~= molch_interface.SUCCESS then error(molch.print_errors(status)) end + users.attributes.backup = backup + users.attributes.last_backup_key = convert_to_lua_string(new_backup_key, 32) + -- backup of all running conversations local conversation_backup = {} for user_id, user in pairs(users) do @@ -345,8 +354,7 @@ function molch.json_import(json) local user = users[user_id] user.id = user_id - user.json = json - users.attributes.json = json + user.backup = backup -- add the conversations user.conversations = user:list_conversations() @@ -371,7 +379,6 @@ function molch.json_import(json) -- destroy conversations that don't exist anymore for _, conversation in pairs(conversation_backup) do - print(type(conversation)) recursively_delete_table(conversation) end end @@ -383,8 +390,8 @@ function molch.user:create_send_conversation(message, prekey_list, receiver_id) local raw_conversation_id = molch_interface.ucstring_array(molch_interface.CONVERSATION_ID_SIZE) local raw_packet = molch_interface.create_ucstring_pointer() local raw_packet_length = molch_interface.size_t() - local raw_json = molch_interface.create_ucstring_pointer() - local raw_json_length = molch_interface.size_t() + local raw_backup = molch_interface.create_ucstring_pointer() + local raw_backup_length = molch_interface.size_t() local raw_message, raw_message_length = convert_to_c_string(message) local raw_prekey_list, raw_prekey_list_length = convert_to_c_string(prekey_list) @@ -399,23 +406,26 @@ function molch.user:create_send_conversation(message, prekey_list, receiver_id) raw_prekey_list_length, convert_to_c_string(self.id), convert_to_c_string(receiver_id), - raw_json, - raw_json_length) + raw_backup, + raw_backup_length) local status_type = molch_interface.get_status(status) if status_type ~= molch_interface.SUCCESS then molch_interface.free(raw_packet) - molch_interface.free(raw_json) + molch_interface.free(raw_backup) error(molch.print_errors(status)) end local conversation_id = convert_to_lua_string(raw_conversation_id, molch_interface.CONVERSATION_ID_SIZE) raw_packet = copy_callee_allocated_string(raw_packet, raw_packet_length) - raw_json = copy_callee_allocated_string(raw_json, raw_json_length, molch_interface.sodium_free) + raw_backup = copy_callee_allocated_string(raw_backup, raw_backup_length) + + self.backup = molch.backup.new(raw_backup, raw_backup_length) + users.attributes.backup = self.backup:copy() local packet = convert_to_lua_string(raw_packet, raw_packet_length) - local json = convert_to_lua_string(raw_json, raw_json_length) + local backup = convert_to_lua_string(raw_backup, raw_backup_length) - conversation.json = json + conversation.backup = molch.backup.new() conversation.id = conversation_id -- add to the users list of conversations @@ -433,8 +443,8 @@ function molch.user:create_receive_conversation(packet, sender_id) local raw_message_length = molch_interface.size_t() local raw_prekey_list = molch_interface.create_ucstring_pointer() local raw_prekey_list_length = molch_interface.size_t() - local raw_json = molch_interface.create_ucstring_pointer() - local raw_json_length = molch_interface.size_t() + local raw_backup = molch_interface.create_ucstring_pointer() + local raw_backup_length = molch_interface.size_t() local raw_packet, raw_packet_length = convert_to_c_string(packet) @@ -448,27 +458,29 @@ function molch.user:create_receive_conversation(packet, sender_id) raw_prekey_list_length, convert_to_c_string(sender_id), convert_to_c_string(self.id), - raw_json, - raw_json_length) + raw_backup, + raw_backup_length) local status_type = molch_interface.get_status(status) if status_type ~= molch_interface.SUCCESS then molch_interface.free(raw_message) molch_interface.free(raw_prekey_list) - molch_interface.free(raw_json) + molch_interface.free(raw_backup) error(molch.print_errors(status)) end local conversation_id = convert_to_lua_string(raw_conversation_id, molch_interface.CONVERSATION_ID_SIZE) raw_message = copy_callee_allocated_string(raw_message, raw_message_length) raw_prekey_list = copy_callee_allocated_string(raw_prekey_list, raw_prekey_list_length) - raw_json = copy_callee_allocated_string(raw_json, raw_json_length, molch_interface.sodium_free) + raw_backup = copy_callee_allocated_string(raw_backup, raw_backup_length) + + self.backup = molch.backup.new(raw_backup, raw_backup_length) + users.attributes.backup = self.backup:copy() local message = convert_to_lua_string(raw_message, raw_message_length) local prekey_list = convert_to_lua_string(raw_prekey_list, raw_prekey_list_length) - local json = convert_to_lua_string(raw_json, raw_json_length) - conversation.json = json - conversation. id = conversation_id + conversation.backup = molch.backup.new() + conversation.id = conversation_id self.prekey_list = prekey_list -- add to the users list of conversations @@ -503,8 +515,8 @@ function molch.conversation:encrypt_message(message) local raw_message, raw_message_length = convert_to_c_string(message) local raw_packet = molch_interface.create_ucstring_pointer() local raw_packet_length = molch_interface.size_t() - local raw_json = molch_interface.create_ucstring_pointer() - local raw_json_length = molch_interface.size_t() + local raw_backup = molch_interface.create_ucstring_pointer() + local raw_backup_length = molch_interface.size_t() local status = molch_interface.molch_encrypt_message( raw_packet, @@ -512,20 +524,20 @@ function molch.conversation:encrypt_message(message) raw_message, raw_message_length, convert_to_c_string(self.id), - raw_json, - raw_json_length) + raw_backup, + raw_backup_length) local status_type = molch_interface.get_status(status) if status_type ~= molch_interface.SUCCESS then molch_interface.free(raw_packet) - molch_interface.free(raw_json) + molch_interface.free(raw_backup) error(molch.print_errors(status)) end raw_packet = copy_callee_allocated_string(raw_packet, raw_packet_length) - raw_json = copy_callee_allocated_string(raw_json, raw_json_length, molch_interface.sodium_free) + raw_backup = copy_callee_allocated_string(raw_backup, raw_backup_length) local packet = convert_to_lua_string(raw_packet, raw_packet_length) - self.json = convert_to_lua_string(raw_json, raw_json_length) + self.backup = molch.backup.new(raw_backup, raw_packet_length) return packet end @@ -534,8 +546,8 @@ function molch.conversation:decrypt_message(packet) local raw_packet, raw_packet_length = convert_to_c_string(packet) local raw_message = molch_interface.create_ucstring_pointer() local raw_message_length = molch_interface.size_t() - local raw_json = molch_interface.create_ucstring_pointer() - local raw_json_length = molch_interface.size_t() + local raw_backup = molch_interface.create_ucstring_pointer() + local raw_backup_length = molch_interface.size_t() local raw_receive_message_number = molch_interface.size_t() local raw_previous_receive_message_number = molch_interface.size_t() @@ -547,20 +559,21 @@ function molch.conversation:decrypt_message(packet) convert_to_c_string(self.id), raw_receive_message_number, raw_previous_receive_message_number, - raw_json, - raw_json_length) + raw_backup, + raw_backup_length) local status_type = molch_interface.get_status(status) if status_type ~= molch_interface.SUCCESS then molch_interface.free(raw_message) - molch_interface.free(raw_json) + molch_interface.free(raw_backup) error(molch.print_errors(status)) end raw_message = copy_callee_allocated_string(raw_message, raw_message_length) - raw_json = copy_callee_allocated_string(raw_json, raw_json_length, molch_interface.sodium_free) + raw_backup = copy_callee_allocated_string(raw_backup, raw_backup_length) + local message = convert_to_lua_string(raw_message, raw_message_length) - self.json = convert_to_lua_string(raw_json, raw_json_length) + self.backup = molch.backup.new(raw_backup, raw_backup_length) return message, raw_receive_message_number:value(), raw_previous_receive_message_number:value() end @@ -575,20 +588,18 @@ function molch.conversation:destroy() end end - local raw_json = molch_interface.create_ucstring_pointer() - local raw_json_length = molch_interface.size_t() + local raw_backup = molch_interface.create_ucstring_pointer() + local raw_backup_length = molch_interface.size_t() molch_interface.molch_end_conversation( convert_to_c_string(self.id), - raw_json, - raw_json_length) - - raw_json = copy_callee_allocated_string(raw_json, raw_json_length --[[FIXME Why does this crash?, molch_interface.sodium_free]]) + raw_backup, + raw_backup_length) - local json = convert_to_lua_string(raw_json, raw_json_length) + raw_backup = copy_callee_allocated_string(raw_backup, raw_backup_length) - containing_user.json = json - users.attributes.json = json + containing_user.backup = molch.backup.new(raw_backup, raw_backup_length) + users.attributes.backup = containing_user.backup.copy() containing_user.conversations[self.id] = nil recursively_delete_table(self) diff --git a/bindings/scenarios/CMakeLists.txt b/bindings/scenarios/CMakeLists.txt index ef4a0eab..3437c653 100644 --- a/bindings/scenarios/CMakeLists.txt +++ b/bindings/scenarios/CMakeLists.txt @@ -1,4 +1,4 @@ -set(scenarios normal-conversation reordering invalid_message json-double-import json-restart) +set(scenarios normal-conversation reordering invalid_message double-import restart) execute_process(COMMAND cmake -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/scenarios.lua" "${CMAKE_CURRENT_BINARY_DIR}/scenarios.lua") diff --git a/bindings/scenarios/double-import b/bindings/scenarios/double-import new file mode 100644 index 00000000..4479b48e --- /dev/null +++ b/bindings/scenarios/double-import @@ -0,0 +1,5 @@ +errors_on() +echo_on() +export() +import() +import() diff --git a/bindings/scenarios/json-double-import b/bindings/scenarios/json-double-import deleted file mode 100644 index c95092ca..00000000 --- a/bindings/scenarios/json-double-import +++ /dev/null @@ -1,5 +0,0 @@ -errors_on() -echo_on() -json_export() -json_import() -json_import() diff --git a/bindings/scenarios/json-restart b/bindings/scenarios/restart similarity index 100% rename from bindings/scenarios/json-restart rename to bindings/scenarios/restart diff --git a/bindings/scenarios/scenarios.lua b/bindings/scenarios/scenarios.lua index f44b6c51..5bbff261 100644 --- a/bindings/scenarios/scenarios.lua +++ b/bindings/scenarios/scenarios.lua @@ -14,7 +14,7 @@ local bob_sent = {} local alice_conversation = nil local bob_conversation = nil -local json = nil +local backup = nil local functions = {} @@ -184,23 +184,23 @@ function bob_messages() end functions.bob_messages = bob_messages -function json_export() +function export() if echo then - print("> json_export()") + print("> export()") end - json = molch.json_export() + backup = molch.export() end -functions.json_export = json_export +functions.export = export -function json_import() +function import() if echo then - print("> json_import()") + print("> import()") end - molch.json_import(json) + molch.import(backup) end -functions.json_import = json_import +functions.import = import function restart() if echo then @@ -210,9 +210,9 @@ function restart() local alice_id = alice.id local bob_id = bob.id - json = molch.json_export() + backup = molch.export() molch.destroy_all_users() - molch.json_import(json) + molch.import(backup) alice = molch.users[alice_id] alice_conversation = alice.conversations[alice.conversations[1]] From 2bc024848fedc516176d33f5aa39b32c93ae1e28 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Thu, 30 Jun 2016 16:22:39 +0200 Subject: [PATCH 11/53] molch: use expiration date instead of timestamp in prekey lists --- lib/molch.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/molch.c b/lib/molch.c index 15934b52..5794902f 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -92,11 +92,11 @@ return_status create_prekey_list( status = prekey_store_list(user->prekeys, prekeys); throw_on_error(DATA_FETCH_ERROR, "Failed to get prekeys."); - //add the timestamp - time_t timestamp = time(NULL); - buffer_create_with_existing_array(big_endian_timestamp, unsigned_prekey_list->content + PUBLIC_KEY_SIZE + PREKEY_AMOUNT * PUBLIC_KEY_SIZE, sizeof(int64_t)); - status = endianness_time_to_big_endian(timestamp, big_endian_timestamp); - throw_on_error(CONVERSION_ERROR, "Failed to convert timestamp to big endian."); + //add the expiration date + time_t expiration_date = time(NULL) + 3600 * 24 * 31 * 3; //the prekey list will expire in 3 months + buffer_create_with_existing_array(big_endian_expiration_date, unsigned_prekey_list->content + PUBLIC_KEY_SIZE + PREKEY_AMOUNT * PUBLIC_KEY_SIZE, sizeof(int64_t)); + status = endianness_time_to_big_endian(expiration_date, big_endian_expiration_date); + throw_on_error(CONVERSION_ERROR, "Failed to convert expiration date to big endian."); unsigned_prekey_list->content_length = unsigned_prekey_list->buffer_length; //sign the prekey list with the current identity key @@ -363,16 +363,16 @@ return_status verify_prekey_list( } verified_prekey_list->content_length = verified_length; - //get the timestamp - time_t timestamp; - buffer_create_with_existing_array(big_endian_timestamp, verified_prekey_list->content + PUBLIC_KEY_SIZE + PREKEY_AMOUNT * PUBLIC_KEY_SIZE, sizeof(int64_t)); - status = endianness_time_from_big_endian(×tamp, big_endian_timestamp); - throw_on_error(CONVERSION_ERROR, "Failed to convert timestamp to big endian."); + //get the expiration date + time_t expiration_date; + buffer_create_with_existing_array(big_endian_expiration_date, verified_prekey_list->content + PUBLIC_KEY_SIZE + PREKEY_AMOUNT * PUBLIC_KEY_SIZE, sizeof(int64_t)); + status = endianness_time_from_big_endian(&expiration_date, big_endian_expiration_date); + throw_on_error(CONVERSION_ERROR, "Failed to convert expiration date to big endian."); - //make sure the prekey list isn't to old + //make sure the prekey list isn't too old time_t current_time = time(NULL); - if ((timestamp + 3600 * 24 * 31 * 3) < current_time) { //timestamp is older than 3 months - throw(OUTDATED, "Timestamp is too old (older than 3 months)."); + if (expiration_date < current_time) { + throw(OUTDATED, "Prekey list has expired (older than 3 months)."); } //copy the public identity key From 5cfbef7e0c2561327124586f19d09dee2b3127fd Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Thu, 30 Jun 2016 19:06:31 +0200 Subject: [PATCH 12/53] molch: fix potential memory leak: destroy user store instead of only clearing it --- lib/molch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/molch.c b/lib/molch.c index 5794902f..3d68d04a 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -256,7 +256,7 @@ size_t molch_user_count() { */ void molch_destroy_all_users() { if (users != NULL) { - user_store_clear(users); + user_store_destroy(users); } users = NULL; From 21c314bd28dbd7b71e1edb38e0af36e4015115fe Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Thu, 30 Jun 2016 19:59:02 +0200 Subject: [PATCH 13/53] prekey-store: use expiration date instead of timestamp --- lib/prekey-store.c | 124 +++++++++++++-------------- lib/prekey-store.h | 6 +- test/prekey-store-test.c | 8 +- test/test-data/molch-init-backup.key | Bin 32 -> 32 bytes test/test-data/molch-init.backup | Bin 19209 -> 19821 bytes 5 files changed, 68 insertions(+), 70 deletions(-) diff --git a/lib/prekey-store.c b/lib/prekey-store.c index 903042de..8396319f 100644 --- a/lib/prekey-store.c +++ b/lib/prekey-store.c @@ -21,6 +21,9 @@ #include #include "prekey-store.h" +static const time_t PREKEY_EXPIRATION_TIME = 3600 * 24 * 31; //one month +static const time_t DEPRECATED_PREKEY_EXPIRATION_TIME = 3600; //one hour + /* * Initialise a new keystore. Generates all the keys. */ @@ -35,16 +38,16 @@ return_status prekey_store_create(prekey_store ** const store) { if (*store == NULL) { throw(ALLOCATION_FAILED, "Failed to allocate prekey store."); } - //set timestamp to the past --> rotate will create new keys - (*store)->oldest_timestamp = 0; - (*store)->oldest_deprecated_timestamp = 0; + //set expiration date to the past --> rotate will create new keys + (*store)->oldest_expiration_date = 0; + (*store)->oldest_deprecated_expiration_date = 0; (*store)->deprecated_prekeys = NULL; for (size_t i = 0; i < PREKEY_AMOUNT; i++) { - (*store)->prekeys[i].timestamp = time(NULL); - if (((*store)->oldest_timestamp == 0) || ((*store)->prekeys[i].timestamp < (*store)->oldest_timestamp)) { - (*store)->oldest_timestamp = (*store)->prekeys[i].timestamp; + (*store)->prekeys[i].expiration_date = time(NULL) + PREKEY_EXPIRATION_TIME; + if (((*store)->oldest_expiration_date == 0) || ((*store)->prekeys[i].expiration_date < (*store)->oldest_expiration_date)) { + (*store)->oldest_expiration_date = (*store)->prekeys[i].expiration_date; } (*store)->prekeys[i].next = NULL; @@ -98,7 +101,7 @@ int deprecate(prekey_store * const store, size_t index) { //initialise the deprecated node deprecated_node->next =store->deprecated_prekeys; - deprecated_node->timestamp = time(NULL); + deprecated_node->expiration_date = time(NULL) + DEPRECATED_PREKEY_EXPIRATION_TIME; buffer_init_with_pointer( deprecated_node->public_key, deprecated_node->public_key_storage, @@ -121,8 +124,8 @@ int deprecate(prekey_store * const store, size_t index) { } //add it to the list of deprecated keys - if ((store->oldest_deprecated_timestamp == 0) || (store->oldest_deprecated_timestamp > deprecated_node->timestamp)) { - store->oldest_deprecated_timestamp = deprecated_node->timestamp; + if ((store->oldest_deprecated_expiration_date == 0) || (store->oldest_deprecated_expiration_date > deprecated_node->expiration_date)) { + store->oldest_deprecated_expiration_date = deprecated_node->expiration_date; } store->deprecated_prekeys = deprecated_node; @@ -133,7 +136,7 @@ int deprecate(prekey_store * const store, size_t index) { if (status != 0) { goto cleanup; } - store->prekeys[index].timestamp = time(NULL); + store->prekeys[index].expiration_date = time(NULL) + PREKEY_EXPIRATION_TIME; cleanup: if ((status != 0) && (deprecated_node != NULL)) { @@ -250,24 +253,19 @@ return_status prekey_store_rotate(prekey_store * const store) { throw(INVALID_INPUT, "Invalid input to prekey_store_rotate: store is NULL."); } - //time after which a prekey get's deprecated - static const time_t deprecated_time = 3600 * 24 * 31; //one month - //time after which a deprecated prekey gets removed - static const time_t remove_time = 3600; //one hour - time_t current_time = time(NULL); - //Is the timestamp in the future? - if (current_time < store->oldest_timestamp) { + //Is the expiration date too far into the future? + if ((current_time + PREKEY_EXPIRATION_TIME) < store->oldest_expiration_date) { //TODO: Is this correct behavior? - //Set the timestamp of everything to the current time + //Set the expiration date of everything to the current time + PREKEY_EXPIRATION_TIME for (size_t i = 0; i < PREKEY_AMOUNT; i++) { - store->prekeys[i].timestamp = current_time; + store->prekeys[i].expiration_date = current_time + PREKEY_EXPIRATION_TIME; } prekey_store_node *next = store->deprecated_prekeys; while (next != NULL) { - next->timestamp = current_time; + next->expiration_date = current_time + DEPRECATED_PREKEY_EXPIRATION_TIME; next = next->next; } @@ -275,27 +273,27 @@ return_status prekey_store_rotate(prekey_store * const store) { } //At least one outdated prekey - time_t new_oldest_timestamp = current_time; - if ((store->oldest_timestamp + deprecated_time) < current_time) { + time_t new_oldest_expiration_date = current_time + PREKEY_EXPIRATION_TIME; + if (store->oldest_expiration_date < current_time) { for (size_t i = 0; i < PREKEY_AMOUNT; i++) { - if ((store->prekeys[i].timestamp + deprecated_time) < current_time) { + if (store->prekeys[i].expiration_date < current_time) { if (deprecate(store, i) != 0) { throw(GENERIC_ERROR, "Failed to deprecate key."); } - } else if (store->prekeys[i].timestamp < new_oldest_timestamp) { - new_oldest_timestamp = store->prekeys[i].timestamp; + } else if (store->prekeys[i].expiration_date < new_oldest_expiration_date) { + new_oldest_expiration_date = store->prekeys[i].expiration_date; } } } - store->oldest_timestamp = new_oldest_timestamp; + store->oldest_expiration_date = new_oldest_expiration_date; - //Is the deprecated oldest timestamp in the future? - if (current_time < store->oldest_deprecated_timestamp) { + //Is the deprecated oldest expiration date too far into the future? + if ((current_time + DEPRECATED_PREKEY_EXPIRATION_TIME) < store->oldest_deprecated_expiration_date) { //TODO: Is this correct behavior? - //Set the timestamp of everything to the current time + //Set the expiration date of everything to the current time + DEPRECATED_PREKEY_EXPIRATION_TIME prekey_store_node *next = store->deprecated_prekeys; while (next != NULL) { - next->timestamp = current_time; + next->expiration_date = current_time + DEPRECATED_PREKEY_EXPIRATION_TIME; next = next->next; } @@ -303,18 +301,18 @@ return_status prekey_store_rotate(prekey_store * const store) { } //At least one key to be removed - time_t new_oldest_deprecated_timestamp = current_time; - if ((store->deprecated_prekeys != NULL) && (store->oldest_deprecated_timestamp + remove_time) < current_time) { + time_t new_oldest_deprecated_expiration_date = current_time + DEPRECATED_PREKEY_EXPIRATION_TIME; + if ((store->deprecated_prekeys != NULL) && (store->oldest_deprecated_expiration_date < current_time)) { prekey_store_node **last_pointer = &(store->deprecated_prekeys); prekey_store_node *next = store->deprecated_prekeys; while(next != NULL) { - if ((next->timestamp + remove_time) < current_time) { + if (next->expiration_date < current_time) { *last_pointer = next->next; sodium_free(next); next = *last_pointer; continue; - } else if (next->timestamp < new_oldest_deprecated_timestamp) { - new_oldest_deprecated_timestamp = next->timestamp; + } else if (next->expiration_date < new_oldest_deprecated_expiration_date) { + new_oldest_deprecated_expiration_date = next->expiration_date; } last_pointer = &(next->next); @@ -351,13 +349,13 @@ mcJSON *prekey_store_node_json_export(const prekey_store_node * const node, memp return NULL; } - //add timestamp - mcJSON *timestamp = mcJSON_CreateNumber((double)node->timestamp, pool); - if (timestamp == NULL) { + //add expiration date + mcJSON *expiration_date = mcJSON_CreateNumber((double)node->expiration_date, pool); + if (expiration_date == NULL) { return NULL; } - buffer_create_from_string(timestamp_string, "timestamp"); - mcJSON_AddItemToObject(json, timestamp_string, timestamp, pool); + buffer_create_from_string(expiration_date_string, "expiration_date"); + mcJSON_AddItemToObject(json, expiration_date_string, expiration_date, pool); //add public key mcJSON *public_key_hex = mcJSON_CreateHexString(node->public_key, pool); @@ -390,21 +388,21 @@ mcJSON *prekey_store_json_export(const prekey_store * const store, mempool_t * c return NULL; } - //add oldest timestamp - mcJSON *oldest_timestamp = mcJSON_CreateNumber((double)store->oldest_timestamp, pool); - if (oldest_timestamp == NULL) { + //add oldest expiration_date + mcJSON *oldest_expiration_date = mcJSON_CreateNumber((double)store->oldest_expiration_date, pool); + if (oldest_expiration_date == NULL) { return NULL; } - buffer_create_from_string(oldest_timestamp_string, "oldest_timestamp"); - mcJSON_AddItemToObject(json, oldest_timestamp_string, oldest_timestamp, pool); + buffer_create_from_string(oldest_expiration_date_string, "oldest_expiration_date"); + mcJSON_AddItemToObject(json, oldest_expiration_date_string, oldest_expiration_date, pool); - //add oldest_deprecated_timestamp - mcJSON *oldest_deprecated_timestamp = mcJSON_CreateNumber((double)store->oldest_deprecated_timestamp, pool); - if (oldest_deprecated_timestamp == NULL) { + //add oldest deprecated expiration date + mcJSON *oldest_deprecated_expiration_date = mcJSON_CreateNumber((double)store->oldest_deprecated_expiration_date, pool); + if (oldest_deprecated_expiration_date == NULL) { return NULL; } - buffer_create_from_string(oldest_deprecated_timestamp_string, "oldest_deprecated_timestamp"); - mcJSON_AddItemToObject(json, oldest_deprecated_timestamp_string, oldest_deprecated_timestamp, pool); + buffer_create_from_string(oldest_deprecated_expiration_date_string, "oldest_deprecated_expiration_date"); + mcJSON_AddItemToObject(json, oldest_deprecated_expiration_date_string, oldest_deprecated_expiration_date, pool); //create the list of prekeys mcJSON *prekeys = mcJSON_CreateArray(pool); @@ -452,12 +450,12 @@ int prekey_store_node_json_import(prekey_store_node * const node, const mcJSON * return -1; } - buffer_create_from_string(timestamp_string, "timestamp"); - mcJSON *timestamp = mcJSON_GetObjectItem(json, timestamp_string); - if ((timestamp == NULL) || (timestamp->type != mcJSON_Number)) { + buffer_create_from_string(expiration_date_string, "expiration_date"); + mcJSON *expiration_date = mcJSON_GetObjectItem(json, expiration_date_string); + if ((expiration_date == NULL) || (expiration_date->type != mcJSON_Number)) { return -1; } - node->timestamp = (time_t) timestamp->valuedouble; + node->expiration_date = (time_t) expiration_date->valuedouble; buffer_create_from_string(public_key_string, "public_key"); mcJSON *public_key = mcJSON_GetObjectItem(json, public_key_string); @@ -495,22 +493,22 @@ prekey_store *prekey_store_json_import(const mcJSON * const json __attribute__(( int status = 0; - //timestamps - buffer_create_from_string(oldest_timestamp_string, "oldest_timestamp"); - mcJSON *oldest_timestamp = mcJSON_GetObjectItem(json, oldest_timestamp_string); - if ((oldest_timestamp == NULL) || (oldest_timestamp->type != mcJSON_Number)) { + //expiration dates + buffer_create_from_string(oldest_expiration_date_string, "oldest_expiration_date"); + mcJSON *oldest_expiration_date = mcJSON_GetObjectItem(json, oldest_expiration_date_string); + if ((oldest_expiration_date == NULL) || (oldest_expiration_date->type != mcJSON_Number)) { status = -1; goto cleanup; } - store->oldest_timestamp = (time_t)oldest_timestamp->valuedouble; + store->oldest_expiration_date = (time_t)oldest_expiration_date->valuedouble; - buffer_create_from_string(oldest_deprecated_timestamp_string, "oldest_deprecated_timestamp"); - mcJSON *oldest_deprecated_timestamp = mcJSON_GetObjectItem(json, oldest_deprecated_timestamp_string); - if ((oldest_deprecated_timestamp == NULL) || (oldest_deprecated_timestamp->type != mcJSON_Number)) { + buffer_create_from_string(oldest_deprecated_expiration_date_string, "oldest_deprecated_expiration_date"); + mcJSON *oldest_deprecated_expiration_date = mcJSON_GetObjectItem(json, oldest_deprecated_expiration_date_string); + if ((oldest_deprecated_expiration_date == NULL) || (oldest_deprecated_expiration_date->type != mcJSON_Number)) { status = -1; goto cleanup; } - store->oldest_deprecated_timestamp = (time_t)oldest_deprecated_timestamp->valuedouble; + store->oldest_deprecated_expiration_date = (time_t)oldest_deprecated_expiration_date->valuedouble; //load all the regular prekeys buffer_create_from_string(prekeys_string, "prekeys"); diff --git a/lib/prekey-store.h b/lib/prekey-store.h index 8c50e5a2..f84cb225 100644 --- a/lib/prekey-store.h +++ b/lib/prekey-store.h @@ -34,15 +34,15 @@ struct prekey_store_node { unsigned char public_key_storage[PUBLIC_KEY_SIZE]; buffer_t private_key[1]; unsigned char private_key_storage[PRIVATE_KEY_SIZE]; - time_t timestamp; + time_t expiration_date; }; typedef struct prekey_store prekey_store; struct prekey_store { - time_t oldest_timestamp; + time_t oldest_expiration_date; prekey_store_node prekeys[PREKEY_AMOUNT]; prekey_store_node *deprecated_prekeys; - time_t oldest_deprecated_timestamp; + time_t oldest_deprecated_expiration_date; }; /* diff --git a/test/prekey-store-test.c b/test/prekey-store-test.c index c100367f..6c76c5e9 100644 --- a/test/prekey-store-test.c +++ b/test/prekey-store-test.c @@ -145,8 +145,8 @@ int main(void) { throw(BUFFER_ERROR, "Failed to clone public key."); } - store->prekeys[PREKEY_AMOUNT-1].timestamp -= 365 * 24 * 3600; //one year - store->oldest_timestamp = store->prekeys[PREKEY_AMOUNT - 1].timestamp; + store->prekeys[PREKEY_AMOUNT-1].expiration_date -= 365 * 24 * 3600; //one year + store->oldest_expiration_date = store->prekeys[PREKEY_AMOUNT - 1].expiration_date; status = prekey_store_rotate(store); throw_on_error(GENERIC_ERROR, "Failed to rotate the prekeys."); @@ -161,8 +161,8 @@ int main(void) { throw(BUFFER_ERROR, "Failed to clone public key."); } - store->deprecated_prekeys->next->timestamp -= 24 * 3600; - store->oldest_deprecated_timestamp = store->deprecated_prekeys->next->timestamp; + store->deprecated_prekeys->next->expiration_date -= 24 * 3600; + store->oldest_deprecated_expiration_date = store->deprecated_prekeys->next->expiration_date; status = prekey_store_rotate(store); throw_on_error(GENERIC_ERROR, "Failed to rotate the prekeys."); diff --git a/test/test-data/molch-init-backup.key b/test/test-data/molch-init-backup.key index 1b3c736f9d2893234f63d5ca8d099be37df00397..3c3cb8b8c895f86a0a599837fdec18d131af0b74 100644 GIT binary patch literal 32 ocmYdYY;lt7e^|eyz?q;qC7W#K=yWBy&;O@(ezMiWL#Y=z0QNi&cmMzZ literal 32 ocmZ<_zQ5YW;f3Tk2N%7pw}neTWgZsZChFO@*W_ZJEyMYF0REB>VgLXD diff --git a/test/test-data/molch-init.backup b/test/test-data/molch-init.backup index 026a940ff11cd8b43cae3ea508e03810774c0817..5066f660ba05c610ff635c34857f935a3ea65a9f 100644 GIT binary patch literal 19821 zcmV(tKM)N;=My+~ z(o-N^(iH{QSamm3J{AlV#s66`@L?BHmH3{1A&V><&_xP%cY1I0wA77t!|w`0Ydi2$ zWVk-F>F7 z=>E$0QUAiay3)>?8pt1iw|JoK@~F!FcV(H!=P3%Xc+1f{I@Dj^!b>>k572c9=^9Qj zxX`xbw*)cUZnFZr*{FsY?m+p^<)*ZC96^z(rkeQPO_9Br%^(>LT}AV79oI)3wY3Ec zcI%{hO6ZV5?e<1MPFsR9iLsXNBV0Qx=i$^^qkiB!UoBwbaT@|)LFCeU%F&WeHk8CY zhyk1D(WnX@LJ=L(iabq`Mh9pD-<@U&ixT(FkNOYBCS%;Mow3I3%T(VH1>vSu&YKqz z+{aQ?x^b%D_}{to$Q&chdX1PRh`Y6)6nL_bjIuiC*?x7%S>_y^yH0a7bk9|Da9X*y zE^Eb#(6LYW)6^{q4$>+G3bA@CU|Ay2%y8M*lQAD3VYmQD~D)ZbZ~ z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0}N3r6U?~}GsV}O4MX!6V!CYN|GM0ktwF0?&~b8*U+FLR-xhC07H z$9}Ub#=w>l=;;VUMvs%yD9jLLQv{hE#Z;)doi1J6N88OkzHw zt&$n`X#BBd5e+zPI;I)z2bqv$WZ(CU3-e4ef}RCr^O^O_;$6XK(b)^QgV+%t;{-x+ z$agB|K&G5}XXN5~t3+8&q%&T&9c@cg$uqOb!{9M@*t{Jd*10FEx75<&hk6J5moBdQozg5 z8&E=>oOjM2<0av!Z)T@UHKs*mH1+0;*?n^-*oLrw{?FDt-awO}j^RPxX^bke#3|2iej zKJu;!r)Jllhtd>2%|<%53ISuZ{k_0G)~hjeo*E33Q<^ZDXT#8#_IlhnAX5&P$^N1U zQgXd4ad+RGK_blzB6pMkdtAWGQ?^JE_+Kk(lByyiw~d-}TKaQw9NMfs|F|GXqa%h^ zTWjNmDm7Xo*=+a*u*n)qZTK1&rwG?+Kp}J6{TuCu-H!f`)j_-k@j!nQ%a1mAUA z^V93<^b$G7LOo0xSwm>!_plweEShExzE)U#Cr4za0^om!7`yuxR%aVKViq>vtgdsh;v)O~`9StpS;d%n kC71xIcMV=Vp_bYf1_D?T{{zqz(MM^Lq9-mEfBtJ#uhyPs0RR91 From 24c6069dd4e89b981fcdb753bf7403d969b90470 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Thu, 30 Jun 2016 20:15:15 +0200 Subject: [PATCH 14/53] header-and-message-keystore: use expiration date instead of timestamp --- lib/header-and-message-keystore.c | 24 +++++++++++++----------- lib/header-and-message-keystore.h | 2 +- test/test-data/molch-init-backup.key | 3 +-- test/test-data/molch-init.backup | Bin 19821 -> 19821 bytes 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lib/header-and-message-keystore.c b/lib/header-and-message-keystore.c index 2ad8c7a3..122eec83 100644 --- a/lib/header-and-message-keystore.c +++ b/lib/header-and-message-keystore.c @@ -22,6 +22,8 @@ #include "constants.h" #include "header-and-message-keystore.h" +static const time_t EXPIRATION_TIME = 3600 * 24 * 31; //one month + //create new keystore void header_and_message_keystore_init(header_and_message_keystore * const keystore) { keystore->length = 0; @@ -90,8 +92,8 @@ return_status header_and_message_keystore_add( } int status_int = 0; - //set keys and timestamp - new_node->timestamp = time(NULL); + //set keys and expiration date + new_node->expiration_date = time(NULL) + EXPIRATION_TIME; status_int = buffer_clone(new_node->message_key, message_key); if (status_int != 0) { sodium_free(new_node); @@ -146,13 +148,13 @@ mcJSON *header_and_message_keystore_node_json_export(header_and_message_keystore return NULL; } - //add timestamp - mcJSON *timestamp = mcJSON_CreateNumber((double)node->timestamp, pool); - if (timestamp == NULL) { + //add expiration_date + mcJSON *expiration_date = mcJSON_CreateNumber((double)node->expiration_date, pool); + if (expiration_date == NULL) { return NULL; } - buffer_create_from_string(timestamp_string, "timestamp"); - mcJSON_AddItemToObject(json, timestamp_string, timestamp, pool); + buffer_create_from_string(expiration_date_string, "expiration_date"); + mcJSON_AddItemToObject(json, expiration_date_string, expiration_date, pool); //add message key mcJSON *message_key_hex = mcJSON_CreateHexString(node->message_key, pool); @@ -227,13 +229,13 @@ int header_and_message_keystore_json_import( mcJSON *message_key = mcJSON_GetObjectItem(key, message_key_string); buffer_create_from_string(header_key_string, "header_key"); mcJSON *header_key = mcJSON_GetObjectItem(key, header_key_string); - buffer_create_from_string(timestamp_string, "timestamp"); - mcJSON *timestamp = mcJSON_GetObjectItem(key, timestamp_string); + buffer_create_from_string(expiration_date_string, "expiration_date"); + mcJSON *expiration_date = mcJSON_GetObjectItem(key, expiration_date_string); //check if they are valid if ((message_key == NULL) || (message_key->type != mcJSON_String) || (message_key->valuestring->content_length != (2 * MESSAGE_KEY_SIZE + 1)) || (header_key == NULL) || (header_key->type != mcJSON_String) || (header_key->valuestring->content_length != (2 * HEADER_KEY_SIZE + 1)) - || (timestamp == NULL) || (timestamp->type != mcJSON_Number)) { + || (expiration_date == NULL) || (expiration_date->type != mcJSON_Number)) { header_and_message_keystore_clear(keystore); return -3; } @@ -260,7 +262,7 @@ int header_and_message_keystore_json_import( return status; } - node->timestamp = timestamp->valuedouble; //double should be large enough + node->expiration_date = expiration_date->valuedouble; //double should be large enough add_node(keystore, node); } diff --git a/lib/header-and-message-keystore.h b/lib/header-and-message-keystore.h index ab0a57bc..f3ef5001 100644 --- a/lib/header-and-message-keystore.h +++ b/lib/header-and-message-keystore.h @@ -39,7 +39,7 @@ struct header_and_message_keystore_node { unsigned char message_key_storage[MESSAGE_KEY_SIZE]; buffer_t header_key[1]; unsigned char header_key_storage[HEADER_KEY_SIZE]; - time_t timestamp; + time_t expiration_date; }; //header of the key store diff --git a/test/test-data/molch-init-backup.key b/test/test-data/molch-init-backup.key index 3c3cb8b8..dcd6c774 100644 --- a/test/test-data/molch-init-backup.key +++ b/test/test-data/molch-init-backup.key @@ -1,2 +1 @@ -e£8É -ÿVÌRœt²<œ,ŠbGŸþ&Ï“:áÂeÑ \ No newline at end of file +ãXþÕLàj¡_gu)™æzôµ”È‘»ñ7HßÊ;1vù \ No newline at end of file diff --git a/test/test-data/molch-init.backup b/test/test-data/molch-init.backup index 5066f660ba05c610ff635c34857f935a3ea65a9f..001dcd0971506e1da9459ba7a1609ca207a68b86 100644 GIT binary patch literal 19821 zcmV(jK=!}%bdjcAEJ)+nit8V(i}F6F0PtYwUN1|D@9aP?kWx`}bEtNi$%J|0gfqgZ zm_tf9<6T~KwH(&0ybU!H>Ji{M8O_h3_X_#^Eiv0-5J{}qhAw1gLZM5Ig_be_Va?E* z_EY3Zoj65RRq_==xFD`vX$(AdCq2fXbqBnwe0NHD0U+3x+eXd%#H|IHMFby;N|Q`a zyve~niP-(AV+AG#@|Ct!rNY$h-bv;n#id+y46`rEB&4kEh5cawB#@<9a$i2{H3^CM zvgotcrA!$<#;!{?f`C9TY0-^O5HVZgC`$Q@&j{rmvue1yM1?g&qSu_8qMPp`kEdu* zp~q;IDX?xC$=JFQ;VI5uIweOcSes=O@6H~Xbpf1E*dRf)Z4>0MSe0I984{%luHOFq z)}dMDmF;=A99k=hgaIxM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15/53] molch.c: Remove now unnecessary function prototypes --- lib/molch.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/molch.c b/lib/molch.c index 3d68d04a..0ca35497 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -38,17 +38,6 @@ static user_store *users = NULL; static buffer_t *backup_key = NULL; -//function prototypes -return_status molch_json_import(const unsigned char* const json, const size_t length) __attribute__((warn_unused_result)); -return_status molch_json_export( - unsigned char ** const json, - size_t *length) __attribute__((warn_unused_result)); -return_status molch_conversation_json_export( - unsigned char ** const json, - const unsigned char * const conversation_id, - size_t * const length) __attribute__((warn_unused_result)); -return_status molch_conversation_json_import(const unsigned char * const json, const size_t length) __attribute__((warn_unused_result)); - /* * Create a prekey list. */ From 0c3b2af9f4113e9b35134392a09ea4afcaec4f32 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Fri, 1 Jul 2016 16:04:39 +0200 Subject: [PATCH 16/53] molch.h: replace dos style CRLF line endings with unix style LF --- lib/molch.h | 620 ++++++++++++++++++++++++++-------------------------- 1 file changed, 310 insertions(+), 310 deletions(-) diff --git a/lib/molch.h b/lib/molch.h index ffae267f..6d761eac 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -1,310 +1,310 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include "return-status.h" - -#ifndef LIB_MOLCH_H -#define LIB_MOLCH_H - -/* - * THIS HEADER IS ONLY AN EARLY PREVIEW. IT WILL MOST CERTAINLY CHANGE IN THE FUTURE. - */ -/* - * WARNING: ALTHOUGH THIS IMPLEMENTS THE AXOLOTL PROTOCOL, IT ISN't CONSIDERED SECURE ENOUGH TO USE AT THIS POINT - */ - -/* - * Create a new user. The user is identified by the public master key. - * - * Get's random input (can be in any format and doesn't have - * to be uniformly distributed) and uses it in combination - * with the OS's random number generator to generate a - * signing and identity keypair for the user. - * - * IMPORTANT: Don't put random numbers provided by the operating - * system in there. - * - * This also creates a signed list of prekeys to be uploaded to - * the server. - * - * A new backup key is generated that subsequent backups of the library state will be encrypted with. - * - * Don't forget to destroy the return status with molch_destroy_return_status() - * if an error has occurred. - */ -return_status molch_create_user( - unsigned char *const public_master_key, //output, PUBLIC_MASTER_KEY_SIZE - unsigned char **const prekey_list, //output, needs to be freed - size_t *const prekey_list_length, - const unsigned char *const random_data, - const size_t random_data_length, - unsigned char * backup_key, //output, BACKUP_KEY_SIZE - unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! - size_t *const backup_length //optional, can be NULL - ) __attribute__((warn_unused_result)); - -/* - * Destroy a user. - * - * Don't forget to destroy the return status with molch_destroy_return_status() - * if an error has occurred. - */ -return_status molch_destroy_user( - const unsigned char *const public_signing_key, - unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use - size_t *const backup_length //optional, can be NULL -); - -/* - * Get the number of users. - */ -size_t molch_user_count(); - -/* - * List all of the users (list of the public keys), - * NULL if there are no users. - * - * This list is heap allocated, so don't forget to free it. - * - * Don't forget to destroy the return status with molch_destroy_return_status() - * if an error has occurred. - */ -return_status molch_user_list(unsigned char **const user_list, size_t *count); - -/* - * Delete all users. - */ -void molch_destroy_all_users(); - -typedef enum molch_message_type { PREKEY_MESSAGE, NORMAL_MESSAGE, INVALID } molch_message_type; - -/* - * Get the type of a message. - * - * This is either a normal message or a prekey message. - * Prekey messages mark the start of a new conversation. - */ -molch_message_type molch_get_message_type( - const unsigned char * const packet, - const size_t packet_length); - -/* - * Start a new conversation. (sending) - * - * The conversation can be identified by it's ID - * - * This requires a new set of prekeys from the receiver. - * - * Don't forget to destroy the return status with molch_destroy_return_status() - * if an error has occurred. - */ -return_status molch_create_send_conversation( - unsigned char * const conversation_id, //output, CONVERSATION_ID_SIZE long (from conversation.h) - unsigned char ** const packet, //output, will be malloced by the function, don't forget to free it after use! - size_t *packet_length, //output - const unsigned char * const message, - const size_t message_length, - const unsigned char * const prekey_list, //prekey list of the receiver - const size_t prekey_list_length, - const unsigned char * const sender_public_signing_key, //signing key of the sender (user) - const unsigned char * const receiver_public_signing_key, //signing key of the receiver - unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! - size_t * const backup_length //optional, can be NULL - ) __attribute__((warn_unused_result)); - -/* - * Start a new conversation. (receiving) - * - * This also generates a new set of prekeys to be uploaded to the server. - * - * This function is called after receiving a prekey message. - * - * The conversation can be identified by it's ID - * - * Don't forget to destroy the return status with molch_destroy_return_status() - * if an error has occurred. - */ -return_status molch_create_receive_conversation( - unsigned char * const conversation_id, //output, CONVERSATION_ID_SIZE long (from conversation.h) - unsigned char ** const message, //output, will be malloced by the function, don't forget to free it after use! - size_t * const message_length, //output - const unsigned char * const packet, //received prekey packet - const size_t packet_length, - unsigned char ** const prekey_list, //output, free after use - size_t * const prekey_list_length, - const unsigned char * const sender_public_signing_key, //signing key of the sender - const unsigned char * const receiver_public_signing_key, //signing key of the receiver (user) - unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! - size_t * const backup_length //optional, can be NULL - ) __attribute__((warn_unused_result)); - -/* - * Encrypt a message and create a packet that can be sent to the receiver. - * - * Don't forget to destroy the return status with molch_destroy_return_status() - * if an error has occurred. - */ -return_status molch_encrypt_message( - unsigned char ** const packet, //output, will be malloced by the function, don't forget to free it after use! - size_t *packet_length, //output, length of the packet - const unsigned char * const message, - const size_t message_length, - const unsigned char * const conversation_id, - unsigned char ** const backup, //optional, can be NULL, exports the conversationn, free after use, check if NULL before use! - size_t * const backup_length - ) __attribute__((warn_unused_result)); - -/* - * Decrypt a message. - * - * Don't forget to destroy the return status with molch_destroy_return_status() - * if an error has occurred. - */ -return_status molch_decrypt_message( - unsigned char ** const message, //output, will be malloced by the function, don't forget to free it after use! - size_t *message_length, //output - const unsigned char * const packet, //received packet - const size_t packet_length, - const unsigned char * const conversation_id, - uint32_t * const receive_message_number, //output - uint32_t * const previous_receive_message_number, //output - unsigned char ** const backup, //optional, can be NULL, exports the conversation, free after use, check if NULL before use! - size_t * const backup_length - ) __attribute__((warn_unused_result)); - -/* - * End a conversation. - * - * This will almost certainly be changed later on!!!!!! - */ -void molch_end_conversation( - const unsigned char * const conversation_id, - unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! - size_t * const backup_length - ); - -/* - * List the conversations of a user. - * - * Returns the number of conversations and a list of conversations for a given user. - * (all the conversation ids in one big list). - * - * Don't forget to free conversation_list after use. - * - * Don't forget to destroy the return status with molch_destroy_return_status() - * if an error has occurred. - */ -return_status molch_list_conversations( - const unsigned char * const user_public_signing_key, - unsigned char ** const conversation_list, - size_t *number) __attribute__((warn_unused_result)); - -/* - * Print a return status into a nice looking error message. - * - * Don't forget to free the output after use. - */ -char *molch_print_status(return_status status, size_t * const output_length) __attribute__((warn_unused_result)); - -/* - * Get a string describing the return status type. - * - * (return_status.status) - */ -const char *molch_print_status_type(status_type type); - -/* - * Destroy a return status (only needs to be called if there was an error). - */ -void molch_destroy_return_status(return_status * const status); - -/* - * Serialize a conversation. - * - * Don't forget to free the output after use. - * - * Don't forget to destroy the return status with molch_destroy_return_status() - * if an error has occurred. - */ -return_status molch_conversation_export( - unsigned char ** const backup, - const unsigned char * const conversation_id, - size_t * const length) __attribute__((warn_unused_result)); - -/* - * Serialise molch's internal state. The output is encrypted with the backup key. - * - * Don't forget to free the output after use. - * - * Don't forget to destroy the return status with molch_destroy_return_status() - * if an error has occured. - */ -return_status molch_export( - unsigned char ** const backup, //output, free after use - size_t *length) __attribute__((warn_unused_result)); - -/* - * Import a conversation from a backup (overwrites the current one if it exists). - * - * Don't forget to destroy the return status with molch_destroy_return_status() - * if an error has occurred. - */ -return_status molch_conversation_import( - const unsigned char * const backup, - const size_t backup_length, - const unsigned char * backup_key, //BACKUP_KEY_SIZE - unsigned char * new_backup_key //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key - ) __attribute__((warn_unused_result)); - -/* - * Import molch's internal state from a backup (overwrites the current state) - * and generates a new backup key. - * - * The backup key is needed to decrypt the backup. - * - * Don't forget to destroy the return status with molch_destroy_return_status() - * if an error has occured. - */ -return_status molch_import( - unsigned char * const backup, - const size_t backup_length, - const unsigned char * const backup_key, //BACKUP_KEY_SIZE - unsigned char * const new_backup_key //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key - ) __attribute__((warn_unused_result)); - -/* - * Get a signed list of prekeys for a given user. - * - * Don't forget to destroy the return status with molch_destroy_return_status() - * if an error has occured. - */ -return_status molch_get_prekey_list( - unsigned char * const public_signing_key, - unsigned char ** const prekey_list, //output, free after use - size_t * const prekey_list_length) __attribute__((warn_unused_result)); - -/* - * Generate and return a new key for encrypting the exported library state. - * - * Don't forget to destroy the return status with molch_destroy_return_status() - * if an error has occured. - */ -return_status molch_update_backup_key(unsigned char * const new_key /*output with length of BACKUP_KEY_SIZE */) __attribute__((warn_unused_result)); -#endif +/* Molch, an implementation of the axolotl ratchet based on libsodium + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include "return-status.h" + +#ifndef LIB_MOLCH_H +#define LIB_MOLCH_H + +/* + * THIS HEADER IS ONLY AN EARLY PREVIEW. IT WILL MOST CERTAINLY CHANGE IN THE FUTURE. + */ +/* + * WARNING: ALTHOUGH THIS IMPLEMENTS THE AXOLOTL PROTOCOL, IT ISN't CONSIDERED SECURE ENOUGH TO USE AT THIS POINT + */ + +/* + * Create a new user. The user is identified by the public master key. + * + * Get's random input (can be in any format and doesn't have + * to be uniformly distributed) and uses it in combination + * with the OS's random number generator to generate a + * signing and identity keypair for the user. + * + * IMPORTANT: Don't put random numbers provided by the operating + * system in there. + * + * This also creates a signed list of prekeys to be uploaded to + * the server. + * + * A new backup key is generated that subsequent backups of the library state will be encrypted with. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occurred. + */ +return_status molch_create_user( + unsigned char *const public_master_key, //output, PUBLIC_MASTER_KEY_SIZE + unsigned char **const prekey_list, //output, needs to be freed + size_t *const prekey_list_length, + const unsigned char *const random_data, + const size_t random_data_length, + unsigned char * backup_key, //output, BACKUP_KEY_SIZE + unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! + size_t *const backup_length //optional, can be NULL + ) __attribute__((warn_unused_result)); + +/* + * Destroy a user. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occurred. + */ +return_status molch_destroy_user( + const unsigned char *const public_signing_key, + unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use + size_t *const backup_length //optional, can be NULL +); + +/* + * Get the number of users. + */ +size_t molch_user_count(); + +/* + * List all of the users (list of the public keys), + * NULL if there are no users. + * + * This list is heap allocated, so don't forget to free it. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occurred. + */ +return_status molch_user_list(unsigned char **const user_list, size_t *count); + +/* + * Delete all users. + */ +void molch_destroy_all_users(); + +typedef enum molch_message_type { PREKEY_MESSAGE, NORMAL_MESSAGE, INVALID } molch_message_type; + +/* + * Get the type of a message. + * + * This is either a normal message or a prekey message. + * Prekey messages mark the start of a new conversation. + */ +molch_message_type molch_get_message_type( + const unsigned char * const packet, + const size_t packet_length); + +/* + * Start a new conversation. (sending) + * + * The conversation can be identified by it's ID + * + * This requires a new set of prekeys from the receiver. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occurred. + */ +return_status molch_create_send_conversation( + unsigned char * const conversation_id, //output, CONVERSATION_ID_SIZE long (from conversation.h) + unsigned char ** const packet, //output, will be malloced by the function, don't forget to free it after use! + size_t *packet_length, //output + const unsigned char * const message, + const size_t message_length, + const unsigned char * const prekey_list, //prekey list of the receiver + const size_t prekey_list_length, + const unsigned char * const sender_public_signing_key, //signing key of the sender (user) + const unsigned char * const receiver_public_signing_key, //signing key of the receiver + unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! + size_t * const backup_length //optional, can be NULL + ) __attribute__((warn_unused_result)); + +/* + * Start a new conversation. (receiving) + * + * This also generates a new set of prekeys to be uploaded to the server. + * + * This function is called after receiving a prekey message. + * + * The conversation can be identified by it's ID + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occurred. + */ +return_status molch_create_receive_conversation( + unsigned char * const conversation_id, //output, CONVERSATION_ID_SIZE long (from conversation.h) + unsigned char ** const message, //output, will be malloced by the function, don't forget to free it after use! + size_t * const message_length, //output + const unsigned char * const packet, //received prekey packet + const size_t packet_length, + unsigned char ** const prekey_list, //output, free after use + size_t * const prekey_list_length, + const unsigned char * const sender_public_signing_key, //signing key of the sender + const unsigned char * const receiver_public_signing_key, //signing key of the receiver (user) + unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! + size_t * const backup_length //optional, can be NULL + ) __attribute__((warn_unused_result)); + +/* + * Encrypt a message and create a packet that can be sent to the receiver. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occurred. + */ +return_status molch_encrypt_message( + unsigned char ** const packet, //output, will be malloced by the function, don't forget to free it after use! + size_t *packet_length, //output, length of the packet + const unsigned char * const message, + const size_t message_length, + const unsigned char * const conversation_id, + unsigned char ** const backup, //optional, can be NULL, exports the conversationn, free after use, check if NULL before use! + size_t * const backup_length + ) __attribute__((warn_unused_result)); + +/* + * Decrypt a message. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occurred. + */ +return_status molch_decrypt_message( + unsigned char ** const message, //output, will be malloced by the function, don't forget to free it after use! + size_t *message_length, //output + const unsigned char * const packet, //received packet + const size_t packet_length, + const unsigned char * const conversation_id, + uint32_t * const receive_message_number, //output + uint32_t * const previous_receive_message_number, //output + unsigned char ** const backup, //optional, can be NULL, exports the conversation, free after use, check if NULL before use! + size_t * const backup_length + ) __attribute__((warn_unused_result)); + +/* + * End a conversation. + * + * This will almost certainly be changed later on!!!!!! + */ +void molch_end_conversation( + const unsigned char * const conversation_id, + unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! + size_t * const backup_length + ); + +/* + * List the conversations of a user. + * + * Returns the number of conversations and a list of conversations for a given user. + * (all the conversation ids in one big list). + * + * Don't forget to free conversation_list after use. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occurred. + */ +return_status molch_list_conversations( + const unsigned char * const user_public_signing_key, + unsigned char ** const conversation_list, + size_t *number) __attribute__((warn_unused_result)); + +/* + * Print a return status into a nice looking error message. + * + * Don't forget to free the output after use. + */ +char *molch_print_status(return_status status, size_t * const output_length) __attribute__((warn_unused_result)); + +/* + * Get a string describing the return status type. + * + * (return_status.status) + */ +const char *molch_print_status_type(status_type type); + +/* + * Destroy a return status (only needs to be called if there was an error). + */ +void molch_destroy_return_status(return_status * const status); + +/* + * Serialize a conversation. + * + * Don't forget to free the output after use. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occurred. + */ +return_status molch_conversation_export( + unsigned char ** const backup, + const unsigned char * const conversation_id, + size_t * const length) __attribute__((warn_unused_result)); + +/* + * Serialise molch's internal state. The output is encrypted with the backup key. + * + * Don't forget to free the output after use. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occured. + */ +return_status molch_export( + unsigned char ** const backup, //output, free after use + size_t *length) __attribute__((warn_unused_result)); + +/* + * Import a conversation from a backup (overwrites the current one if it exists). + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occurred. + */ +return_status molch_conversation_import( + const unsigned char * const backup, + const size_t backup_length, + const unsigned char * backup_key, //BACKUP_KEY_SIZE + unsigned char * new_backup_key //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key + ) __attribute__((warn_unused_result)); + +/* + * Import molch's internal state from a backup (overwrites the current state) + * and generates a new backup key. + * + * The backup key is needed to decrypt the backup. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occured. + */ +return_status molch_import( + unsigned char * const backup, + const size_t backup_length, + const unsigned char * const backup_key, //BACKUP_KEY_SIZE + unsigned char * const new_backup_key //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key + ) __attribute__((warn_unused_result)); + +/* + * Get a signed list of prekeys for a given user. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occured. + */ +return_status molch_get_prekey_list( + unsigned char * const public_signing_key, + unsigned char ** const prekey_list, //output, free after use + size_t * const prekey_list_length) __attribute__((warn_unused_result)); + +/* + * Generate and return a new key for encrypting the exported library state. + * + * Don't forget to destroy the return status with molch_destroy_return_status() + * if an error has occured. + */ +return_status molch_update_backup_key(unsigned char * const new_key /*output with length of BACKUP_KEY_SIZE */) __attribute__((warn_unused_result)); +#endif From 33076586e14535ea8937cd1a8990594c050294da Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Fri, 1 Jul 2016 15:54:36 +0200 Subject: [PATCH 17/53] molch_create_user: explicitly pass lengths of keys --- bindings/molch.i | 2 ++ bindings/molch.lua | 2 ++ lib/molch.c | 15 +++++++++++++++ lib/molch.h | 2 ++ test/molch-init-test.c | 2 ++ test/molch-test.c | 4 ++++ 6 files changed, 27 insertions(+) diff --git a/bindings/molch.i b/bindings/molch.i index a5f7ceb1..85ee335b 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -75,11 +75,13 @@ extern void sodium_free(void *); extern return_status molch_create_user( unsigned char *const public_master_key, + const size_t public_master_key_length, unsigned char **const prekey_list, size_t *const prekey_list_length, const unsigned char *const random_data, const size_t random_data_length, unsigned char * backup_key, + const size_t backup_key_length, unsigned char **const backup, size_t *const backup_length ); diff --git a/bindings/molch.lua b/bindings/molch.lua index ccead331..2bb4e3ca 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -152,11 +152,13 @@ function molch.user.new(random_spice --[[optional]]) local status = molch_interface.molch_create_user( raw_id, + 32, temp_prekey_list, prekey_list_length, spice_userdata, spice_userdata_length, raw_backup_key, + 32, temp_backup, backup_length ) diff --git a/lib/molch.c b/lib/molch.c index 0ca35497..a7c67594 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -131,17 +131,32 @@ return_status create_prekey_list( */ return_status molch_create_user( unsigned char *const public_master_key, //output, PUBLIC_MASTER_KEY_SIZE + const size_t public_master_key_length, unsigned char **const prekey_list, //output, needs to be freed size_t *const prekey_list_length, const unsigned char *const random_data, const size_t random_data_length, unsigned char * backup_key, //output, BACKUP_KEY_SIZE + const size_t backup_key_length, unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! size_t *const backup_length //optional, can be NULL ) { return_status status = return_status_init(); bool user_store_created = false; + if ((public_master_key == NULL) + || (prekey_list == NULL) || (prekey_list_length == NULL)) { + throw(INVALID_INPUT, "Invalid input to molch_create_user."); + } + + if (backup_key_length != BACKUP_KEY_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Backup key has incorrect length."); + } + + if (public_master_key_length != PUBLIC_MASTER_KEY_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Public master key has incorrect length."); + } + //create buffers wrapping the raw arrays buffer_create_with_existing_array(random_data_buffer, (unsigned char*)random_data, random_data_length); buffer_create_with_existing_array(public_master_key_buffer, public_master_key, PUBLIC_MASTER_KEY_SIZE); diff --git a/lib/molch.h b/lib/molch.h index 6d761eac..58c98bee 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -51,11 +51,13 @@ */ return_status molch_create_user( unsigned char *const public_master_key, //output, PUBLIC_MASTER_KEY_SIZE + const size_t public_master_key_length, unsigned char **const prekey_list, //output, needs to be freed size_t *const prekey_list_length, const unsigned char *const random_data, const size_t random_data_length, unsigned char * backup_key, //output, BACKUP_KEY_SIZE + const size_t backup_key_length, unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! size_t *const backup_length //optional, can be NULL ) __attribute__((warn_unused_result)); diff --git a/test/molch-init-test.c b/test/molch-init-test.c index 16b462b8..366f3fe1 100644 --- a/test/molch-init-test.c +++ b/test/molch-init-test.c @@ -69,11 +69,13 @@ int main(void) { size_t prekey_list_length; status = molch_create_user( user_id->content, + user_id->content_length, &prekey_list, &prekey_list_length, (unsigned char*)"random", sizeof("random"), backup_key, + BACKUP_KEY_SIZE, &backup, &backup_length); throw_on_error(CREATION_ERROR, "Failed to create user."); diff --git a/test/molch-test.c b/test/molch-test.c index b15bad82..0a3818a6 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -88,11 +88,13 @@ int main(void) { size_t complete_export_length = 0; status = molch_create_user( alice_public_identity->content, + alice_public_identity->content_length, &alice_public_prekeys, &alice_public_prekeys_length, alice_head_on_keyboard->content, alice_head_on_keyboard->content_length, new_backup_key->content, + new_backup_key->content_length, &complete_export, &complete_export_length); throw_on_error(status.status, "Failed to create Alice!"); @@ -131,11 +133,13 @@ int main(void) { buffer_create_from_string(bob_head_on_keyboard, "jnu8h77z6ht56ftgnujh"); status = molch_create_user( bob_public_identity->content, + bob_public_identity->content_length, &bob_public_prekeys, &bob_public_prekeys_length, bob_head_on_keyboard->content, bob_head_on_keyboard->content_length, backup_key->content, + backup_key->content_length, NULL, NULL); throw_on_error(status.status, "Failed to create Bob!"); From ef35bba8787c4841e7e4fa2292061400d1e229c8 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Fri, 1 Jul 2016 20:55:05 +0200 Subject: [PATCH 18/53] molch_destroy_user: explicitly pass lengths of keys --- bindings/molch.i | 3 ++- bindings/molch.lua | 1 + lib/molch.c | 11 ++++++++--- lib/molch.h | 3 ++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 85ee335b..3fb8d3dc 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -87,7 +87,8 @@ extern return_status molch_create_user( ); extern return_status molch_destroy_user( - const unsigned char *const public_signing_key, + const unsigned char *const public_master_key, + const size_t public_master_key_length, unsigned char **const backup, size_t *const backup_length ); diff --git a/bindings/molch.lua b/bindings/molch.lua index 2bb4e3ca..ec7d3db8 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -196,6 +196,7 @@ end function molch.user:destroy() local status = molch_interface.molch_destroy_user( convert_to_c_string(self.id), + #self.id, nil, nil) local status_type = molch_interface.get_status(status) diff --git a/lib/molch.c b/lib/molch.c index a7c67594..21aa3f51 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -201,7 +201,7 @@ return_status molch_create_user( cleanup: if ((status.status != SUCCESS) && user_store_created) { - return_status new_status = molch_destroy_user(public_master_key, NULL, NULL); + return_status new_status = molch_destroy_user(public_master_key, public_master_key_length, NULL, NULL); return_status_destroy_errors(&new_status); } @@ -215,7 +215,8 @@ return_status molch_create_user( * if an error has occurred. */ return_status molch_destroy_user( - const unsigned char *const public_signing_key, + const unsigned char *const public_master_key, + const size_t public_master_key_length, unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! size_t *const backup_length //optional, can be NULL ) { @@ -225,9 +226,13 @@ return_status molch_destroy_user( throw(INVALID_INPUT, "\"users\" is NULL.") } + if (public_master_key_length != PUBLIC_MASTER_KEY_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Public master key has incorrect size."); + } + //TODO maybe check beforehand if the user exists and return nonzero if not - buffer_create_with_existing_array(public_signing_key_buffer, (unsigned char*)public_signing_key, PUBLIC_KEY_SIZE); + buffer_create_with_existing_array(public_signing_key_buffer, (unsigned char*)public_master_key, PUBLIC_KEY_SIZE); status = user_store_remove_by_key(users, public_signing_key_buffer); throw_on_error(REMOVE_ERROR, "Failed to remoe user from user store by key."); diff --git a/lib/molch.h b/lib/molch.h index 58c98bee..353c2aac 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -69,7 +69,8 @@ return_status molch_create_user( * if an error has occurred. */ return_status molch_destroy_user( - const unsigned char *const public_signing_key, + const unsigned char *const public_master_key, + const size_t public_master_key_length, unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use size_t *const backup_length //optional, can be NULL ); From 1f3c4db9dc7b8014b9daac1bb7510d5e7fa5842d Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 2 Jul 2016 03:08:50 +0200 Subject: [PATCH 19/53] molch_user_list: explicitly return length of user list in bytes --- bindings/molch.i | 5 ++++- bindings/molch.lua | 7 ++++--- lib/molch.c | 10 +++++++--- lib/molch.h | 5 ++++- test/molch-test.c | 5 +++-- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 3fb8d3dc..2142528e 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -95,7 +95,10 @@ extern return_status molch_destroy_user( extern size_t molch_user_count(); -extern return_status molch_user_list(unsigned char **const user_list, size_t *count); +extern return_status molch_user_list( + unsigned char **const user_list, + size_t * const user_list_length, + size_t * count); extern void molch_destroy_all_users(); diff --git a/bindings/molch.lua b/bindings/molch.lua index ec7d3db8..6b580b6d 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -218,14 +218,15 @@ molch.user.count = molch.user_count function molch.user_list() local count = molch_interface.size_t() + local list_length = molch_interface.size_t() local raw_list = molch_interface.create_ucstring_pointer() - local status = molch_interface.molch_user_list(raw_list, count) + local status = molch_interface.molch_user_list(raw_list, list_length, count) local status_type = molch_interface.get_status(status) if status_type ~= molch_interface.SUCCESS then error(molch.print_errors(status)) end - local raw_list = copy_callee_allocated_string(raw_list, count:value() * 32) - local lua_raw_list = convert_to_lua_string(raw_list, count:value() * 32) + local raw_list = copy_callee_allocated_string(raw_list, list_length) + local lua_raw_list = convert_to_lua_string(raw_list, list_length) local list = {} for i = 0, count:value() - 1 do diff --git a/lib/molch.c b/lib/molch.c index 21aa3f51..7410dfc3 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -280,11 +280,14 @@ void molch_destroy_all_users() { * Don't forget to destroy the return status with return_status_destroy_errors() * if an error has occurred. */ -return_status molch_user_list(unsigned char **const user_list, size_t *count) { +return_status molch_user_list( + unsigned char **const user_list, + size_t * const user_list_length, //length in bytes + size_t * const count) { return_status status = return_status_init(); - if (users == NULL) { - throw(INVALID_INPUT, "\"users\" is NULL."); + if ((users == NULL) || (user_list_length == NULL)) { + throw(INVALID_INPUT, "Invalid input to molch_user_list."); } //get the list of users and copy it @@ -295,6 +298,7 @@ return_status molch_user_list(unsigned char **const user_list, size_t *count) { *count = molch_user_count(); *user_list = user_list_buffer->content; + *user_list_length = user_list_buffer->content_length; free(user_list_buffer); //free the buffer_t struct while leaving content intact cleanup: diff --git a/lib/molch.h b/lib/molch.h index 353c2aac..3d60969f 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -89,7 +89,10 @@ size_t molch_user_count(); * Don't forget to destroy the return status with molch_destroy_return_status() * if an error has occurred. */ -return_status molch_user_list(unsigned char **const user_list, size_t *count); +return_status molch_user_list( + unsigned char **const user_list, + size_t * const user_list_length, //length in bytes + size_t *count); /* * Delete all users. diff --git a/test/molch-test.c b/test/molch-test.c index 0a3818a6..f4092925 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -154,9 +154,10 @@ int main(void) { } //check user list - size_t user_count; + size_t user_count = 0; + size_t user_list_length = 0; unsigned char *user_list = NULL; - status = molch_user_list(&user_list, &user_count); + status = molch_user_list(&user_list, &user_list_length, &user_count); throw_on_error(CREATION_ERROR, "Failed to list users."); if ((user_count != 2) || (sodium_memcmp(alice_public_identity->content, user_list, alice_public_identity->content_length) != 0) From 3dae1325826f0cca05b62656390cba52dbef0d68 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 2 Jul 2016 04:00:16 +0200 Subject: [PATCH 20/53] molch_create_send_conversation: explicitly pass lengths of keys --- bindings/molch.i | 7 +++++-- bindings/molch.lua | 3 +++ lib/molch.c | 31 +++++++++++++++++++++++-------- lib/molch.h | 7 +++++-- test/molch-test.c | 3 +++ 5 files changed, 39 insertions(+), 12 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 2142528e..8a409d60 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -110,14 +110,17 @@ extern molch_message_type molch_get_message_type( extern return_status molch_create_send_conversation( unsigned char * const conversation_id, + const size_t conversation_id_length, unsigned char ** const packet, size_t *packet_length, const unsigned char * const message, const size_t message_length, const unsigned char * const prekey_list, const size_t prekey_list_length, - const unsigned char * const sender_public_signing_key, - const unsigned char * const receiver_public_signing_key, + const unsigned char * const sender_public_master_key, + const size_t sender_public_master_key_length, + const unsigned char * const receiver_public_master_key, + const size_t receiver_public_master_key_length, unsigned char ** const backup, size_t * const backup_length ); diff --git a/bindings/molch.lua b/bindings/molch.lua index 6b580b6d..40569570 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -402,6 +402,7 @@ function molch.user:create_send_conversation(message, prekey_list, receiver_id) local status = molch_interface.molch_create_send_conversation( raw_conversation_id, + molch_interface.CONVERSATION_ID_SIZE, raw_packet, raw_packet_length, raw_message, @@ -409,7 +410,9 @@ function molch.user:create_send_conversation(message, prekey_list, receiver_id) raw_prekey_list, raw_prekey_list_length, convert_to_c_string(self.id), + #self.id, convert_to_c_string(receiver_id), + #receiver_id, raw_backup, raw_backup_length) local status_type = molch_interface.get_status(status) diff --git a/lib/molch.c b/lib/molch.c index 7410dfc3..66df05dd 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -418,22 +418,25 @@ return_status verify_prekey_list( */ return_status molch_create_send_conversation( unsigned char *const conversation_id, //output, CONVERSATION_ID_SIZE long (from conversation.h) + const size_t conversation_id_length, unsigned char **const packet, //output, will be malloced by the function, don't forget to free it after use! size_t *packet_length, //output const unsigned char *const message, const size_t message_length, const unsigned char *const prekey_list, //prekey list of the receiver (PREKEY_AMOUNT * PUBLIC_KEY_SIZE) const size_t prekey_list_length, - const unsigned char *const sender_public_signing_key, //signing key of the sender (user) - const unsigned char *const receiver_public_signing_key, //signing key of the receiver + const unsigned char *const sender_public_master_key, //signing key of the sender (user) + const size_t sender_public_master_key_length, + const unsigned char *const receiver_public_master_key, //signing key of the receiver + const size_t receiver_public_master_key_length, unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! size_t *const backup_length //optional, can be NULL ) { //create buffers wrapping the raw input buffer_create_with_existing_array(conversation_id_buffer, (unsigned char*)conversation_id, CONVERSATION_ID_SIZE); buffer_create_with_existing_array(message_buffer, (unsigned char*)message, message_length); - buffer_create_with_existing_array(sender_public_signing_key_buffer, (unsigned char*)sender_public_signing_key, PUBLIC_MASTER_KEY_SIZE); - buffer_create_with_existing_array(receiver_public_signing_key_buffer, (unsigned char*)receiver_public_signing_key, PUBLIC_MASTER_KEY_SIZE); + buffer_create_with_existing_array(sender_public_master_key_buffer, (unsigned char*)sender_public_master_key, PUBLIC_MASTER_KEY_SIZE); + buffer_create_with_existing_array(receiver_public_master_key_buffer, (unsigned char*)receiver_public_master_key, PUBLIC_MASTER_KEY_SIZE); buffer_create_with_existing_array(prekeys, (unsigned char*)prekey_list + PUBLIC_KEY_SIZE + SIGNATURE_SIZE, prekey_list_length - PUBLIC_KEY_SIZE - SIGNATURE_SIZE - sizeof(int64_t)); //create buffers @@ -452,13 +455,25 @@ return_status molch_create_send_conversation( || (packet == NULL) || (packet_length == NULL) || (prekey_list == NULL) - || (sender_public_signing_key == NULL) - || (receiver_public_signing_key == NULL)) { + || (sender_public_master_key == NULL) + || (receiver_public_master_key == NULL)) { throw(INVALID_INPUT, "Invalid input to molch_create_send_conversation."); } + if (conversation_id_length != CONVERSATION_ID_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "conversation id has incorrect size."); + } + + if (sender_public_master_key_length != PUBLIC_MASTER_KEY_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "sender public master key has incorrect size."); + } + + if (receiver_public_master_key_length != PUBLIC_MASTER_KEY_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "receiver public master key has incorrect size."); + } + //get the user that matches the public signing key of the sender - status = user_store_find_node(&user, users, sender_public_signing_key_buffer); + status = user_store_find_node(&user, users, sender_public_master_key_buffer); throw_on_error(NOT_FOUND, "User not found."); int status_int = 0; @@ -468,7 +483,7 @@ return_status molch_create_send_conversation( prekey_list, prekey_list_length, receiver_public_identity, - receiver_public_signing_key_buffer); + receiver_public_master_key_buffer); throw_on_error(VERIFICATION_FAILED, "Failed to verify prekey list."); //unlock the master keys diff --git a/lib/molch.h b/lib/molch.h index 3d60969f..d4ed3f01 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -123,14 +123,17 @@ molch_message_type molch_get_message_type( */ return_status molch_create_send_conversation( unsigned char * const conversation_id, //output, CONVERSATION_ID_SIZE long (from conversation.h) + const size_t conversation_id_length, unsigned char ** const packet, //output, will be malloced by the function, don't forget to free it after use! size_t *packet_length, //output const unsigned char * const message, const size_t message_length, const unsigned char * const prekey_list, //prekey list of the receiver const size_t prekey_list_length, - const unsigned char * const sender_public_signing_key, //signing key of the sender (user) - const unsigned char * const receiver_public_signing_key, //signing key of the receiver + const unsigned char * const sender_public_master_key, //signing key of the sender (user) + const size_t sender_public_master_key_length, + const unsigned char * const receiver_public_master_key, //signing key of the receiver + const size_t receiver_public_master_key_length, unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! size_t * const backup_length //optional, can be NULL ) __attribute__((warn_unused_result)); diff --git a/test/molch-test.c b/test/molch-test.c index f4092925..7d3f0eef 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -172,6 +172,7 @@ int main(void) { size_t alice_send_packet_length; status = molch_create_send_conversation( alice_conversation->content, + alice_conversation->content_length, &alice_send_packet, &alice_send_packet_length, alice_send_message->content, @@ -179,7 +180,9 @@ int main(void) { bob_public_prekeys, bob_public_prekeys_length, alice_public_identity->content, + alice_public_identity->content_length, bob_public_identity->content, + bob_public_identity->content_length, NULL, NULL); throw_on_error(CREATION_ERROR, "Failed to start send conversation."); From 184ac326eb87c9b9271c399a250ffe70cba3c056 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 2 Jul 2016 14:58:09 +0200 Subject: [PATCH 21/53] molch_create_receive_conversation: explicitly pass lengths of keys --- bindings/molch.i | 7 +++++-- bindings/molch.lua | 3 +++ lib/molch.c | 36 ++++++++++++++++++++++++++++++------ lib/molch.h | 7 +++++-- test/molch-test.c | 3 +++ 5 files changed, 46 insertions(+), 10 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 8a409d60..34ae4599 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -127,14 +127,17 @@ extern return_status molch_create_send_conversation( extern return_status molch_create_receive_conversation( unsigned char * const conversation_id, + const size_t conversation_id_length, unsigned char ** const message, size_t * const message_length, const unsigned char * const packet, const size_t packet_length, unsigned char ** const prekey_list, size_t * const prekey_list_length, - const unsigned char * const sender_public_signing_key, - const unsigned char * const receiver_public_signing_key, + const unsigned char * const sender_public_master_key, + const size_t sender_public_master_key_length, + const unsigned char * const receiver_public_master_key, + const size_t receiver_public_master_key_length, unsigned char ** const backup, size_t * const backup_length ); diff --git a/bindings/molch.lua b/bindings/molch.lua index 40569570..7a20daad 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -457,6 +457,7 @@ function molch.user:create_receive_conversation(packet, sender_id) local status = molch_interface.molch_create_receive_conversation( raw_conversation_id, + molch_interface.CONVERSATION_ID_SIZE, raw_message, raw_message_length, raw_packet, @@ -464,7 +465,9 @@ function molch.user:create_receive_conversation(packet, sender_id) raw_prekey_list, raw_prekey_list_length, convert_to_c_string(sender_id), + #sender_id, convert_to_c_string(self.id), + #self.id, raw_backup, raw_backup_length) local status_type = molch_interface.get_status(status) diff --git a/lib/molch.c b/lib/molch.c index 66df05dd..dd37fa0f 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -560,14 +560,17 @@ return_status molch_create_send_conversation( */ return_status molch_create_receive_conversation( unsigned char * const conversation_id, //output, CONVERSATION_ID_SIZE long (from conversation.h) + const size_t conversation_id_length, unsigned char ** const message, //output, will be malloced by the function, don't forget to free it after use! size_t * const message_length, //output const unsigned char * const packet, //received prekey packet const size_t packet_length, unsigned char ** const prekey_list, //output, free after use size_t * const prekey_list_length, - const unsigned char * const sender_public_signing_key, //signing key of the sender - const unsigned char * const receiver_public_signing_key, //signing key of the receiver (user) + const unsigned char * const sender_public_master_key, //signing key of the sender + const size_t sender_public_master_key_length, + const unsigned char * const receiver_public_master_key, //signing key of the receiver (user) + const size_t receiver_public_master_key_length, unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! size_t * const backup_length //optional, can be NULL ) { @@ -577,15 +580,36 @@ return_status molch_create_receive_conversation( //create buffers to wrap the raw arrays buffer_create_with_existing_array(conversation_id_buffer, (unsigned char*)conversation_id, CONVERSATION_ID_SIZE); buffer_create_with_existing_array(packet_buffer, (unsigned char*)packet, packet_length); - buffer_create_with_existing_array(sender_public_signing_key_buffer, (unsigned char*) sender_public_signing_key, PUBLIC_MASTER_KEY_SIZE); - buffer_create_with_existing_array(receiver_public_signing_key_buffer, (unsigned char*)receiver_public_signing_key, PUBLIC_MASTER_KEY_SIZE); + buffer_create_with_existing_array(sender_public_master_key_buffer, (unsigned char*) sender_public_master_key, PUBLIC_MASTER_KEY_SIZE); + buffer_create_with_existing_array(receiver_public_master_key_buffer, (unsigned char*)receiver_public_master_key, PUBLIC_MASTER_KEY_SIZE); conversation_t *conversation = NULL; buffer_t *message_buffer = NULL; user_store_node *user = NULL; + if ((conversation_id == NULL) + || (message == NULL) || (message_length == NULL) + || (packet == NULL) + || (prekey_list == NULL) || (prekey_list_length == NULL) + || (sender_public_master_key == NULL) + || (receiver_public_master_key == NULL)) { + throw(INVALID_INPUT, "Invalid input to molch_create_receive_conversation."); + } + + if (conversation_id_length != CONVERSATION_ID_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Conversation ID has an incorrect size."); + } + + if (sender_public_master_key_length != PUBLIC_MASTER_KEY_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Senders public master key has an incorrect size."); + } + + if (receiver_public_master_key_length != PUBLIC_MASTER_KEY_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Receivers public master key has an incorrect size."); + } + //get the user that matches the public signing key of the receiver - status = user_store_find_node(&user, users, receiver_public_signing_key_buffer); + status = user_store_find_node(&user, users, receiver_public_master_key_buffer); throw_on_error(NOT_FOUND, "User not found in the user store."); //unlock the master keys @@ -611,7 +635,7 @@ return_status molch_create_receive_conversation( //create the prekey list status = create_prekey_list( - receiver_public_signing_key_buffer, + receiver_public_master_key_buffer, prekey_list, prekey_list_length); throw_on_error(CREATION_ERROR, "Failed to create prekey list."); diff --git a/lib/molch.h b/lib/molch.h index d4ed3f01..fe2d825d 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -152,14 +152,17 @@ return_status molch_create_send_conversation( */ return_status molch_create_receive_conversation( unsigned char * const conversation_id, //output, CONVERSATION_ID_SIZE long (from conversation.h) + const size_t conversation_id_length, unsigned char ** const message, //output, will be malloced by the function, don't forget to free it after use! size_t * const message_length, //output const unsigned char * const packet, //received prekey packet const size_t packet_length, unsigned char ** const prekey_list, //output, free after use size_t * const prekey_list_length, - const unsigned char * const sender_public_signing_key, //signing key of the sender - const unsigned char * const receiver_public_signing_key, //signing key of the receiver (user) + const unsigned char * const sender_public_master_key, //signing key of the sender + const size_t sender_public_master_key_length, + const unsigned char * const receiver_public_master_key, //signing key of the receiver (user) + const size_t receiver_public_master_key_length, unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! size_t * const backup_length //optional, can be NULL ) __attribute__((warn_unused_result)); diff --git a/test/molch-test.c b/test/molch-test.c index 7d3f0eef..e626f790 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -224,6 +224,7 @@ int main(void) { size_t bob_receive_message_length; status = molch_create_receive_conversation( bob_conversation->content, + bob_conversation->content_length, &bob_receive_message, &bob_receive_message_length, alice_send_packet, @@ -231,7 +232,9 @@ int main(void) { &bob_public_prekeys, &bob_public_prekeys_length, alice_public_identity->content, + alice_public_identity->content_length, bob_public_identity->content, + bob_public_identity->content_length, NULL, NULL); throw_on_error(CREATION_ERROR, "Failed to start receive conversation."); From 7fe223cdfc1ab720d16a971f74e7e0fce090d98c Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 2 Jul 2016 15:15:38 +0200 Subject: [PATCH 22/53] molch_encrypt_message: explicitly pass length of the conversation id --- bindings/molch.i | 1 + bindings/molch.lua | 1 + lib/molch.c | 11 +++++++++++ lib/molch.h | 1 + test/molch-test.c | 1 + 5 files changed, 15 insertions(+) diff --git a/bindings/molch.i b/bindings/molch.i index 34ae4599..3e4cbcbe 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -148,6 +148,7 @@ extern return_status molch_encrypt_message( const unsigned char * const message, const size_t message_length, const unsigned char * const conversation_id, + const size_t conversation_id_length, unsigned char ** const backup, size_t * const backup_length ); diff --git a/bindings/molch.lua b/bindings/molch.lua index 7a20daad..a431ee85 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -534,6 +534,7 @@ function molch.conversation:encrypt_message(message) raw_message, raw_message_length, convert_to_c_string(self.id), + #self.id, raw_backup, raw_backup_length) local status_type = molch_interface.get_status(status) diff --git a/lib/molch.c b/lib/molch.c index dd37fa0f..c588c292 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -742,6 +742,7 @@ return_status molch_encrypt_message( const unsigned char * const message, const size_t message_length, const unsigned char * const conversation_id, + const size_t conversation_id_length, unsigned char ** const backup, //optional, can be NULL, exports the conversation, free after use, check if NULL before use! size_t * const backup_length //optional, can be NULL ) { @@ -754,6 +755,16 @@ return_status molch_encrypt_message( return_status status = return_status_init(); + if ((packet == NULL) || (packet_length == NULL) + || (message == NULL) + || (conversation_id == NULL)) { + throw(INVALID_INPUT, "Invalid input to molch_encrypt_message."); + } + + if (conversation_id_length != CONVERSATION_ID_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Conversation ID has an incorrect size."); + } + //find the conversation status = find_conversation(&conversation, conversation_id, NULL); throw_on_error(GENERIC_ERROR, "Error while searching for conversation."); diff --git a/lib/molch.h b/lib/molch.h index fe2d825d..b81c83de 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -179,6 +179,7 @@ return_status molch_encrypt_message( const unsigned char * const message, const size_t message_length, const unsigned char * const conversation_id, + const size_t conversation_id_length, unsigned char ** const backup, //optional, can be NULL, exports the conversationn, free after use, check if NULL before use! size_t * const backup_length ) __attribute__((warn_unused_result)); diff --git a/test/molch-test.c b/test/molch-test.c index e626f790..d08e7a25 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -260,6 +260,7 @@ int main(void) { bob_send_message->content, bob_send_message->content_length, bob_conversation->content, + bob_conversation->content_length, &conversation_json_export, &conversation_json_export_length); throw_on_error(GENERIC_ERROR, "Couldn't send bobs message."); From 9a7b19a14f67e95bd9ff91774393eb7cc7752873 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 2 Jul 2016 16:17:23 +0200 Subject: [PATCH 23/53] molch_decrypt_message: explicitly pass length of conversation id --- bindings/molch.i | 1 + bindings/molch.lua | 1 + lib/molch.c | 14 ++++++++++++++ lib/molch.h | 1 + test/molch-test.c | 9 +++++++-- 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 3e4cbcbe..c57b2325 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -159,6 +159,7 @@ extern return_status molch_decrypt_message( const unsigned char * const packet, const size_t packet_length, const unsigned char * const conversation_id, + const size_t conversation_id_length, uint32_t * const receive_message_number, uint32_t * const previous_receive_message_number, unsigned char ** const backup, diff --git a/bindings/molch.lua b/bindings/molch.lua index a431ee85..66a1740c 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -568,6 +568,7 @@ function molch.conversation:decrypt_message(packet) raw_packet, raw_packet_length, convert_to_c_string(self.id), + #self.id, raw_receive_message_number, raw_previous_receive_message_number, raw_backup, diff --git a/lib/molch.c b/lib/molch.c index c588c292..49ae3640 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -819,6 +819,7 @@ return_status molch_decrypt_message( const unsigned char * const packet, //received packet const size_t packet_length, const unsigned char * const conversation_id, + const size_t conversation_id_length, uint32_t * const receive_message_number, //output uint32_t * const previous_receive_message_number, //output unsigned char ** const backup, //optional, can be NULL, exports the conversation, free after use, check if NULL before use! @@ -832,6 +833,19 @@ return_status molch_decrypt_message( buffer_t *message_buffer = NULL; conversation_t *conversation = NULL; + if ((message == NULL) || (message_length == NULL) + || (packet == NULL) + || (conversation_id == NULL) + || (receive_message_number == NULL) + || (previous_receive_message_number == NULL)) { + printf("HERE\n"); + throw(INVALID_INPUT, "Invalid input to molch_decrypt_message."); + } + + if (conversation_id_length != CONVERSATION_ID_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Conversation ID has an incorrect size."); + } + //find the conversation status = find_conversation(&conversation, conversation_id, NULL); throw_on_error(GENERIC_ERROR, "Error while searching for conversation."); diff --git a/lib/molch.h b/lib/molch.h index b81c83de..f5974b26 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -196,6 +196,7 @@ return_status molch_decrypt_message( const unsigned char * const packet, //received packet const size_t packet_length, const unsigned char * const conversation_id, + const size_t conversation_id_length, uint32_t * const receive_message_number, //output uint32_t * const previous_receive_message_number, //output unsigned char ** const backup, //optional, can be NULL, exports the conversation, free after use, check if NULL before use! diff --git a/test/molch-test.c b/test/molch-test.c index d08e7a25..92094733 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -276,22 +276,27 @@ int main(void) { } //alice receives reply - unsigned char *alice_receive_message; + unsigned char *alice_receive_message = NULL; size_t alice_receive_message_length; + printf("BEFORE molch_decrypt_message\n"); status = molch_decrypt_message( &alice_receive_message, &alice_receive_message_length, bob_send_packet, bob_send_packet_length, alice_conversation->content, + alice_conversation->content_length, &alice_receive_message_number, &alice_previous_receive_message_number, NULL, NULL); on_error( - free(alice_receive_message); + if (alice_receive_message != NULL) { + free(alice_receive_message); + } throw(GENERIC_ERROR, "Incorrect message received."); ) + printf("AFTER molch_decrypt_message\n"); if ((alice_receive_message_number != 0) || (alice_previous_receive_message_number != 0)) { free(alice_receive_message); From acd1a0f5318f4ce654d37167bdb3ba35e0f5a185 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 2 Jul 2016 16:27:39 +0200 Subject: [PATCH 24/53] molch_end_conversation: explicitly pass length of the conversation id --- bindings/molch.i | 1 + bindings/molch.lua | 1 + lib/molch.c | 25 ++++++++++++++++++------- lib/molch.h | 1 + test/molch-test.c | 4 ++-- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index c57b2325..f4d3e67e 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -168,6 +168,7 @@ extern return_status molch_decrypt_message( extern void molch_end_conversation( const unsigned char * const conversation_id, + const size_t conversation_id_length, unsigned char ** const backup, size_t * const backup_length ); diff --git a/bindings/molch.lua b/bindings/molch.lua index 66a1740c..8757a4ae 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -605,6 +605,7 @@ function molch.conversation:destroy() molch_interface.molch_end_conversation( convert_to_c_string(self.id), + #self.id, raw_backup, raw_backup_length) diff --git a/lib/molch.c b/lib/molch.c index 49ae3640..e6040a75 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -893,18 +893,25 @@ return_status molch_decrypt_message( */ void molch_end_conversation( const unsigned char * const conversation_id, + const size_t conversation_id_length, unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! size_t * const backup_length ) { return_status status = return_status_init(); + if (conversation_id == NULL) { + throw(INVALID_INPUT, "Invalid input to molch_end_conversation."); + } + + if (conversation_id_length != CONVERSATION_ID_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Conversation ID has an incorrect length."); + } + //find the conversation conversation_t *conversation = NULL; status = find_conversation(&conversation, conversation_id, NULL); - on_error( - return_status_destroy_errors(&status); - return; - ); + throw_on_error(NOT_FOUND, "Couldn't find converstion."); + if (conversation == NULL) { return; } @@ -925,9 +932,13 @@ void molch_end_conversation( if (status.status != SUCCESS) { *backup = NULL; } - return_status_destroy_errors(&status); } } + +cleanup: + return_status_destroy_errors(&status); + + return; } /* @@ -1242,11 +1253,11 @@ return_status molch_conversation_json_import(const unsigned char * const json, c conversation_t *old_conversation = NULL; status = find_conversation(&old_conversation, conversation_id->content, &store); on_error( - molch_end_conversation(conversation_id->content, NULL, NULL); + molch_end_conversation(conversation_id->content, conversation_id->content_length, NULL, NULL); throw(GENERIC_ERROR, "Error while searching for conversation."); ); if (old_conversation != NULL) { //destroy the old one if it exists - molch_end_conversation(conversation_id->content, NULL, NULL); + molch_end_conversation(conversation_id->content, conversation_id->content_length, NULL, NULL); } if (store == NULL) { diff --git a/lib/molch.h b/lib/molch.h index f5974b26..a2707cb9 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -210,6 +210,7 @@ return_status molch_decrypt_message( */ void molch_end_conversation( const unsigned char * const conversation_id, + const size_t conversation_id_length, unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! size_t * const backup_length ); diff --git a/test/molch-test.c b/test/molch-test.c index 92094733..2eb3fc5b 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -441,8 +441,8 @@ int main(void) { free(backup); //destroy the conversations - molch_end_conversation(alice_conversation->content, NULL, NULL); - molch_end_conversation(bob_conversation->content, NULL, NULL); + molch_end_conversation(alice_conversation->content, alice_conversation->content_length, NULL, NULL); + molch_end_conversation(bob_conversation->content, bob_conversation->content_length, NULL, NULL); //destroy the users again molch_destroy_all_users(); From e21e4a95e501541b2be3e7f2932814b21990b6ce Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 2 Jul 2016 16:40:18 +0200 Subject: [PATCH 25/53] molch_list_conversations: explicitly pass length of master key and return list length --- bindings/molch.i | 6 ++++-- bindings/molch.lua | 7 ++++--- lib/molch.c | 17 ++++++++++++----- lib/molch.h | 6 ++++-- test/molch-test.c | 5 +++-- 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index f4d3e67e..93e480e8 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -174,9 +174,11 @@ extern void molch_end_conversation( ); extern return_status molch_list_conversations( - const unsigned char * const user_public_signing_key, + const unsigned char * const user_public_master_key, + const size_t user_public_master_key_length, unsigned char ** const conversation_list, - size_t *number); + size_t * const conversation_list_length, + size_t * const number); extern char *molch_print_status(return_status status, size_t * const output_length); diff --git a/bindings/molch.lua b/bindings/molch.lua index 8757a4ae..66a9eb69 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -292,8 +292,9 @@ end function molch.user:list_conversations() local count = molch_interface.size_t() + local raw_list_length = molch_interface.size_t() local raw_list = molch_interface.create_ucstring_pointer() - local status = molch_interface.molch_list_conversations(convert_to_c_string(self.id), raw_list, count) + local status = molch_interface.molch_list_conversations(convert_to_c_string(self.id), #self.id, raw_list, raw_list_length, count) local status_type = molch_interface.get_status(status) if status_type ~= molch_interface.SUCCESS then error(molch.print_errors(status)) @@ -301,8 +302,8 @@ function molch.user:list_conversations() if count:value() == 0 then return {} end - raw_list = copy_callee_allocated_string(raw_list, count:value() * molch_interface.CONVERSATION_ID_SIZE) - local lua_raw_list = convert_to_lua_string(raw_list, count:value() * molch_interface.CONVERSATION_ID_SIZE) + raw_list = copy_callee_allocated_string(raw_list, raw_list_length:value()) + local lua_raw_list = convert_to_lua_string(raw_list, raw_list_length:value()) local list = {} for i = 0, count:value() - 1 do diff --git a/lib/molch.c b/lib/molch.c index e6040a75..80e53016 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -953,22 +953,28 @@ void molch_end_conversation( * if an error has occurred. */ return_status molch_list_conversations( - const unsigned char * const user_public_identity, + const unsigned char * const user_public_master_key, + const size_t user_public_master_key_length, unsigned char ** const conversation_list, - size_t *number) { - buffer_create_with_existing_array(user_public_identity_buffer, (unsigned char*)user_public_identity, PUBLIC_KEY_SIZE); + size_t * const conversation_list_length, + size_t * const number) { + buffer_create_with_existing_array(user_public_master_key_buffer, (unsigned char*)user_public_master_key, PUBLIC_KEY_SIZE); buffer_t *conversation_list_buffer = NULL; return_status status = return_status_init(); - if ((user_public_identity == NULL) || (conversation_list == NULL) || (number == NULL)) { + if ((user_public_master_key == NULL) || (conversation_list == NULL) || (conversation_list_length == NULL) || (number == NULL)) { throw(INVALID_INPUT, "Invalid input to molch_list_conversations."); } + if (user_public_master_key_length != PUBLIC_MASTER_KEY_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Public master key has an incorrect length."); + } + *conversation_list = NULL; user_store_node *user = NULL; - status = user_store_find_node(&user, users, user_public_identity_buffer); + status = user_store_find_node(&user, users, user_public_master_key_buffer); throw_on_error(NOT_FOUND, "No user found for the given public identity.") status = conversation_store_list(&conversation_list_buffer, user->conversations); @@ -988,6 +994,7 @@ return_status molch_list_conversations( *number = conversation_list_buffer->content_length / CONVERSATION_ID_SIZE; *conversation_list = conversation_list_buffer->content; + *conversation_list_length = conversation_list_buffer->content_length; free(conversation_list_buffer); //free buffer_t struct conversation_list_buffer = NULL; diff --git a/lib/molch.h b/lib/molch.h index a2707cb9..70a83a1b 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -227,9 +227,11 @@ void molch_end_conversation( * if an error has occurred. */ return_status molch_list_conversations( - const unsigned char * const user_public_signing_key, + const unsigned char * const user_public_master_key, + const size_t user_public_master_key_length, unsigned char ** const conversation_list, - size_t *number) __attribute__((warn_unused_result)); + size_t * const conversation_list_length, + size_t * const number) __attribute__((warn_unused_result)); /* * Print a return status into a nice looking error message. diff --git a/test/molch-test.c b/test/molch-test.c index 2eb3fc5b..b07655b3 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -188,9 +188,10 @@ int main(void) { throw_on_error(CREATION_ERROR, "Failed to start send conversation."); //check conversation export - size_t number_of_conversations; + size_t number_of_conversations = 0;; + size_t conversation_list_length = 0; unsigned char *conversation_list = NULL; - status = molch_list_conversations(alice_public_identity->content, &conversation_list, &number_of_conversations); + status = molch_list_conversations(alice_public_identity->content, alice_public_identity->content_length, &conversation_list, &conversation_list_length, &number_of_conversations); throw_on_error(GENERIC_ERROR, "Failed to list conversations."); if ((number_of_conversations != 1) || (buffer_compare_to_raw(alice_conversation, conversation_list, alice_conversation->content_length) != 0)) { free(conversation_list); From 0421c55f1496d4c95af7445f2858ca7cd3a9a568 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 2 Jul 2016 16:52:43 +0200 Subject: [PATCH 26/53] molch_conversation_export: explicitly pass length of the conversation id --- bindings/molch.i | 3 ++- lib/molch.c | 15 ++++++++++----- lib/molch.h | 3 ++- test/molch-test.c | 12 ++++++++++-- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 93e480e8..9e1786a3 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -188,8 +188,9 @@ extern void molch_destroy_return_status(return_status * const status); extern return_status molch_conversation_export( unsigned char ** const backup, + size_t * const backup_length, const unsigned char * const conversation_id, - size_t * const length); + const size_t conversation_id_length); extern return_status molch_export(unsigned char ** const backup, size_t *length); diff --git a/lib/molch.c b/lib/molch.c index 80e53016..9691d749 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -788,7 +788,7 @@ return_status molch_encrypt_message( if (backup_length == 0) { *backup = NULL; } else { - status = molch_conversation_export(backup, conversation->id->content, backup_length); + status = molch_conversation_export(backup, backup_length, conversation->id->content, conversation->id->content_length); throw_on_error(EXPORT_ERROR, "Failed to export conversation as JSON."); } } @@ -868,7 +868,7 @@ return_status molch_decrypt_message( if (backup_length == 0) { *backup = NULL; } else { - status = molch_conversation_export(backup, conversation->id->content, backup_length); + status = molch_conversation_export(backup, backup_length, conversation->id->content, conversation->id->content_length); throw_on_error(EXPORT_ERROR, "Failed to export conversation as JSON."); } } @@ -1126,8 +1126,9 @@ return_status molch_conversation_json_export( */ return_status molch_conversation_export( unsigned char ** const backup, + size_t * const backup_length, const unsigned char * const conversation_id, - size_t * const length) { + const size_t conversation_id_length) { //FIXME: Less duplication return_status status = return_status_init(); @@ -1138,10 +1139,14 @@ return_status molch_conversation_export( buffer_t *backup_buffer = NULL; buffer_t *backup_nonce = buffer_create_on_heap(BACKUP_NONCE_SIZE, 0); - if ((backup == NULL) || (length == NULL) || (conversation_id == NULL)) { + if ((backup == NULL) || (backup_length == NULL) || (conversation_id == NULL)) { throw(INVALID_INPUT, "Invalid input to molch_conversation_export."); } + if (conversation_id_length != CONVERSATION_ID_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Conversation ID has an incorrect length."); + } + if ((backup_key == NULL) || (backup_key->content_length == 0)) { throw(INCORRECT_DATA, "No backup key found."); } @@ -1182,7 +1187,7 @@ return_status molch_conversation_export( } *backup = backup_buffer->content; - *length = backup_buffer->content_length; + *backup_length = backup_buffer->content_length; free(backup_buffer); diff --git a/lib/molch.h b/lib/molch.h index 70a83a1b..587f32d2 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -262,8 +262,9 @@ void molch_destroy_return_status(return_status * const status); */ return_status molch_conversation_export( unsigned char ** const backup, + size_t * const backup_length, const unsigned char * const conversation_id, - size_t * const length) __attribute__((warn_unused_result)); + const size_t conversation_id_length) __attribute__((warn_unused_result)); /* * Serialise molch's internal state. The output is encrypted with the backup key. diff --git a/test/molch-test.c b/test/molch-test.c index b07655b3..0675e206 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -382,7 +382,11 @@ int main(void) { free(imported_backup); //test conversation export - status = molch_conversation_export(&backup, alice_conversation->content, &backup_length); + status = molch_conversation_export( + &backup, + &backup_length, + alice_conversation->content, + alice_conversation->content_length); throw_on_error(EXPORT_ERROR, "Failed to export Alice' conversation."); printf("Alice' conversation exported!"); @@ -413,7 +417,11 @@ int main(void) { //export again - status = molch_conversation_export(&imported_backup, alice_conversation->content, &imported_backup_length); + status = molch_conversation_export( + &imported_backup, + &imported_backup_length, + alice_conversation->content, + alice_conversation->content_length); on_error( free(backup); throw(EXPORT_ERROR, "Failed to export Alice imported conversation."); From 6050e53c01d4b833123c99f0cd799bed85024c75 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 2 Jul 2016 16:55:05 +0200 Subject: [PATCH 27/53] molch_export: rename 'length' -> 'backup_length' --- bindings/molch.i | 2 +- lib/molch.c | 6 +++--- lib/molch.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 9e1786a3..b719428f 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -192,7 +192,7 @@ extern return_status molch_conversation_export( const unsigned char * const conversation_id, const size_t conversation_id_length); -extern return_status molch_export(unsigned char ** const backup, size_t *length); +extern return_status molch_export(unsigned char ** const backup, size_t *backup_length); extern return_status molch_conversation_import( const unsigned char * const backup, diff --git a/lib/molch.c b/lib/molch.c index 9691d749..e7aa4deb 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -1438,7 +1438,7 @@ return_status molch_json_export( */ return_status molch_export( unsigned char ** const backup, //output, free after use - size_t *length) { + size_t *backup_length) { return_status status = return_status_init(); unsigned char *json = NULL; @@ -1448,7 +1448,7 @@ return_status molch_export( buffer_t *backup_buffer = NULL; buffer_t *backup_nonce = buffer_create_on_heap(BACKUP_NONCE_SIZE, 0); - if ((backup == NULL) || (length == NULL)) { + if ((backup == NULL) || (backup_length == NULL)) { throw(INVALID_INPUT, "Invalid input to molch_export."); } @@ -1492,7 +1492,7 @@ return_status molch_export( } *backup = backup_buffer->content; - *length = backup_buffer->content_length; + *backup_length = backup_buffer->content_length; free(backup_buffer); diff --git a/lib/molch.h b/lib/molch.h index 587f32d2..65f970d2 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -276,7 +276,7 @@ return_status molch_conversation_export( */ return_status molch_export( unsigned char ** const backup, //output, free after use - size_t *length) __attribute__((warn_unused_result)); + size_t *backup_length) __attribute__((warn_unused_result)); /* * Import a conversation from a backup (overwrites the current one if it exists). From 3d8b60e8c0907a9c9741c28cf6ed2a84db2c4a98 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 2 Jul 2016 17:02:53 +0200 Subject: [PATCH 28/53] molch_conversation_import: explicitly pass length of keys --- bindings/molch.i | 4 +++- lib/molch.c | 11 ++++++++++- lib/molch.h | 4 +++- test/molch-test.c | 8 +++++++- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index b719428f..08c9a048 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -198,7 +198,9 @@ extern return_status molch_conversation_import( const unsigned char * const backup, const size_t backup_length, const unsigned char * backup_key, - unsigned char * new_backup_key); + const size_t backup_key, + unsigned char * new_backup_key, + const size_t new_backup_key_length); return_status molch_import( unsigned char * const backup, diff --git a/lib/molch.c b/lib/molch.c index e7aa4deb..339b33ff 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -1306,7 +1306,9 @@ return_status molch_conversation_import( const unsigned char * const backup, const size_t backup_length, const unsigned char * local_backup_key, //BACKUP_KEY_SIZE - unsigned char * new_backup_key) { //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key + const size_t local_backup_key_length, + unsigned char * new_backup_key, //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key + const size_t new_backup_key_length) { return_status status = return_status_init(); buffer_t *json = buffer_create_with_custom_allocator(backup_length, 0, sodium_malloc, sodium_free); @@ -1316,6 +1318,13 @@ return_status molch_conversation_import( throw(INVALID_INPUT, "Invalid input to molch_import."); } + if (local_backup_key_length != BACKUP_KEY_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Backup key has an incorrect length."); + } + + if (new_backup_key_length != BACKUP_KEY_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "New backup key has an incorrect length."); + } //check the lengths if (backup_length < BACKUP_NONCE_SIZE) { diff --git a/lib/molch.h b/lib/molch.h index 65f970d2..38a4538c 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -288,7 +288,9 @@ return_status molch_conversation_import( const unsigned char * const backup, const size_t backup_length, const unsigned char * backup_key, //BACKUP_KEY_SIZE - unsigned char * new_backup_key //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key + const size_t backup_key_length, + unsigned char * new_backup_key, //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key + const size_t new_backup_key_length ) __attribute__((warn_unused_result)); /* diff --git a/test/molch-test.c b/test/molch-test.c index 0675e206..3e6e3d17 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -392,7 +392,13 @@ int main(void) { printf("Alice' conversation exported!"); //import again - status = molch_conversation_import(backup, backup_length, backup_key->content, new_backup_key->content); + status = molch_conversation_import( + backup, + backup_length, + backup_key->content, + backup_key->content_length, + new_backup_key->content, + new_backup_key->content_length); on_error( free(backup); throw(IMPORT_ERROR, "Failed to import Alice' conversation from backup."); From c769763b509f9abdfd38093e7e4746b45666f483 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 2 Jul 2016 17:19:14 +0200 Subject: [PATCH 29/53] molch_import: explicitly pass lengths of keys --- bindings/molch.i | 4 +++- bindings/molch.lua | 4 +++- lib/molch.c | 11 ++++++++++- lib/molch.h | 4 +++- test/molch-init-test.c | 8 +++++++- test/molch-test.c | 8 +++++++- 6 files changed, 33 insertions(+), 6 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 08c9a048..a2d1561f 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -206,7 +206,9 @@ return_status molch_import( unsigned char * const backup, const size_t backup_length, const unsigned char * const backup_key, - unsigned char * const new_backup_key); + const size_t backup_key_length, + unsigned char * const new_backup_key, + const size_t new_backup_key_length); extern return_status molch_get_prekey_list( unsigned char * const public_signing_key, diff --git a/bindings/molch.lua b/bindings/molch.lua index 66a9eb69..52d4bd6d 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -322,7 +322,9 @@ function molch.import(backup) backup_string, backup_length, raw_backup_key, - new_backup_key) + 32, + new_backup_key, + 32) local status_type = molch_interface.get_status(status) if status_type ~= molch_interface.SUCCESS then error(molch.print_errors(status)) diff --git a/lib/molch.c b/lib/molch.c index 339b33ff..33bad56b 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -1592,7 +1592,9 @@ return_status molch_import( unsigned char * const backup, const size_t backup_length, const unsigned char * const local_backup_key, //BACKUP_KEY_SIZE - unsigned char * const new_backup_key //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key + const size_t local_backup_key_length, + unsigned char * const new_backup_key, //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key + const size_t new_backup_key_length ) { return_status status = return_status_init(); @@ -1603,6 +1605,13 @@ return_status molch_import( throw(INVALID_INPUT, "Invalid input to molch_import."); } + if (local_backup_key_length != BACKUP_KEY_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Backup key has an incorrect length."); + } + + if (new_backup_key_length != BACKUP_KEY_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "New backup key has an incorrect length."); + } //check the lengths if (backup_length < BACKUP_NONCE_SIZE) { diff --git a/lib/molch.h b/lib/molch.h index 38a4538c..14b54979 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -306,7 +306,9 @@ return_status molch_import( unsigned char * const backup, const size_t backup_length, const unsigned char * const backup_key, //BACKUP_KEY_SIZE - unsigned char * const new_backup_key //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key + const size_t backup_key_length, + unsigned char * const new_backup_key, //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key + const size_t new_backup_key_length ) __attribute__((warn_unused_result)); /* diff --git a/test/molch-init-test.c b/test/molch-init-test.c index 366f3fe1..1e342c77 100644 --- a/test/molch-init-test.c +++ b/test/molch-init-test.c @@ -58,7 +58,13 @@ int main(void) { } //try to import the backup - status = molch_import(backup_file->content, backup_file->content_length, backup_key_file->content, backup_key); + status = molch_import( + backup_file->content, + backup_file->content_length, + backup_key_file->content, + backup_key_file->content_length, + backup_key, + BACKUP_KEY_SIZE); throw_on_error(IMPORT_ERROR, "Failed to import backup from backup."); //destroy again diff --git a/test/molch-test.c b/test/molch-test.c index 3e6e3d17..59db731b 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -323,7 +323,13 @@ int main(void) { //test import printf("Test import!\n"); - status = molch_import(backup, backup_length, backup_key->content, new_backup_key->content); + status = molch_import( + backup, + backup_length, + backup_key->content, + backup_key->content_length, + new_backup_key->content, + new_backup_key->content_length); on_error( free(backup); throw(IMPORT_ERROR, "Failed to import backup."); From c36f085320e2feffcafbed0eda82fdd0bf47a0eb Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 2 Jul 2016 17:24:56 +0200 Subject: [PATCH 30/53] molch_get_prekey_list: explicitly pass key lengths --- bindings/molch.i | 3 ++- bindings/molch.lua | 1 + lib/molch.c | 11 ++++++++--- lib/molch.h | 3 ++- test/molch-test.c | 1 + 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index a2d1561f..1ecaff78 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -211,7 +211,8 @@ return_status molch_import( const size_t new_backup_key_length); extern return_status molch_get_prekey_list( - unsigned char * const public_signing_key, + unsigned char * const public_master_key, + const size_t public_master_key_length, unsigned char ** const prekey_list, size_t * const prekey_list_length); diff --git a/bindings/molch.lua b/bindings/molch.lua index 52d4bd6d..7085b6d6 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -508,6 +508,7 @@ function molch.user:get_prekey_list() local status = molch_interface.molch_get_prekey_list( convert_to_c_string(self.id), + #self.id, temp_prekey_list, prekey_list_length) local status_type = molch_interface.get_status(status) diff --git a/lib/molch.c b/lib/molch.c index 33bad56b..fb412a03 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -1654,17 +1654,22 @@ return_status molch_import( * if an error has occured. */ return_status molch_get_prekey_list( - unsigned char * const public_signing_key, + unsigned char * const public_master_key, + const size_t public_master_key_length, unsigned char ** const prekey_list, //output, free after use size_t * const prekey_list_length) { return_status status = return_status_init(); // check input - if ((public_signing_key == NULL) || (prekey_list == NULL) || (prekey_list_length == NULL)) { + if ((public_master_key == NULL) || (prekey_list == NULL) || (prekey_list_length == NULL)) { throw(INVALID_INPUT, "Invalid input to molch_get_prekey_list."); } - buffer_create_with_existing_array(public_signing_key_buffer, public_signing_key, PUBLIC_MASTER_KEY_SIZE); + if (public_master_key_length != PUBLIC_MASTER_KEY_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "Public master key has an incorrect length."); + } + + buffer_create_with_existing_array(public_signing_key_buffer, public_master_key, PUBLIC_MASTER_KEY_SIZE); status = create_prekey_list( public_signing_key_buffer, diff --git a/lib/molch.h b/lib/molch.h index 14b54979..88ab92c6 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -318,7 +318,8 @@ return_status molch_import( * if an error has occured. */ return_status molch_get_prekey_list( - unsigned char * const public_signing_key, + unsigned char * const public_master_key, + const size_t public_master_key_length, unsigned char ** const prekey_list, //output, free after use size_t * const prekey_list_length) __attribute__((warn_unused_result)); diff --git a/test/molch-test.c b/test/molch-test.c index 59db731b..77cdd979 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -216,6 +216,7 @@ int main(void) { // export the prekeys again status = molch_get_prekey_list( alice_public_identity->content, + alice_public_identity->content_length, &alice_public_prekeys, &alice_public_prekeys_length); throw_on_error(DATA_FETCH_ERROR, "Failed to get Alice' prekey list."); From 9be26bcbfe02270e6506fa4c2383b1cae620ffa4 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 2 Jul 2016 17:35:52 +0200 Subject: [PATCH 31/53] molch_update_backup_key: explicitly pass lengths of the backup key --- bindings/molch.i | 2 +- lib/molch.c | 14 ++++++++++---- lib/molch.h | 4 +++- test/molch-test.c | 4 ++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 1ecaff78..92f6238a 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -216,4 +216,4 @@ extern return_status molch_get_prekey_list( unsigned char ** const prekey_list, size_t * const prekey_list_length); -extern return_status molch_update_backup_key(unsigned char * const new_key); +extern return_status molch_update_backup_key(unsigned char * const new_key, const size_t new_key_length); diff --git a/lib/molch.c b/lib/molch.c index fb412a03..b8b07e75 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -171,7 +171,7 @@ return_status molch_create_user( } //create a new backup key - status = molch_update_backup_key(backup_key); + status = molch_update_backup_key(backup_key, backup_key_length); throw_on_error(KEYGENERATION_FAILED, "Failed to update backup key."); //create the user @@ -1346,7 +1346,7 @@ return_status molch_conversation_import( json->content_length = json_length; - status = molch_update_backup_key(new_backup_key); + status = molch_update_backup_key(new_backup_key, new_backup_key_length); throw_on_error(KEYGENERATION_FAILED, "Faild to generate a new backup key."); status = molch_conversation_json_import( @@ -1633,7 +1633,7 @@ return_status molch_import( json->content_length = json_length; - status = molch_update_backup_key(new_backup_key); + status = molch_update_backup_key(new_backup_key, new_backup_key_length); throw_on_error(KEYGENERATION_FAILED, "Faild to generate a new backup key."); status = molch_json_import( @@ -1687,7 +1687,9 @@ return_status molch_get_prekey_list( * Don't forget to destroy the return status with molch_destroy_return_status() * if an error has occured. */ -return_status molch_update_backup_key(unsigned char * const new_key /*output with length of BACKUP_KEY_SIZE */) { +return_status molch_update_backup_key( + unsigned char * const new_key, //output, BACKUP_KEY_SIZE + const size_t new_key_length) { return_status status = return_status_init(); buffer_create_with_existing_array(new_key_buffer, new_key, BACKUP_KEY_SIZE); @@ -1696,6 +1698,10 @@ return_status molch_update_backup_key(unsigned char * const new_key /*output wit throw(INVALID_INPUT, "Invalid input to molch_update_backup_key."); } + if (new_key_length != BACKUP_KEY_SIZE) { + throw(INCORRECT_BUFFER_SIZE, "New key has an incorrect length."); + } + // create a backup key buffer if it doesnt exist already if (backup_key == NULL) { backup_key = buffer_create_with_custom_allocator(BACKUP_KEY_SIZE, 0, sodium_malloc, sodium_free); diff --git a/lib/molch.h b/lib/molch.h index 88ab92c6..3b3ca883 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -329,5 +329,7 @@ return_status molch_get_prekey_list( * Don't forget to destroy the return status with molch_destroy_return_status() * if an error has occured. */ -return_status molch_update_backup_key(unsigned char * const new_key /*output with length of BACKUP_KEY_SIZE */) __attribute__((warn_unused_result)); +return_status molch_update_backup_key( + unsigned char * const new_key, //output, BACKUP_KEY_SIZE + const size_t new_key_length) __attribute__((warn_unused_result)); #endif diff --git a/test/molch-test.c b/test/molch-test.c index 77cdd979..29ac2da6 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -64,7 +64,7 @@ int main(void) { unsigned char *printed_status = NULL; - status = molch_update_backup_key(backup_key->content); + status = molch_update_backup_key(backup_key->content, backup_key->content_length); throw_on_error(KEYGENERATION_FAILED, "Failed to update backup key."); //backup for empty library @@ -122,7 +122,7 @@ int main(void) { } //create a new backup key - status = molch_update_backup_key(backup_key->content); + status = molch_update_backup_key(backup_key->content, backup_key->content_length); throw_on_error(KEYGENERATION_FAILED, "Failed to update the backup key."); printf("Updated backup key:\n"); From 301d11edbb29ff9a9dd44c8d8b8a46bc5f699df7 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 2 Jul 2016 19:00:44 +0200 Subject: [PATCH 32/53] molch: fix: initialize libsodium in 'update_backup_key' if not done already --- lib/molch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/molch.c b/lib/molch.c index b8b07e75..a6c7aca5 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -1694,6 +1694,12 @@ return_status molch_update_backup_key( buffer_create_with_existing_array(new_key_buffer, new_key, BACKUP_KEY_SIZE); + if (users == NULL) { + if (sodium_init() == -1) { + throw(INIT_ERROR, "Failed to initialize libsodium."); + } + } + if (new_key == NULL) { throw(INVALID_INPUT, "Invalid input to molch_update_backup_key."); } From c4226062a4d64bdfc30122a4d687d048d46c35c8 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 2 Jul 2016 19:07:59 +0200 Subject: [PATCH 33/53] lua-bindings: molch.update_backup_key --- bindings/molch.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bindings/molch.lua b/bindings/molch.lua index 7085b6d6..6ebdad70 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -629,4 +629,20 @@ function molch.print_errors(status) return raw_error_stack end +function molch.update_backup_key() + local raw_new_backup_key = molch_interface.ucstring_array(32) + + local status = molch_interface.molch_update_backup_key(raw_new_backup_key, 32) + local status_type = molch_interface.get_status(status) + if status_type ~= molch_interface.SUCCESS then + error(molch.print_errors(status)) + end + + local new_backup_key = convert_to_lua_string(raw_new_backup_key, 32) + + molch.users.attributes.last_backup_key = new_backup_key + + return new_backup_key +end + return molch From 19e710bf81f23b831eca3cba7a0cdf4d3fc436d2 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 2 Jul 2016 22:10:51 +0200 Subject: [PATCH 34/53] molch.h: Remove stdbool.h --- lib/molch.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/molch.h b/lib/molch.h index 3b3ca883..5794eb5b 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -17,7 +17,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "return-status.h" #ifndef LIB_MOLCH_H From d5ff9101830120d997952c54bfaf13157b1343ce Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 01:21:38 +0200 Subject: [PATCH 35/53] molch_create_user: reorder parameters --- bindings/molch.i | 6 +++--- bindings/molch.lua | 6 +++--- lib/molch.c | 22 ++++++++++++++-------- lib/molch.h | 17 ++++++++++------- test/molch-init-test.c | 6 +++--- test/molch-test.c | 12 ++++++------ 6 files changed, 39 insertions(+), 30 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 92f6238a..24811580 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -78,12 +78,12 @@ extern return_status molch_create_user( const size_t public_master_key_length, unsigned char **const prekey_list, size_t *const prekey_list_length, - const unsigned char *const random_data, - const size_t random_data_length, unsigned char * backup_key, const size_t backup_key_length, unsigned char **const backup, - size_t *const backup_length + size_t *const backup_length, + const unsigned char *const random_data, + const size_t random_data_length ); extern return_status molch_destroy_user( diff --git a/bindings/molch.lua b/bindings/molch.lua index 6ebdad70..5605414e 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -155,12 +155,12 @@ function molch.user.new(random_spice --[[optional]]) 32, temp_prekey_list, prekey_list_length, - spice_userdata, - spice_userdata_length, raw_backup_key, 32, temp_backup, - backup_length + backup_length, + spice_userdata, + spice_userdata_length ) local status_type = molch_interface.get_status(status) if status_type ~= molch_interface.SUCCESS then diff --git a/lib/molch.c b/lib/molch.c index a6c7aca5..618e117a 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -66,6 +66,10 @@ return_status create_prekey_list( status = user_store_find_node(&user, users, public_signing_key); throw_on_error(NOT_FOUND, "Failed to find user."); + //rotate the prekeys + status = prekey_store_rotate(user->prekeys); + throw_on_error(GENERIC_ERROR, "Failed to rotate prekeys."); + //get the public identity key status = master_keys_get_identity_key( user->master_keys, @@ -130,17 +134,19 @@ return_status create_prekey_list( * if an error has occurred. */ return_status molch_create_user( - unsigned char *const public_master_key, //output, PUBLIC_MASTER_KEY_SIZE + //outputs + unsigned char *const public_master_key, //PUBLIC_MASTER_KEY_SIZE const size_t public_master_key_length, - unsigned char **const prekey_list, //output, needs to be freed + unsigned char **const prekey_list, //needs to be freed size_t *const prekey_list_length, - const unsigned char *const random_data, - const size_t random_data_length, - unsigned char * backup_key, //output, BACKUP_KEY_SIZE + unsigned char * backup_key, //BACKUP_KEY_SIZE const size_t backup_key_length, - unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! - size_t *const backup_length //optional, can be NULL -) { + //optional output (can be NULL) + unsigned char **const backup, //exports the entire library state, free after use, check if NULL before use! + size_t *const backup_length, + //optional input (can be NULL) + const unsigned char *const random_data, + const size_t random_data_length) { return_status status = return_status_init(); bool user_store_created = false; diff --git a/lib/molch.h b/lib/molch.h index 5794eb5b..42b89980 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -49,16 +49,19 @@ * if an error has occurred. */ return_status molch_create_user( - unsigned char *const public_master_key, //output, PUBLIC_MASTER_KEY_SIZE + //outputs + unsigned char *const public_master_key, //PUBLIC_MASTER_KEY_SIZE const size_t public_master_key_length, - unsigned char **const prekey_list, //output, needs to be freed + unsigned char **const prekey_list, //needs to be freed size_t *const prekey_list_length, - const unsigned char *const random_data, - const size_t random_data_length, - unsigned char * backup_key, //output, BACKUP_KEY_SIZE + unsigned char * backup_key, //BACKUP_KEY_SIZE const size_t backup_key_length, - unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! - size_t *const backup_length //optional, can be NULL + //optional output (can be NULL) + unsigned char **const backup, //exports the entire library state, free after use, check if NULL before use! + size_t *const backup_length, + //optional input (can be NULL) + const unsigned char *const random_data, + const size_t random_data_length ) __attribute__((warn_unused_result)); /* diff --git a/test/molch-init-test.c b/test/molch-init-test.c index 1e342c77..c0a9954b 100644 --- a/test/molch-init-test.c +++ b/test/molch-init-test.c @@ -78,12 +78,12 @@ int main(void) { user_id->content_length, &prekey_list, &prekey_list_length, - (unsigned char*)"random", - sizeof("random"), backup_key, BACKUP_KEY_SIZE, &backup, - &backup_length); + &backup_length, + (unsigned char*)"random", + sizeof("random")); throw_on_error(CREATION_ERROR, "Failed to create user."); if (backup == NULL) { throw(EXPORT_ERROR, "Failed to export backup."); diff --git a/test/molch-test.c b/test/molch-test.c index 29ac2da6..59e41517 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -91,12 +91,12 @@ int main(void) { alice_public_identity->content_length, &alice_public_prekeys, &alice_public_prekeys_length, - alice_head_on_keyboard->content, - alice_head_on_keyboard->content_length, new_backup_key->content, new_backup_key->content_length, &complete_export, - &complete_export_length); + &complete_export_length, + alice_head_on_keyboard->content, + alice_head_on_keyboard->content_length); throw_on_error(status.status, "Failed to create Alice!"); if (buffer_compare(backup_key, new_backup_key) == 0) { @@ -136,12 +136,12 @@ int main(void) { bob_public_identity->content_length, &bob_public_prekeys, &bob_public_prekeys_length, - bob_head_on_keyboard->content, - bob_head_on_keyboard->content_length, backup_key->content, backup_key->content_length, NULL, - NULL); + NULL, + bob_head_on_keyboard->content, + bob_head_on_keyboard->content_length); throw_on_error(status.status, "Failed to create Bob!"); printf("Bob public identity (%zu Bytes):\n", bob_public_identity->content_length); From ab5a0b97a7f5125208b98896441ad155c9284751 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 01:51:50 +0200 Subject: [PATCH 36/53] molch.h: comments --- lib/molch.c | 5 +++-- lib/molch.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/molch.c b/lib/molch.c index 618e117a..4378ed67 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -223,8 +223,9 @@ return_status molch_create_user( return_status molch_destroy_user( const unsigned char *const public_master_key, const size_t public_master_key_length, - unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! - size_t *const backup_length //optional, can be NULL + //optional output (can be NULL) + unsigned char **const backup, //exports the entire library state, free after use, check if NULL before use! + size_t *const backup_length ) { return_status status = return_status_init(); diff --git a/lib/molch.h b/lib/molch.h index 42b89980..e5d00b1a 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -73,8 +73,9 @@ return_status molch_create_user( return_status molch_destroy_user( const unsigned char *const public_master_key, const size_t public_master_key_length, - unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use - size_t *const backup_length //optional, can be NULL + //optional output (can be NULL) + unsigned char **const backup, //exports the entire library state, free after use, check if NULL before use + size_t *const backup_length ); /* From c300c674cd19f5f5f838e7e21b6de0d61df5364d Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 02:19:31 +0200 Subject: [PATCH 37/53] molch_create_send_conversation: reorder conversations --- bindings/molch.i | 8 ++++---- bindings/molch.lua | 8 ++++---- lib/molch.c | 21 ++++++++++++--------- lib/molch.h | 21 ++++++++++++--------- test/molch-test.c | 8 ++++---- 5 files changed, 36 insertions(+), 30 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 24811580..5b2876bc 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -113,14 +113,14 @@ extern return_status molch_create_send_conversation( const size_t conversation_id_length, unsigned char ** const packet, size_t *packet_length, - const unsigned char * const message, - const size_t message_length, - const unsigned char * const prekey_list, - const size_t prekey_list_length, const unsigned char * const sender_public_master_key, const size_t sender_public_master_key_length, const unsigned char * const receiver_public_master_key, const size_t receiver_public_master_key_length, + const unsigned char * const prekey_list, + const size_t prekey_list_length, + const unsigned char * const message, + const size_t message_length, unsigned char ** const backup, size_t * const backup_length ); diff --git a/bindings/molch.lua b/bindings/molch.lua index 5605414e..46548797 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -408,14 +408,14 @@ function molch.user:create_send_conversation(message, prekey_list, receiver_id) molch_interface.CONVERSATION_ID_SIZE, raw_packet, raw_packet_length, - raw_message, - raw_message_length, - raw_prekey_list, - raw_prekey_list_length, convert_to_c_string(self.id), #self.id, convert_to_c_string(receiver_id), #receiver_id, + raw_prekey_list, + raw_prekey_list_length, + raw_message, + raw_message_length, raw_backup, raw_backup_length) local status_type = molch_interface.get_status(status) diff --git a/lib/molch.c b/lib/molch.c index 4378ed67..94278b14 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -424,20 +424,23 @@ return_status verify_prekey_list( * if an error has occurred. */ return_status molch_create_send_conversation( - unsigned char *const conversation_id, //output, CONVERSATION_ID_SIZE long (from conversation.h) + //outputs + unsigned char *const conversation_id, //CONVERSATION_ID_SIZE long (from conversation.h) const size_t conversation_id_length, - unsigned char **const packet, //output, will be malloced by the function, don't forget to free it after use! - size_t *packet_length, //output - const unsigned char *const message, - const size_t message_length, - const unsigned char *const prekey_list, //prekey list of the receiver (PREKEY_AMOUNT * PUBLIC_KEY_SIZE) - const size_t prekey_list_length, + unsigned char **const packet, //free after use + size_t *packet_length, + //inputs const unsigned char *const sender_public_master_key, //signing key of the sender (user) const size_t sender_public_master_key_length, const unsigned char *const receiver_public_master_key, //signing key of the receiver const size_t receiver_public_master_key_length, - unsigned char **const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! - size_t *const backup_length //optional, can be NULL + const unsigned char *const prekey_list, //prekey list of the receiver + const size_t prekey_list_length, + const unsigned char *const message, + const size_t message_length, + //optional output (can be NULL) + unsigned char **const backup, //exports the entire library state, free after use, check if NULL before use! + size_t *const backup_length ) { //create buffers wrapping the raw input buffer_create_with_existing_array(conversation_id_buffer, (unsigned char*)conversation_id, CONVERSATION_ID_SIZE); diff --git a/lib/molch.h b/lib/molch.h index e5d00b1a..277eddce 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -125,20 +125,23 @@ molch_message_type molch_get_message_type( * if an error has occurred. */ return_status molch_create_send_conversation( - unsigned char * const conversation_id, //output, CONVERSATION_ID_SIZE long (from conversation.h) + //outputs + unsigned char * const conversation_id, //CONVERSATION_ID_SIZE long (from conversation.h) const size_t conversation_id_length, - unsigned char ** const packet, //output, will be malloced by the function, don't forget to free it after use! - size_t *packet_length, //output - const unsigned char * const message, - const size_t message_length, - const unsigned char * const prekey_list, //prekey list of the receiver - const size_t prekey_list_length, + unsigned char ** const packet, //free after use + size_t *packet_length, + //inputs const unsigned char * const sender_public_master_key, //signing key of the sender (user) const size_t sender_public_master_key_length, const unsigned char * const receiver_public_master_key, //signing key of the receiver const size_t receiver_public_master_key_length, - unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! - size_t * const backup_length //optional, can be NULL + const unsigned char * const prekey_list, //prekey list of the receiver + const size_t prekey_list_length, + const unsigned char * const message, + const size_t message_length, + //optional output (can be NULL) + unsigned char ** const backup, //exports the entire library state, free after use, check if NULL before use! + size_t * const backup_length ) __attribute__((warn_unused_result)); /* diff --git a/test/molch-test.c b/test/molch-test.c index 59e41517..991f2501 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -175,14 +175,14 @@ int main(void) { alice_conversation->content_length, &alice_send_packet, &alice_send_packet_length, - alice_send_message->content, - alice_send_message->content_length, - bob_public_prekeys, - bob_public_prekeys_length, alice_public_identity->content, alice_public_identity->content_length, bob_public_identity->content, bob_public_identity->content_length, + bob_public_prekeys, + bob_public_prekeys_length, + alice_send_message->content, + alice_send_message->content_length, NULL, NULL); throw_on_error(CREATION_ERROR, "Failed to start send conversation."); From 0d6ae48f3fb886e9096912cd6a2d7526c5a4cca7 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 02:29:24 +0200 Subject: [PATCH 38/53] rename molch_create_{receive,send}_conversation to molch_start_... --- bindings/molch.i | 4 ++-- bindings/molch.lua | 8 ++++---- bindings/scenarios/scenarios.lua | 8 ++++---- lib/molch.c | 8 ++++---- lib/molch.h | 4 ++-- test/molch-test.c | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 5b2876bc..551f1513 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -108,7 +108,7 @@ extern molch_message_type molch_get_message_type( const unsigned char * const packet, const size_t packet_length); -extern return_status molch_create_send_conversation( +extern return_status molch_start_send_conversation( unsigned char * const conversation_id, const size_t conversation_id_length, unsigned char ** const packet, @@ -125,7 +125,7 @@ extern return_status molch_create_send_conversation( size_t * const backup_length ); -extern return_status molch_create_receive_conversation( +extern return_status molch_start_receive_conversation( unsigned char * const conversation_id, const size_t conversation_id_length, unsigned char ** const message, diff --git a/bindings/molch.lua b/bindings/molch.lua index 46548797..8909892b 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -390,7 +390,7 @@ function molch.import(backup) end end -function molch.user:create_send_conversation(message, prekey_list, receiver_id) +function molch.user:start_send_conversation(message, prekey_list, receiver_id) local conversation = {} setmetatable(conversation, molch.conversation) @@ -403,7 +403,7 @@ function molch.user:create_send_conversation(message, prekey_list, receiver_id) local raw_message, raw_message_length = convert_to_c_string(message) local raw_prekey_list, raw_prekey_list_length = convert_to_c_string(prekey_list) - local status = molch_interface.molch_create_send_conversation( + local status = molch_interface.molch_start_send_conversation( raw_conversation_id, molch_interface.CONVERSATION_ID_SIZE, raw_packet, @@ -444,7 +444,7 @@ function molch.user:create_send_conversation(message, prekey_list, receiver_id) return conversation, packet end -function molch.user:create_receive_conversation(packet, sender_id) +function molch.user:start_receive_conversation(packet, sender_id) local conversation = {} setmetatable(conversation, molch.conversation) @@ -458,7 +458,7 @@ function molch.user:create_receive_conversation(packet, sender_id) local raw_packet, raw_packet_length = convert_to_c_string(packet) - local status = molch_interface.molch_create_receive_conversation( + local status = molch_interface.molch_start_receive_conversation( raw_conversation_id, molch_interface.CONVERSATION_ID_SIZE, raw_message, diff --git a/bindings/scenarios/scenarios.lua b/bindings/scenarios/scenarios.lua index 5bbff261..5ba28b8b 100644 --- a/bindings/scenarios/scenarios.lua +++ b/bindings/scenarios/scenarios.lua @@ -45,7 +45,7 @@ function alice_send(message) local packet if not alice_conversation then - alice_conversation, packet = alice:create_send_conversation(message, bob.prekey_list, bob.id) + alice_conversation, packet = alice:start_send_conversation(message, bob.prekey_list, bob.id) else packet = alice_conversation:encrypt_message(message) end @@ -61,7 +61,7 @@ function bob_send(message) local packet if not bob_conversation then - bob_conversation, packet = bob:create_send_conversation(message, alice.prekey_list, alice.id) + bob_conversation, packet = bob:start_send_conversation(message, alice.prekey_list, alice.id) else packet = bob_conversation:encrypt_message(message) end @@ -87,7 +87,7 @@ function alice_receive(number) local packet = table.remove(bob_sent, number).packet if not alice_conversation then - alice_conversation, message = alice:create_receive_conversation(packet, bob.id) + alice_conversation, message = alice:start_receive_conversation(packet, bob.id) receive_message_number = 0 previous_receive_message_number = 0 else @@ -118,7 +118,7 @@ function bob_receive(number) local packet = table.remove(alice_sent, number).packet if not bob_conversation then - bob_conversation, message = bob:create_receive_conversation(packet, alice.id) + bob_conversation, message = bob:start_receive_conversation(packet, alice.id) receive_message_number = 0 previous_receive_message_number = 0 else diff --git a/lib/molch.c b/lib/molch.c index 94278b14..ac08f684 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -423,7 +423,7 @@ return_status verify_prekey_list( * Don't forget to destroy the return status with return_status_destroy_errors() * if an error has occurred. */ -return_status molch_create_send_conversation( +return_status molch_start_send_conversation( //outputs unsigned char *const conversation_id, //CONVERSATION_ID_SIZE long (from conversation.h) const size_t conversation_id_length, @@ -467,7 +467,7 @@ return_status molch_create_send_conversation( || (prekey_list == NULL) || (sender_public_master_key == NULL) || (receiver_public_master_key == NULL)) { - throw(INVALID_INPUT, "Invalid input to molch_create_send_conversation."); + throw(INVALID_INPUT, "Invalid input to molch_start_send_conversation."); } if (conversation_id_length != CONVERSATION_ID_SIZE) { @@ -568,7 +568,7 @@ return_status molch_create_send_conversation( * Don't forget to destroy the return status with return_status_destroy_errors() * if an error has occurred. */ -return_status molch_create_receive_conversation( +return_status molch_start_receive_conversation( unsigned char * const conversation_id, //output, CONVERSATION_ID_SIZE long (from conversation.h) const size_t conversation_id_length, unsigned char ** const message, //output, will be malloced by the function, don't forget to free it after use! @@ -603,7 +603,7 @@ return_status molch_create_receive_conversation( || (prekey_list == NULL) || (prekey_list_length == NULL) || (sender_public_master_key == NULL) || (receiver_public_master_key == NULL)) { - throw(INVALID_INPUT, "Invalid input to molch_create_receive_conversation."); + throw(INVALID_INPUT, "Invalid input to molch_start_receive_conversation."); } if (conversation_id_length != CONVERSATION_ID_SIZE) { diff --git a/lib/molch.h b/lib/molch.h index 277eddce..10d7c40d 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -124,7 +124,7 @@ molch_message_type molch_get_message_type( * Don't forget to destroy the return status with molch_destroy_return_status() * if an error has occurred. */ -return_status molch_create_send_conversation( +return_status molch_start_send_conversation( //outputs unsigned char * const conversation_id, //CONVERSATION_ID_SIZE long (from conversation.h) const size_t conversation_id_length, @@ -156,7 +156,7 @@ return_status molch_create_send_conversation( * Don't forget to destroy the return status with molch_destroy_return_status() * if an error has occurred. */ -return_status molch_create_receive_conversation( +return_status molch_start_receive_conversation( unsigned char * const conversation_id, //output, CONVERSATION_ID_SIZE long (from conversation.h) const size_t conversation_id_length, unsigned char ** const message, //output, will be malloced by the function, don't forget to free it after use! diff --git a/test/molch-test.c b/test/molch-test.c index 991f2501..02fa16af 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -170,7 +170,7 @@ int main(void) { //create a new send conversation (alice sends to bob) buffer_create_from_string(alice_send_message, "Hi Bob. Alice here!"); size_t alice_send_packet_length; - status = molch_create_send_conversation( + status = molch_start_send_conversation( alice_conversation->content, alice_conversation->content_length, &alice_send_packet, @@ -224,7 +224,7 @@ int main(void) { //create a new receive conversation (bob receives from alice) unsigned char *bob_receive_message; size_t bob_receive_message_length; - status = molch_create_receive_conversation( + status = molch_start_receive_conversation( bob_conversation->content, bob_conversation->content_length, &bob_receive_message, From f058135ad1448859b84d514c7b23d3726fa94d43 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 03:08:39 +0200 Subject: [PATCH 39/53] molch_start_receive_conversation: reorder parameters --- bindings/molch.i | 8 ++++---- bindings/molch.lua | 8 ++++---- lib/molch.c | 23 +++++++++++++---------- lib/molch.h | 23 +++++++++++++---------- test/molch-test.c | 12 ++++++------ 5 files changed, 40 insertions(+), 34 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 551f1513..f690b037 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -130,14 +130,14 @@ extern return_status molch_start_receive_conversation( const size_t conversation_id_length, unsigned char ** const message, size_t * const message_length, - const unsigned char * const packet, - const size_t packet_length, unsigned char ** const prekey_list, size_t * const prekey_list_length, - const unsigned char * const sender_public_master_key, - const size_t sender_public_master_key_length, const unsigned char * const receiver_public_master_key, const size_t receiver_public_master_key_length, + const unsigned char * const sender_public_master_key, + const size_t sender_public_master_key_length, + const unsigned char * const packet, + const size_t packet_length, unsigned char ** const backup, size_t * const backup_length ); diff --git a/bindings/molch.lua b/bindings/molch.lua index 8909892b..0baf287b 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -463,14 +463,14 @@ function molch.user:start_receive_conversation(packet, sender_id) molch_interface.CONVERSATION_ID_SIZE, raw_message, raw_message_length, - raw_packet, - raw_packet_length, raw_prekey_list, raw_prekey_list_length, - convert_to_c_string(sender_id), - #sender_id, convert_to_c_string(self.id), #self.id, + convert_to_c_string(sender_id), + #sender_id, + raw_packet, + raw_packet_length, raw_backup, raw_backup_length) local status_type = molch_interface.get_status(status) diff --git a/lib/molch.c b/lib/molch.c index ac08f684..ea1cbfbe 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -569,20 +569,23 @@ return_status molch_start_send_conversation( * if an error has occurred. */ return_status molch_start_receive_conversation( - unsigned char * const conversation_id, //output, CONVERSATION_ID_SIZE long (from conversation.h) + //outputs + unsigned char * const conversation_id, //CONVERSATION_ID_SIZE long (from conversation.h) const size_t conversation_id_length, - unsigned char ** const message, //output, will be malloced by the function, don't forget to free it after use! - size_t * const message_length, //output - const unsigned char * const packet, //received prekey packet - const size_t packet_length, - unsigned char ** const prekey_list, //output, free after use + unsigned char ** const prekey_list, //free after use size_t * const prekey_list_length, - const unsigned char * const sender_public_master_key, //signing key of the sender - const size_t sender_public_master_key_length, + unsigned char ** const message, //free after use + size_t * const message_length, + //inputs const unsigned char * const receiver_public_master_key, //signing key of the receiver (user) const size_t receiver_public_master_key_length, - unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! - size_t * const backup_length //optional, can be NULL + const unsigned char * const sender_public_master_key, //signing key of the sender + const size_t sender_public_master_key_length, + const unsigned char * const packet, //received prekey packet + const size_t packet_length, + //optional output (can be NULL) + unsigned char ** const backup, //exports the entire library state, free after use, check if NULL before use! + size_t * const backup_length ) { return_status status = return_status_init(); diff --git a/lib/molch.h b/lib/molch.h index 10d7c40d..0525dd2d 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -157,20 +157,23 @@ return_status molch_start_send_conversation( * if an error has occurred. */ return_status molch_start_receive_conversation( - unsigned char * const conversation_id, //output, CONVERSATION_ID_SIZE long (from conversation.h) + //outputs + unsigned char * const conversation_id, //CONVERSATION_ID_SIZE long (from conversation.h) const size_t conversation_id_length, - unsigned char ** const message, //output, will be malloced by the function, don't forget to free it after use! - size_t * const message_length, //output - const unsigned char * const packet, //received prekey packet - const size_t packet_length, - unsigned char ** const prekey_list, //output, free after use + unsigned char ** const prekey_list, //free after use size_t * const prekey_list_length, - const unsigned char * const sender_public_master_key, //signing key of the sender - const size_t sender_public_master_key_length, + unsigned char ** const message, //free after use + size_t * const message_length, + //inputs const unsigned char * const receiver_public_master_key, //signing key of the receiver (user) const size_t receiver_public_master_key_length, - unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! - size_t * const backup_length //optional, can be NULL + const unsigned char * const sender_public_master_key, //signing key of the sender + const size_t sender_public_master_key_length, + const unsigned char * const packet, //received prekey packet + const size_t packet_length, + //optional output (can be NULL) + unsigned char ** const backup, //exports the entire library state, free after use, check if NULL before use! + size_t * const backup_length ) __attribute__((warn_unused_result)); /* diff --git a/test/molch-test.c b/test/molch-test.c index 02fa16af..f5a930b5 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -227,16 +227,16 @@ int main(void) { status = molch_start_receive_conversation( bob_conversation->content, bob_conversation->content_length, - &bob_receive_message, - &bob_receive_message_length, - alice_send_packet, - alice_send_packet_length, &bob_public_prekeys, &bob_public_prekeys_length, - alice_public_identity->content, - alice_public_identity->content_length, + &bob_receive_message, + &bob_receive_message_length, bob_public_identity->content, bob_public_identity->content_length, + alice_public_identity->content, + alice_public_identity->content_length, + alice_send_packet, + alice_send_packet_length, NULL, NULL); throw_on_error(CREATION_ERROR, "Failed to start receive conversation."); From e909829f192adc55e3befa95aa02f2199549b183 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 03:11:36 +0200 Subject: [PATCH 40/53] molch_user_list: rename to 'molch_list_users' --- bindings/molch.i | 2 +- bindings/molch.lua | 8 ++++---- lib/molch.c | 4 ++-- lib/molch.h | 2 +- test/molch-test.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index f690b037..b4d22543 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -95,7 +95,7 @@ extern return_status molch_destroy_user( extern size_t molch_user_count(); -extern return_status molch_user_list( +extern return_status molch_list_users( unsigned char **const user_list, size_t * const user_list_length, size_t * count); diff --git a/bindings/molch.lua b/bindings/molch.lua index 0baf287b..2e131e3f 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -216,11 +216,11 @@ function molch.user_count() end molch.user.count = molch.user_count -function molch.user_list() +function molch.list_users() local count = molch_interface.size_t() local list_length = molch_interface.size_t() local raw_list = molch_interface.create_ucstring_pointer() - local status = molch_interface.molch_user_list(raw_list, list_length, count) + local status = molch_interface.molch_list_users(raw_list, list_length, count) local status_type = molch_interface.get_status(status) if status_type ~= molch_interface.SUCCESS then error(molch.print_errors(status)) @@ -236,7 +236,7 @@ function molch.user_list() return list end -molch.user.list = molch.user_list +molch.user.list = molch.list_users function molch:export() local backup_length = molch_interface.size_t() @@ -347,7 +347,7 @@ function molch.import(backup) end -- update global user list - local user_list = molch.user_list() + local user_list = molch.list_users() local user_id_lookup = {} for _,user_id in ipairs(user_list) do user_id_lookup[user_id] = true diff --git a/lib/molch.c b/lib/molch.c index ea1cbfbe..ef2ce239 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -287,14 +287,14 @@ void molch_destroy_all_users() { * Don't forget to destroy the return status with return_status_destroy_errors() * if an error has occurred. */ -return_status molch_user_list( +return_status molch_list_users( unsigned char **const user_list, size_t * const user_list_length, //length in bytes size_t * const count) { return_status status = return_status_init(); if ((users == NULL) || (user_list_length == NULL)) { - throw(INVALID_INPUT, "Invalid input to molch_user_list."); + throw(INVALID_INPUT, "Invalid input to molch_list_users."); } //get the list of users and copy it diff --git a/lib/molch.h b/lib/molch.h index 0525dd2d..c6d8084b 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -92,7 +92,7 @@ size_t molch_user_count(); * Don't forget to destroy the return status with molch_destroy_return_status() * if an error has occurred. */ -return_status molch_user_list( +return_status molch_list_users( unsigned char **const user_list, size_t * const user_list_length, //length in bytes size_t *count); diff --git a/test/molch-test.c b/test/molch-test.c index f5a930b5..a1cb7657 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -157,7 +157,7 @@ int main(void) { size_t user_count = 0; size_t user_list_length = 0; unsigned char *user_list = NULL; - status = molch_user_list(&user_list, &user_list_length, &user_count); + status = molch_list_users(&user_list, &user_list_length, &user_count); throw_on_error(CREATION_ERROR, "Failed to list users."); if ((user_count != 2) || (sodium_memcmp(alice_public_identity->content, user_list, alice_public_identity->content_length) != 0) From 1aa9c4551459c4b18547dddbd5069a0c004c6b2f Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 17:29:51 +0200 Subject: [PATCH 41/53] molch_encrypt_message: reorder parameters --- bindings/molch.i | 4 ++-- bindings/molch.lua | 4 ++-- lib/molch.c | 15 +++++++++------ lib/molch.h | 13 ++++++++----- test/molch-test.c | 4 ++-- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index b4d22543..9d833122 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -145,10 +145,10 @@ extern return_status molch_start_receive_conversation( extern return_status molch_encrypt_message( unsigned char ** const packet, size_t *packet_length, - const unsigned char * const message, - const size_t message_length, const unsigned char * const conversation_id, const size_t conversation_id_length, + const unsigned char * const message, + const size_t message_length, unsigned char ** const backup, size_t * const backup_length ); diff --git a/bindings/molch.lua b/bindings/molch.lua index 2e131e3f..47401cc9 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -535,10 +535,10 @@ function molch.conversation:encrypt_message(message) local status = molch_interface.molch_encrypt_message( raw_packet, raw_packet_length, - raw_message, - raw_message_length, convert_to_c_string(self.id), #self.id, + raw_message, + raw_message_length, raw_backup, raw_backup_length) local status_type = molch_interface.get_status(status) diff --git a/lib/molch.c b/lib/molch.c index ef2ce239..5537c452 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -750,14 +750,17 @@ return_status find_conversation( * if an error has occurred. */ return_status molch_encrypt_message( - unsigned char ** const packet, //output, will be malloced by the function, don't forget to free it after use! - size_t *packet_length, //output, length of the packet - const unsigned char * const message, - const size_t message_length, + //output + unsigned char ** const packet, //free after use + size_t *packet_length, + //inputs const unsigned char * const conversation_id, const size_t conversation_id_length, - unsigned char ** const backup, //optional, can be NULL, exports the conversation, free after use, check if NULL before use! - size_t * const backup_length //optional, can be NULL + const unsigned char * const message, + const size_t message_length, + //optional output (can be NULL) + unsigned char ** const backup, //exports the conversation, free after use, check if NULL before use! + size_t * const backup_length ) { //create buffer for message array diff --git a/lib/molch.h b/lib/molch.h index c6d8084b..a5e37cd0 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -183,13 +183,16 @@ return_status molch_start_receive_conversation( * if an error has occurred. */ return_status molch_encrypt_message( - unsigned char ** const packet, //output, will be malloced by the function, don't forget to free it after use! - size_t *packet_length, //output, length of the packet - const unsigned char * const message, - const size_t message_length, + //output + unsigned char ** const packet, //free after use + size_t *packet_length, + //inputs const unsigned char * const conversation_id, const size_t conversation_id_length, - unsigned char ** const backup, //optional, can be NULL, exports the conversationn, free after use, check if NULL before use! + const unsigned char * const message, + const size_t message_length, + //optional output (can be NULL) + unsigned char ** const backup, //exports the conversationn, free after use, check if NULL before use! size_t * const backup_length ) __attribute__((warn_unused_result)); diff --git a/test/molch-test.c b/test/molch-test.c index a1cb7657..05f189d7 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -259,10 +259,10 @@ int main(void) { status = molch_encrypt_message( &bob_send_packet, &bob_send_packet_length, - bob_send_message->content, - bob_send_message->content_length, bob_conversation->content, bob_conversation->content_length, + bob_send_message->content, + bob_send_message->content_length, &conversation_json_export, &conversation_json_export_length); throw_on_error(GENERIC_ERROR, "Couldn't send bobs message."); From d7862e130135e5321bffd642032c7a5ebbb89560 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 17:34:45 +0200 Subject: [PATCH 42/53] Fix: remove leftover debug printf --- test/molch-test.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/molch-test.c b/test/molch-test.c index 05f189d7..e895d428 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -280,7 +280,6 @@ int main(void) { //alice receives reply unsigned char *alice_receive_message = NULL; size_t alice_receive_message_length; - printf("BEFORE molch_decrypt_message\n"); status = molch_decrypt_message( &alice_receive_message, &alice_receive_message_length, @@ -298,7 +297,6 @@ int main(void) { } throw(GENERIC_ERROR, "Incorrect message received."); ) - printf("AFTER molch_decrypt_message\n"); if ((alice_receive_message_number != 0) || (alice_previous_receive_message_number != 0)) { free(alice_receive_message); From 02ff21ee78c2e8a7ab77754dd256c16f1fc6eaa7 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 17:43:12 +0200 Subject: [PATCH 43/53] molch_decrypt_message: reorder parameters --- bindings/molch.i | 8 ++++---- bindings/molch.lua | 8 ++++---- lib/molch.c | 19 +++++++++++-------- lib/molch.h | 17 ++++++++++------- test/molch-test.c | 8 ++++---- 5 files changed, 33 insertions(+), 27 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 9d833122..fd4046b9 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -156,12 +156,12 @@ extern return_status molch_encrypt_message( extern return_status molch_decrypt_message( unsigned char ** const message, size_t *message_length, - const unsigned char * const packet, - const size_t packet_length, - const unsigned char * const conversation_id, - const size_t conversation_id_length, uint32_t * const receive_message_number, uint32_t * const previous_receive_message_number, + const unsigned char * const conversation_id, + const size_t conversation_id_length, + const unsigned char * const packet, + const size_t packet_length, unsigned char ** const backup, size_t * const backup_length ); diff --git a/bindings/molch.lua b/bindings/molch.lua index 47401cc9..de141911 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -569,12 +569,12 @@ function molch.conversation:decrypt_message(packet) local status = molch_interface.molch_decrypt_message( raw_message, raw_message_length, - raw_packet, - raw_packet_length, - convert_to_c_string(self.id), - #self.id, raw_receive_message_number, raw_previous_receive_message_number, + convert_to_c_string(self.id), + #self.id, + raw_packet, + raw_packet_length, raw_backup, raw_backup_length) local status_type = molch_interface.get_status(status) diff --git a/lib/molch.c b/lib/molch.c index 5537c452..fe6b7760 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -830,16 +830,19 @@ return_status molch_encrypt_message( * if an error has occurred. */ return_status molch_decrypt_message( - unsigned char ** const message, //output, will be malloced by the function, don't forget to free it after use! - size_t *message_length, //output - const unsigned char * const packet, //received packet - const size_t packet_length, + //outputs + unsigned char ** const message, //free after use + size_t *message_length, + uint32_t * const receive_message_number, + uint32_t * const previous_receive_message_number, + //inputs const unsigned char * const conversation_id, const size_t conversation_id_length, - uint32_t * const receive_message_number, //output - uint32_t * const previous_receive_message_number, //output - unsigned char ** const backup, //optional, can be NULL, exports the conversation, free after use, check if NULL before use! - size_t * const backup_length //optional, can be NULL + const unsigned char * const packet, + const size_t packet_length, + //optional output (can be NULL) + unsigned char ** const backup, //exports the conversation, free after use, check if NULL before use! + size_t * const backup_length ) { //create buffer for the packet buffer_create_with_existing_array(packet_buffer, (unsigned char*)packet, packet_length); diff --git a/lib/molch.h b/lib/molch.h index a5e37cd0..2fd4c6f6 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -203,15 +203,18 @@ return_status molch_encrypt_message( * if an error has occurred. */ return_status molch_decrypt_message( - unsigned char ** const message, //output, will be malloced by the function, don't forget to free it after use! - size_t *message_length, //output - const unsigned char * const packet, //received packet - const size_t packet_length, + //output + unsigned char ** const message, //free after use + size_t *message_length, + uint32_t * const receive_message_number, + uint32_t * const previous_receive_message_number, + //inputs const unsigned char * const conversation_id, const size_t conversation_id_length, - uint32_t * const receive_message_number, //output - uint32_t * const previous_receive_message_number, //output - unsigned char ** const backup, //optional, can be NULL, exports the conversation, free after use, check if NULL before use! + const unsigned char * const packet, //received packet + const size_t packet_length, + //optional output (can be NULL) + unsigned char ** const backup, //exports the conversation, free after use, check if NULL before use! size_t * const backup_length ) __attribute__((warn_unused_result)); diff --git a/test/molch-test.c b/test/molch-test.c index e895d428..3d96fa6b 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -283,12 +283,12 @@ int main(void) { status = molch_decrypt_message( &alice_receive_message, &alice_receive_message_length, - bob_send_packet, - bob_send_packet_length, - alice_conversation->content, - alice_conversation->content_length, &alice_receive_message_number, &alice_previous_receive_message_number, + alice_conversation->content, + alice_conversation->content_length, + bob_send_packet, + bob_send_packet_length, NULL, NULL); on_error( From 333bd6c813acb47e18d603ff16f76deea6528ec4 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 17:46:13 +0200 Subject: [PATCH 44/53] molch_{encrypt,decrypt}_message: rename backup to conversation_backup --- lib/molch.c | 24 ++++++++++++------------ lib/molch.h | 10 +++++----- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/molch.c b/lib/molch.c index fe6b7760..64de4790 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -759,8 +759,8 @@ return_status molch_encrypt_message( const unsigned char * const message, const size_t message_length, //optional output (can be NULL) - unsigned char ** const backup, //exports the conversation, free after use, check if NULL before use! - size_t * const backup_length + unsigned char ** const conversation_backup, //exports the conversation, free after use, check if NULL before use! + size_t * const conversation_backup_length ) { //create buffer for message array @@ -800,11 +800,11 @@ return_status molch_encrypt_message( *packet = packet_buffer->content; *packet_length = packet_buffer->content_length; - if (backup != NULL) { - if (backup_length == 0) { - *backup = NULL; + if (conversation_backup != NULL) { + if (conversation_backup_length == 0) { + *conversation_backup = NULL; } else { - status = molch_conversation_export(backup, backup_length, conversation->id->content, conversation->id->content_length); + status = molch_conversation_export(conversation_backup, conversation_backup_length, conversation->id->content, conversation->id->content_length); throw_on_error(EXPORT_ERROR, "Failed to export conversation as JSON."); } } @@ -841,8 +841,8 @@ return_status molch_decrypt_message( const unsigned char * const packet, const size_t packet_length, //optional output (can be NULL) - unsigned char ** const backup, //exports the conversation, free after use, check if NULL before use! - size_t * const backup_length + unsigned char ** const conversation_backup, //exports the conversation, free after use, check if NULL before use! + size_t * const conversation_backup_length ) { //create buffer for the packet buffer_create_with_existing_array(packet_buffer, (unsigned char*)packet, packet_length); @@ -883,11 +883,11 @@ return_status molch_decrypt_message( *message = message_buffer->content; *message_length = message_buffer->content_length; - if (backup != NULL) { - if (backup_length == 0) { - *backup = NULL; + if (conversation_backup != NULL) { + if (conversation_backup_length == 0) { + *conversation_backup = NULL; } else { - status = molch_conversation_export(backup, backup_length, conversation->id->content, conversation->id->content_length); + status = molch_conversation_export(conversation_backup, conversation_backup_length, conversation->id->content, conversation->id->content_length); throw_on_error(EXPORT_ERROR, "Failed to export conversation as JSON."); } } diff --git a/lib/molch.h b/lib/molch.h index 2fd4c6f6..60145fd7 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -192,8 +192,8 @@ return_status molch_encrypt_message( const unsigned char * const message, const size_t message_length, //optional output (can be NULL) - unsigned char ** const backup, //exports the conversationn, free after use, check if NULL before use! - size_t * const backup_length + unsigned char ** const conversation_backup, //exports the conversationn, free after use, check if NULL before use! + size_t * const conversation_backup_length ) __attribute__((warn_unused_result)); /* @@ -203,7 +203,7 @@ return_status molch_encrypt_message( * if an error has occurred. */ return_status molch_decrypt_message( - //output + //outputs unsigned char ** const message, //free after use size_t *message_length, uint32_t * const receive_message_number, @@ -214,8 +214,8 @@ return_status molch_decrypt_message( const unsigned char * const packet, //received packet const size_t packet_length, //optional output (can be NULL) - unsigned char ** const backup, //exports the conversation, free after use, check if NULL before use! - size_t * const backup_length + unsigned char ** const conversation_backup, //exports the conversation, free after use, check if NULL before use! + size_t * const conversation_backup_length ) __attribute__((warn_unused_result)); /* From ca2a8877b628d45c8a22e1c95232f1754a004d99 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 17:48:01 +0200 Subject: [PATCH 45/53] molch_end_conversation: Add comments to the parameters --- lib/molch.c | 4 +++- lib/molch.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/molch.c b/lib/molch.c index 64de4790..e55379bb 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -911,9 +911,11 @@ return_status molch_decrypt_message( * This will almost certainly be changed later on!!!!!! */ void molch_end_conversation( + //input const unsigned char * const conversation_id, const size_t conversation_id_length, - unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! + //optional output (can be NULL) + unsigned char ** const backup, //exports the entire library state, free after use, check if NULL before use! size_t * const backup_length ) { return_status status = return_status_init(); diff --git a/lib/molch.h b/lib/molch.h index 60145fd7..d6972378 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -224,9 +224,11 @@ return_status molch_decrypt_message( * This will almost certainly be changed later on!!!!!! */ void molch_end_conversation( + //input const unsigned char * const conversation_id, const size_t conversation_id_length, - unsigned char ** const backup, //optional, can be NULL, exports the entire library state, free after use, check if NULL before use! + //optional output (can be NULL) + unsigned char ** const backup, //exports the entire library state, free after use, check if NULL before use! size_t * const backup_length ); From 0917bfdf12c1f8caedf64c5d25efa05e8b477b51 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 17:52:38 +0200 Subject: [PATCH 46/53] molch_list_conversations: reorder parameters --- bindings/molch.i | 6 +++--- bindings/molch.lua | 7 ++++++- lib/molch.c | 8 +++++--- lib/molch.h | 8 +++++--- test/molch-test.c | 7 ++++++- 5 files changed, 25 insertions(+), 11 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index fd4046b9..5e6a7c09 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -174,11 +174,11 @@ extern void molch_end_conversation( ); extern return_status molch_list_conversations( - const unsigned char * const user_public_master_key, - const size_t user_public_master_key_length, unsigned char ** const conversation_list, size_t * const conversation_list_length, - size_t * const number); + size_t * const number, + const unsigned char * const user_public_master_key, + const size_t user_public_master_key_length); extern char *molch_print_status(return_status status, size_t * const output_length); diff --git a/bindings/molch.lua b/bindings/molch.lua index de141911..598e7921 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -294,7 +294,12 @@ function molch.user:list_conversations() local count = molch_interface.size_t() local raw_list_length = molch_interface.size_t() local raw_list = molch_interface.create_ucstring_pointer() - local status = molch_interface.molch_list_conversations(convert_to_c_string(self.id), #self.id, raw_list, raw_list_length, count) + local status = molch_interface.molch_list_conversations( + raw_list, + raw_list_length, + count, + convert_to_c_string(self.id), + #self.id) local status_type = molch_interface.get_status(status) if status_type ~= molch_interface.SUCCESS then error(molch.print_errors(status)) diff --git a/lib/molch.c b/lib/molch.c index e55379bb..ced6623c 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -974,11 +974,13 @@ void molch_end_conversation( * if an error has occurred. */ return_status molch_list_conversations( - const unsigned char * const user_public_master_key, - const size_t user_public_master_key_length, + //outputs unsigned char ** const conversation_list, size_t * const conversation_list_length, - size_t * const number) { + size_t * const number, + //inputs + const unsigned char * const user_public_master_key, + const size_t user_public_master_key_length) { buffer_create_with_existing_array(user_public_master_key_buffer, (unsigned char*)user_public_master_key, PUBLIC_KEY_SIZE); buffer_t *conversation_list_buffer = NULL; diff --git a/lib/molch.h b/lib/molch.h index d6972378..f8b1b68c 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -244,11 +244,13 @@ void molch_end_conversation( * if an error has occurred. */ return_status molch_list_conversations( - const unsigned char * const user_public_master_key, - const size_t user_public_master_key_length, + //outputs unsigned char ** const conversation_list, size_t * const conversation_list_length, - size_t * const number) __attribute__((warn_unused_result)); + size_t * const number, + //input + const unsigned char * const user_public_master_key, + const size_t user_public_master_key_length) __attribute__((warn_unused_result)); /* * Print a return status into a nice looking error message. diff --git a/test/molch-test.c b/test/molch-test.c index 3d96fa6b..c2cc919f 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -191,7 +191,12 @@ int main(void) { size_t number_of_conversations = 0;; size_t conversation_list_length = 0; unsigned char *conversation_list = NULL; - status = molch_list_conversations(alice_public_identity->content, alice_public_identity->content_length, &conversation_list, &conversation_list_length, &number_of_conversations); + status = molch_list_conversations( + &conversation_list, + &conversation_list_length, + &number_of_conversations, + alice_public_identity->content, + alice_public_identity->content_length); throw_on_error(GENERIC_ERROR, "Failed to list conversations."); if ((number_of_conversations != 1) || (buffer_compare_to_raw(alice_conversation, conversation_list, alice_conversation->content_length) != 0)) { free(conversation_list); From 650ee2a87300e247ff4ef2c3d65fae0dee4e360d Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 18:00:28 +0200 Subject: [PATCH 47/53] molch_print_status: reorder parameters --- bindings/molch.i | 2 +- bindings/molch.lua | 2 +- lib/molch.c | 2 +- lib/molch.h | 2 +- test/molch-test.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 5e6a7c09..04d70f65 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -180,7 +180,7 @@ extern return_status molch_list_conversations( const unsigned char * const user_public_master_key, const size_t user_public_master_key_length); -extern char *molch_print_status(return_status status, size_t * const output_length); +extern char *molch_print_status(size_t * const output_length, return_status status); extern const char *molch_print_status_type(status_type type); diff --git a/bindings/molch.lua b/bindings/molch.lua index 598e7921..4bfa3b85 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -629,7 +629,7 @@ end function molch.print_errors(status) local size = molch_interface.size_t() - local raw_error_stack = molch_interface.molch_print_status(status, size) + local raw_error_stack = molch_interface.molch_print_status(size, status) molch_interface.molch_destroy_return_status(status) return raw_error_stack end diff --git a/lib/molch.c b/lib/molch.c index ced6623c..5a878a39 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -1040,7 +1040,7 @@ return_status molch_list_conversations( * * Don't forget to free the output after use. */ -char *molch_print_status(return_status status, size_t * const output_length) { +char *molch_print_status(size_t * const output_length, return_status status) { return return_status_print(&status, output_length); } diff --git a/lib/molch.h b/lib/molch.h index f8b1b68c..94c038a3 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -257,7 +257,7 @@ return_status molch_list_conversations( * * Don't forget to free the output after use. */ -char *molch_print_status(return_status status, size_t * const output_length) __attribute__((warn_unused_result)); +char *molch_print_status(size_t * const output_length, return_status status) __attribute__((warn_unused_result)); /* * Get a string describing the return status type. diff --git a/test/molch-test.c b/test/molch-test.c index c2cc919f..3937c3ce 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -481,7 +481,7 @@ int main(void) { buffer_create_from_string(success_buffer, "SUCCESS"); size_t printed_status_length = 0; - printed_status = (unsigned char*) molch_print_status(return_status_init(), &printed_status_length); + printed_status = (unsigned char*) molch_print_status(&printed_status_length, return_status_init()); if (buffer_compare_to_raw(success_buffer, printed_status, printed_status_length) != 0) { throw(INCORRECT_DATA, "molch_print_status produces incorrect output."); } From 854b7fbda8431ab4e7ba9cbfa54d0bec7239b2d5 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 22:04:09 +0200 Subject: [PATCH 48/53] molch_conversation_export: add comments to parameters --- lib/molch.c | 2 ++ lib/molch.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/molch.c b/lib/molch.c index 5a878a39..e096df10 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -1148,8 +1148,10 @@ return_status molch_conversation_json_export( * if an error has occurred. */ return_status molch_conversation_export( + //output unsigned char ** const backup, size_t * const backup_length, + //input const unsigned char * const conversation_id, const size_t conversation_id_length) { //FIXME: Less duplication diff --git a/lib/molch.h b/lib/molch.h index 94c038a3..09330f87 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -280,8 +280,10 @@ void molch_destroy_return_status(return_status * const status); * if an error has occurred. */ return_status molch_conversation_export( + //output unsigned char ** const backup, size_t * const backup_length, + //input const unsigned char * const conversation_id, const size_t conversation_id_length) __attribute__((warn_unused_result)); From 8be32be6edbbaf944f4fd425c0e7e6a4aba0618d Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 22:16:20 +0200 Subject: [PATCH 49/53] molch_conversation_export: reorder parameters --- bindings/molch.i | 6 +++--- lib/molch.c | 8 +++++--- lib/molch.h | 8 +++++--- test/molch-test.c | 6 +++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 04d70f65..ec422774 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -195,12 +195,12 @@ extern return_status molch_conversation_export( extern return_status molch_export(unsigned char ** const backup, size_t *backup_length); extern return_status molch_conversation_import( + unsigned char * new_backup_key, + const size_t new_backup_key_length, const unsigned char * const backup, const size_t backup_length, const unsigned char * backup_key, - const size_t backup_key, - unsigned char * new_backup_key, - const size_t new_backup_key_length); + const size_t backup_key); return_status molch_import( unsigned char * const backup, diff --git a/lib/molch.c b/lib/molch.c index e096df10..1e35a0e2 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -1328,12 +1328,14 @@ return_status molch_conversation_json_import(const unsigned char * const json, c * if an error has occurred. */ return_status molch_conversation_import( + //output + unsigned char * new_backup_key, //BACKUP_KEY_SIZE, can be the same pointer as the backup key + const size_t new_backup_key_length, + //inputs const unsigned char * const backup, const size_t backup_length, const unsigned char * local_backup_key, //BACKUP_KEY_SIZE - const size_t local_backup_key_length, - unsigned char * new_backup_key, //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key - const size_t new_backup_key_length) { + const size_t local_backup_key_length) { return_status status = return_status_init(); buffer_t *json = buffer_create_with_custom_allocator(backup_length, 0, sodium_malloc, sodium_free); diff --git a/lib/molch.h b/lib/molch.h index 09330f87..f8814238 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -306,12 +306,14 @@ return_status molch_export( * if an error has occurred. */ return_status molch_conversation_import( + //output + unsigned char * new_backup_key, //BACKUP_KEY_SIZE, can be the same pointer as the backup key + const size_t new_backup_key_length, + //inputs const unsigned char * const backup, const size_t backup_length, const unsigned char * backup_key, //BACKUP_KEY_SIZE - const size_t backup_key_length, - unsigned char * new_backup_key, //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key - const size_t new_backup_key_length + const size_t backup_key_length ) __attribute__((warn_unused_result)); /* diff --git a/test/molch-test.c b/test/molch-test.c index 3937c3ce..516a4803 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -403,12 +403,12 @@ int main(void) { //import again status = molch_conversation_import( + new_backup_key->content, + new_backup_key->content_length, backup, backup_length, backup_key->content, - backup_key->content_length, - new_backup_key->content, - new_backup_key->content_length); + backup_key->content_length); on_error( free(backup); throw(IMPORT_ERROR, "Failed to import Alice' conversation from backup."); From f9b7144b5b54ff3e5d70b6dd9ede60edcd8ad1a9 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 22:24:27 +0200 Subject: [PATCH 50/53] molch_import: reorder parameters --- bindings/molch.i | 6 +++--- bindings/molch.lua | 4 ++-- lib/molch.c | 8 +++++--- lib/molch.h | 8 +++++--- test/molch-init-test.c | 6 +++--- test/molch-test.c | 6 +++--- 6 files changed, 21 insertions(+), 17 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index ec422774..9d8c465c 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -203,12 +203,12 @@ extern return_status molch_conversation_import( const size_t backup_key); return_status molch_import( + unsigned char * const new_backup_key, + const size_t new_backup_key_length, unsigned char * const backup, const size_t backup_length, const unsigned char * const backup_key, - const size_t backup_key_length, - unsigned char * const new_backup_key, - const size_t new_backup_key_length); + const size_t backup_key_length); extern return_status molch_get_prekey_list( unsigned char * const public_master_key, diff --git a/bindings/molch.lua b/bindings/molch.lua index 4bfa3b85..bf54bb05 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -324,11 +324,11 @@ function molch.import(backup) local new_backup_key = molch_interface.ucstring_array(32) local status = molch_interface.molch_import( + new_backup_key, + 32, backup_string, backup_length, raw_backup_key, - 32, - new_backup_key, 32) local status_type = molch_interface.get_status(status) if status_type ~= molch_interface.SUCCESS then diff --git a/lib/molch.c b/lib/molch.c index 1e35a0e2..e3f0b18b 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -1616,12 +1616,14 @@ return_status molch_json_import(const unsigned char *const json, const size_t le * if an error has occured. */ return_status molch_import( + //output + unsigned char * const new_backup_key, //BACKUP_KEY_SIZE, can be the same pointer as the backup key + const size_t new_backup_key_length, + //inputs unsigned char * const backup, const size_t backup_length, const unsigned char * const local_backup_key, //BACKUP_KEY_SIZE - const size_t local_backup_key_length, - unsigned char * const new_backup_key, //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key - const size_t new_backup_key_length + const size_t local_backup_key_length ) { return_status status = return_status_init(); diff --git a/lib/molch.h b/lib/molch.h index f8814238..3698d0bf 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -326,12 +326,14 @@ return_status molch_conversation_import( * if an error has occured. */ return_status molch_import( + //output + unsigned char * const new_backup_key, //BACKUP_KEY_SIZE, can be the same pointer as the backup key + const size_t new_backup_key_length, + //inputs unsigned char * const backup, const size_t backup_length, const unsigned char * const backup_key, //BACKUP_KEY_SIZE - const size_t backup_key_length, - unsigned char * const new_backup_key, //output, BACKUP_KEY_SIZE, can be the same pointer as the backup key - const size_t new_backup_key_length + const size_t backup_key_length ) __attribute__((warn_unused_result)); /* diff --git a/test/molch-init-test.c b/test/molch-init-test.c index c0a9954b..a3e26792 100644 --- a/test/molch-init-test.c +++ b/test/molch-init-test.c @@ -59,12 +59,12 @@ int main(void) { //try to import the backup status = molch_import( + backup_key, + BACKUP_KEY_SIZE, backup_file->content, backup_file->content_length, backup_key_file->content, - backup_key_file->content_length, - backup_key, - BACKUP_KEY_SIZE); + backup_key_file->content_length); throw_on_error(IMPORT_ERROR, "Failed to import backup from backup."); //destroy again diff --git a/test/molch-test.c b/test/molch-test.c index 516a4803..395cc15d 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -328,12 +328,12 @@ int main(void) { //test import printf("Test import!\n"); status = molch_import( + new_backup_key->content, + new_backup_key->content_length, backup, backup_length, backup_key->content, - backup_key->content_length, - new_backup_key->content, - new_backup_key->content_length); + backup_key->content_length); on_error( free(backup); throw(IMPORT_ERROR, "Failed to import backup."); From 314c2432b12f5b01b6a633a63d340df72ce4f9bf Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 22:29:06 +0200 Subject: [PATCH 51/53] molch_get_prekey_list: reorder parameters --- bindings/molch.i | 6 +++--- bindings/molch.lua | 6 +++--- lib/molch.c | 8 +++++--- lib/molch.h | 8 +++++--- test/molch-test.c | 6 +++--- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/bindings/molch.i b/bindings/molch.i index 9d8c465c..e0a92930 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -211,9 +211,9 @@ return_status molch_import( const size_t backup_key_length); extern return_status molch_get_prekey_list( - unsigned char * const public_master_key, - const size_t public_master_key_length, unsigned char ** const prekey_list, - size_t * const prekey_list_length); + size_t * const prekey_list_length, + unsigned char * const public_master_key, + const size_t public_master_key_length); extern return_status molch_update_backup_key(unsigned char * const new_key, const size_t new_key_length); diff --git a/bindings/molch.lua b/bindings/molch.lua index bf54bb05..cf133594 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -512,10 +512,10 @@ function molch.user:get_prekey_list() local temp_prekey_list = molch_interface.create_ucstring_pointer() local status = molch_interface.molch_get_prekey_list( - convert_to_c_string(self.id), - #self.id, temp_prekey_list, - prekey_list_length) + prekey_list_length, + convert_to_c_string(self.id), + #self.id) local status_type = molch_interface.get_status(status) if status_type ~= molch_interface.SUCCESS then molch_interface.free(temp_prekey_list) diff --git a/lib/molch.c b/lib/molch.c index e3f0b18b..25357bd9 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -1683,10 +1683,12 @@ return_status molch_import( * if an error has occured. */ return_status molch_get_prekey_list( + //output + unsigned char ** const prekey_list, //free after use + size_t * const prekey_list_length, + //input unsigned char * const public_master_key, - const size_t public_master_key_length, - unsigned char ** const prekey_list, //output, free after use - size_t * const prekey_list_length) { + const size_t public_master_key_length) { return_status status = return_status_init(); // check input diff --git a/lib/molch.h b/lib/molch.h index 3698d0bf..92107f23 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -343,10 +343,12 @@ return_status molch_import( * if an error has occured. */ return_status molch_get_prekey_list( + //output + unsigned char ** const prekey_list, //free after use + size_t * const prekey_list_length, + //input unsigned char * const public_master_key, - const size_t public_master_key_length, - unsigned char ** const prekey_list, //output, free after use - size_t * const prekey_list_length) __attribute__((warn_unused_result)); + const size_t public_master_key_length) __attribute__((warn_unused_result)); /* * Generate and return a new key for encrypting the exported library state. diff --git a/test/molch-test.c b/test/molch-test.c index 395cc15d..3fa77a9d 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -220,10 +220,10 @@ int main(void) { // export the prekeys again status = molch_get_prekey_list( - alice_public_identity->content, - alice_public_identity->content_length, &alice_public_prekeys, - &alice_public_prekeys_length); + &alice_public_prekeys_length, + alice_public_identity->content, + alice_public_identity->content_length); throw_on_error(DATA_FETCH_ERROR, "Failed to get Alice' prekey list."); //create a new receive conversation (bob receives from alice) From 17615e7a84b86b55d502dbaf6640260c6a0f4178 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 3 Jul 2016 23:57:11 +0200 Subject: [PATCH 52/53] Change license from LGPL2.1 to ISC --- LICENSE | 16 + LICENSE.txt | 502 ------------------ README.md | 19 +- bindings/base64.lua | 68 ++- bindings/molch.i | 21 + bindings/molch.lua | 19 + bindings/pipe.lua | 19 + bindings/scenarios/scenarios.lua | 19 + buffer | 2 +- lib/constants.h | 30 +- lib/conversation-store.c | 30 +- lib/conversation-store.h | 30 +- lib/conversation.c | 30 +- lib/conversation.h | 30 +- lib/diffie-hellman.c | 30 +- lib/diffie-hellman.h | 30 +- lib/endianness.c | 30 +- lib/endianness.h | 30 +- lib/header-and-message-keystore.c | 30 +- lib/header-and-message-keystore.h | 30 +- lib/header.c | 30 +- lib/header.h | 30 +- lib/json.h | 30 +- lib/key-derivation.c | 30 +- lib/key-derivation.h | 30 +- lib/master-keys.c | 30 +- lib/master-keys.h | 30 +- lib/molch.c | 30 +- lib/molch.h | 36 +- lib/packet.c | 31 +- lib/packet.h | 30 +- lib/prekey-store.c | 30 +- lib/prekey-store.h | 30 +- lib/ratchet.c | 30 +- lib/ratchet.h | 30 +- lib/return-status.c | 29 +- lib/return-status.h | 29 +- lib/spiced-random.c | 30 +- lib/spiced-random.h | 30 +- lib/user-store.c | 30 +- lib/user-store.h | 30 +- mcJSON | 2 +- test/chain-key-derivation-test.c | 31 +- test/common.c | 31 +- test/common.h | 30 +- test/conversation-packet-test.c | 30 +- test/conversation-store-test.c | 30 +- test/conversation-test.c | 30 +- test/diffie-hellman-test.c | 31 +- test/endianness-test.c | 31 +- test/header-and-message-keystore-test.c | 31 +- test/header-test.c | 31 +- ...oot-chain-and-header-key-derivation-test.c | 31 +- test/key-derivation-test.c | 31 +- test/master-keys-test.c | 31 +- test/message-key-derivation-test.c | 31 +- test/molch-init-test.c | 30 +- test/molch-test.c | 31 +- test/packet-decrypt-header-test.c | 31 +- test/packet-decrypt-message-test.c | 31 +- test/packet-decrypt-test.c | 31 +- test/packet-get-metadata-test.c | 31 +- test/packet-test-lib.c | 31 +- test/packet-test-lib.h | 30 +- test/prekey-store-test.c | 30 +- test/ratchet-test-simple.c | 30 +- test/ratchet-test.c | 31 +- test/return-status-test.c | 29 +- ...ext-header-and-chain-key-derivation-test.c | 31 +- test/spiced-random-test.c | 31 +- test/tracing.c | 30 +- test/tracing.h | 30 +- test/triple-diffie-hellman-test.c | 31 +- test/user-store-test.c | 30 +- test/utils.c | 31 +- test/utils.h | 30 +- 76 files changed, 1239 insertions(+), 1453 deletions(-) create mode 100644 LICENSE delete mode 100644 LICENSE.txt diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..24a783e5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,16 @@ +ISC License + +Copyright (C) 2015-2016 1984not Security GmbH +Author: Max Bruckner (FSMaxB) + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 4362b491..00000000 --- a/LICENSE.txt +++ /dev/null @@ -1,502 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/README.md b/README.md index 4e88ffd4..9b3e059a 100644 --- a/README.md +++ b/README.md @@ -100,4 +100,21 @@ Take a look at the file `CONTRIBUTING`. And look for GitHub Issues with the `hel license ------- -This library is licensed under the LGPLv2.1. +This library is licensed under the ISC license. + +> ISC License +> +> Copyright (C) 2015-2016 1984not Security GmbH +> Author: Max Bruckner (FSMaxB) +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/bindings/base64.lua b/bindings/base64.lua index 3a0aa11e..3b559c3a 100644 --- a/bindings/base64.lua +++ b/bindings/base64.lua @@ -1,38 +1,58 @@ -- Base64-encoding -- Sourced from http://en.wikipedia.org/wiki/Base64 -- --- Copyright (c) 2012, Daniel Lindsley --- All rights reserved. --- --- Modified by: Max Bruckner (FSMaxB) +-- Changes to the original: -- * remove unnecessary "require" -- * remove __ attributes -- * rename "to_base64" -> "encode" and "from_base64" -> "decode" -- * make it a loadable module via require -- * fix use of the modulo operator (math.mod -> %) -- --- Redistribution and use in source and binary forms, with or without --- modification, are permitted provided that the following conditions are met: +-- ISC License +-- +-- Copyright (C) 2015-2016 1984not Security GmbH +-- Author: Max Bruckner (FSMaxB) +-- +-- Permission to use, copy, modify, and/or distribute this software for any +-- purpose with or without fee is hereby granted, provided that the above +-- copyright notice and this permission notice appear in all copies. +-- +-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-- -- --- * Redistributions of source code must retain the above copyright notice, this --- list of conditions and the following disclaimer. --- * Redistributions in binary form must reproduce the above copyright notice, --- this list of conditions and the following disclaimer in the documentation --- and/or other materials provided with the distribution. --- * Neither the name of the base64 nor the names of its contributors may be --- used to endorse or promote products derived from this software without --- specific prior written permission. +-- This file incorporates work covered by the following license notice: -- --- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND --- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED --- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE --- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE --- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL --- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR --- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER --- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, --- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-- | Copyright (c) 2012, Daniel Lindsley +-- | All rights reserved. +-- | +-- | Redistribution and use in source and binary forms, with or without +-- | modification, are permitted provided that the following conditions are met: +-- | +-- | * Redistributions of source code must retain the above copyright notice, this +-- | list of conditions and the following disclaimer. +-- | * Redistributions in binary form must reproduce the above copyright notice, +-- | this list of conditions and the following disclaimer in the documentation +-- | and/or other materials provided with the distribution. +-- | * Neither the name of the base64 nor the names of its contributors may be +-- | used to endorse or promote products derived from this software without +-- | specific prior written permission. +-- | +-- | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +-- | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +-- | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +-- | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +-- | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +-- | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +-- | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +-- | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +-- | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +-- | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. local base64 = {} diff --git a/bindings/molch.i b/bindings/molch.i index e0a92930..eafd63a5 100644 --- a/bindings/molch.i +++ b/bindings/molch.i @@ -1,3 +1,24 @@ +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License + * + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + %module molch %{ diff --git a/bindings/molch.lua b/bindings/molch.lua index cf133594..748dff04 100644 --- a/bindings/molch.lua +++ b/bindings/molch.lua @@ -1,3 +1,22 @@ +-- Molch, an implementation of the axolotl ratchet based on libsodium +-- +-- ISC License +-- +-- Copyright (C) 2015-2016 1984not Security GmbH +-- Author: Max Bruckner (FSMaxB) +-- +-- Permission to use, copy, modify, and/or distribute this software for any +-- purpose with or without fee is hereby granted, provided that the above +-- copyright notice and this permission notice appear in all copies. +-- +-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + local molch = {} print("WARNING: This interface should only be used for debugging!") diff --git a/bindings/pipe.lua b/bindings/pipe.lua index 3025a63a..811b9024 100644 --- a/bindings/pipe.lua +++ b/bindings/pipe.lua @@ -1,3 +1,22 @@ +-- Molch, an implementation of the axolotl ratchet based on libsodium +-- +-- ISC License +-- +-- Copyright (C) 2015-2016 1984not Security GmbH +-- Author: Max Bruckner (FSMaxB) +-- +-- Permission to use, copy, modify, and/or distribute this software for any +-- purpose with or without fee is hereby granted, provided that the above +-- copyright notice and this permission notice appear in all copies. +-- +-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + local pipe = {} local base64 = require("base64") diff --git a/bindings/scenarios/scenarios.lua b/bindings/scenarios/scenarios.lua index 5ba28b8b..d935ec8c 100644 --- a/bindings/scenarios/scenarios.lua +++ b/bindings/scenarios/scenarios.lua @@ -1,3 +1,22 @@ +-- Molch, an implementation of the axolotl ratchet based on libsodium +-- +-- ISC License +-- +-- Copyright (C) 2015-2016 1984not Security GmbH +-- Author: Max Bruckner (FSMaxB) +-- +-- Permission to use, copy, modify, and/or distribute this software for any +-- purpose with or without fee is hereby granted, provided that the above +-- copyright notice and this permission notice appear in all copies. +-- +-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + package.path = "../?.lua;" .. package.path package.cpath = "../?.so;../?.dylib;" .. package.cpath diff --git a/buffer b/buffer index 47c8abb5..19269fdb 160000 --- a/buffer +++ b/buffer @@ -1 +1 @@ -Subproject commit 47c8abb5d3a4680622aecb22dcf6ac3106b99d3e +Subproject commit 19269fdb5c54117fe9a51398755ead5db9ca935d diff --git a/lib/constants.h b/lib/constants.h index a6f9315d..6057fd6c 100644 --- a/lib/constants.h +++ b/lib/constants.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ //This header defines all the constants that are globally available in the library. diff --git a/lib/conversation-store.c b/lib/conversation-store.c index e3708396..f54c7c3f 100644 --- a/lib/conversation-store.c +++ b/lib/conversation-store.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "conversation-store.h" diff --git a/lib/conversation-store.h b/lib/conversation-store.h index 4e96e118..e0cf228a 100644 --- a/lib/conversation-store.h +++ b/lib/conversation-store.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "conversation.h" diff --git a/lib/conversation.c b/lib/conversation.c index 960cdaab..6ea9ccb3 100644 --- a/lib/conversation.c +++ b/lib/conversation.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "constants.h" diff --git a/lib/conversation.h b/lib/conversation.h index 7d8fa97a..eb2801a4 100644 --- a/lib/conversation.h +++ b/lib/conversation.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "constants.h" diff --git a/lib/diffie-hellman.c b/lib/diffie-hellman.c index 8c895bd2..94253625 100644 --- a/lib/diffie-hellman.c +++ b/lib/diffie-hellman.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #include diff --git a/lib/diffie-hellman.h b/lib/diffie-hellman.h index 27728536..004d6c93 100644 --- a/lib/diffie-hellman.h +++ b/lib/diffie-hellman.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/lib/endianness.c b/lib/endianness.c index d1ac73dc..523cb05f 100644 --- a/lib/endianness.c +++ b/lib/endianness.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* diff --git a/lib/endianness.h b/lib/endianness.h index aa615c74..e194c122 100644 --- a/lib/endianness.h +++ b/lib/endianness.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* diff --git a/lib/header-and-message-keystore.c b/lib/header-and-message-keystore.c index 122eec83..d64b4826 100644 --- a/lib/header-and-message-keystore.c +++ b/lib/header-and-message-keystore.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/lib/header-and-message-keystore.h b/lib/header-and-message-keystore.h index f3ef5001..2e027708 100644 --- a/lib/header-and-message-keystore.h +++ b/lib/header-and-message-keystore.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/lib/header.c b/lib/header.c index d10a7d9d..8ce30dd0 100644 --- a/lib/header.c +++ b/lib/header.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #include diff --git a/lib/header.h b/lib/header.h index 1326bfa3..805dea4b 100644 --- a/lib/header.h +++ b/lib/header.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "../buffer/buffer.h" diff --git a/lib/json.h b/lib/json.h index 323c30c9..287c1a21 100644 --- a/lib/json.h +++ b/lib/json.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef LIB_JSON_H diff --git a/lib/key-derivation.c b/lib/key-derivation.c index 72f9d0cc..a1bccb20 100644 --- a/lib/key-derivation.c +++ b/lib/key-derivation.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #include diff --git a/lib/key-derivation.h b/lib/key-derivation.h index 46a3cea7..e07d91d3 100644 --- a/lib/key-derivation.h +++ b/lib/key-derivation.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/lib/master-keys.c b/lib/master-keys.c index b574d938..a94ad100 100644 --- a/lib/master-keys.c +++ b/lib/master-keys.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/lib/master-keys.h b/lib/master-keys.h index 7d64d7e1..a87b0a89 100644 --- a/lib/master-keys.h +++ b/lib/master-keys.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "constants.h" diff --git a/lib/molch.c b/lib/molch.c index 25357bd9..26adca6d 100644 --- a/lib/molch.c +++ b/lib/molch.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* diff --git a/lib/molch.h b/lib/molch.h index 92107f23..b3b58da3 100644 --- a/lib/molch.h +++ b/lib/molch.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License + * + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "return-status.h" diff --git a/lib/packet.c b/lib/packet.c index a974436b..73dcea5c 100644 --- a/lib/packet.c +++ b/lib/packet.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/lib/packet.h b/lib/packet.h index 56148c58..f139d5ae 100644 --- a/lib/packet.h +++ b/lib/packet.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "../buffer/buffer.h" diff --git a/lib/prekey-store.c b/lib/prekey-store.c index 8396319f..002a7af2 100644 --- a/lib/prekey-store.c +++ b/lib/prekey-store.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/lib/prekey-store.h b/lib/prekey-store.h index f84cb225..7dc7e7d9 100644 --- a/lib/prekey-store.h +++ b/lib/prekey-store.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/lib/ratchet.c b/lib/ratchet.c index c634501e..392d7430 100644 --- a/lib/ratchet.c +++ b/lib/ratchet.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/lib/ratchet.h b/lib/ratchet.h index 0cbb8bc5..e9ecdcab 100644 --- a/lib/ratchet.h +++ b/lib/ratchet.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/lib/return-status.c b/lib/return-status.c index 743fc2e8..7a53a48d 100644 --- a/lib/return-status.c +++ b/lib/return-status.c @@ -1,19 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2016 Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/lib/return-status.h b/lib/return-status.h index 0442bb1c..ab03f32f 100644 --- a/lib/return-status.h +++ b/lib/return-status.h @@ -1,19 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2016 Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef LIB_RETURN_STATUS_H diff --git a/lib/spiced-random.c b/lib/spiced-random.c index 909c32ce..8284e5bb 100644 --- a/lib/spiced-random.c +++ b/lib/spiced-random.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/lib/spiced-random.h b/lib/spiced-random.h index 1de52e9f..3825b752 100644 --- a/lib/spiced-random.h +++ b/lib/spiced-random.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "../buffer/buffer.h" diff --git a/lib/user-store.c b/lib/user-store.c index 0fd508e5..690ef8ac 100644 --- a/lib/user-store.c +++ b/lib/user-store.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/lib/user-store.h b/lib/user-store.h index ad3be3c2..af5b1925 100644 --- a/lib/user-store.h +++ b/lib/user-store.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/mcJSON b/mcJSON index 510302e1..0e224950 160000 --- a/mcJSON +++ b/mcJSON @@ -1 +1 @@ -Subproject commit 510302e14a69ce83287e99760534db2bb1082f2d +Subproject commit 0e224950ecb7889ceabf7fce4c3d991eafbb9fe0 diff --git a/test/chain-key-derivation-test.c b/test/chain-key-derivation-test.c index f9a1ad8d..4f02d8fd 100644 --- a/test/chain-key-derivation-test.c +++ b/test/chain-key-derivation-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/common.c b/test/common.c index 6364e164..fd625d3c 100644 --- a/test/common.c +++ b/test/common.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/common.h b/test/common.h index 370938e3..b4d5ab62 100644 --- a/test/common.h +++ b/test/common.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "../lib/header-and-message-keystore.h" diff --git a/test/conversation-packet-test.c b/test/conversation-packet-test.c index 3149bac1..bbfe5a95 100644 --- a/test/conversation-packet-test.c +++ b/test/conversation-packet-test.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/test/conversation-store-test.c b/test/conversation-store-test.c index 6939b5c4..2f342b89 100644 --- a/test/conversation-store-test.c +++ b/test/conversation-store-test.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/test/conversation-test.c b/test/conversation-test.c index a2c61de0..f9b70766 100644 --- a/test/conversation-test.c +++ b/test/conversation-test.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/test/diffie-hellman-test.c b/test/diffie-hellman-test.c index e55040c8..2127b3bb 100644 --- a/test/diffie-hellman-test.c +++ b/test/diffie-hellman-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/endianness-test.c b/test/endianness-test.c index eaa136cf..7b09bb38 100644 --- a/test/endianness-test.c +++ b/test/endianness-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include diff --git a/test/header-and-message-keystore-test.c b/test/header-and-message-keystore-test.c index 38edcf63..6676ddc4 100644 --- a/test/header-and-message-keystore-test.c +++ b/test/header-and-message-keystore-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/header-test.c b/test/header-test.c index 599444f1..e10d2392 100644 --- a/test/header-test.c +++ b/test/header-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/initial-root-chain-and-header-key-derivation-test.c b/test/initial-root-chain-and-header-key-derivation-test.c index af2e24f6..67d010b7 100644 --- a/test/initial-root-chain-and-header-key-derivation-test.c +++ b/test/initial-root-chain-and-header-key-derivation-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/key-derivation-test.c b/test/key-derivation-test.c index dde4af87..380afd4e 100644 --- a/test/key-derivation-test.c +++ b/test/key-derivation-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/master-keys-test.c b/test/master-keys-test.c index b052364b..549ad52b 100644 --- a/test/master-keys-test.c +++ b/test/master-keys-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/message-key-derivation-test.c b/test/message-key-derivation-test.c index 383ea260..85a3a190 100644 --- a/test/message-key-derivation-test.c +++ b/test/message-key-derivation-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/molch-init-test.c b/test/molch-init-test.c index a3e26792..f49f081e 100644 --- a/test/molch-init-test.c +++ b/test/molch-init-test.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/test/molch-test.c b/test/molch-test.c index 3fa77a9d..f615224b 100644 --- a/test/molch-test.c +++ b/test/molch-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/packet-decrypt-header-test.c b/test/packet-decrypt-header-test.c index a7b818f6..6396f2fd 100644 --- a/test/packet-decrypt-header-test.c +++ b/test/packet-decrypt-header-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/packet-decrypt-message-test.c b/test/packet-decrypt-message-test.c index aabe5ee1..baa72368 100644 --- a/test/packet-decrypt-message-test.c +++ b/test/packet-decrypt-message-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/packet-decrypt-test.c b/test/packet-decrypt-test.c index 94ff0a14..e80eaa17 100644 --- a/test/packet-decrypt-test.c +++ b/test/packet-decrypt-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/packet-get-metadata-test.c b/test/packet-get-metadata-test.c index 6aaeb1c1..11705a05 100644 --- a/test/packet-get-metadata-test.c +++ b/test/packet-get-metadata-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/packet-test-lib.c b/test/packet-test-lib.c index e002782d..884678f1 100644 --- a/test/packet-test-lib.c +++ b/test/packet-test-lib.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/packet-test-lib.h b/test/packet-test-lib.h index d3d3d0fc..348aa151 100644 --- a/test/packet-test-lib.h +++ b/test/packet-test-lib.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium + * + * ISC License * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "../lib/packet.h" diff --git a/test/prekey-store-test.c b/test/prekey-store-test.c index 6c76c5e9..c5481da1 100644 --- a/test/prekey-store-test.c +++ b/test/prekey-store-test.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/test/ratchet-test-simple.c b/test/ratchet-test-simple.c index 180f8231..2bf0c1d4 100644 --- a/test/ratchet-test-simple.c +++ b/test/ratchet-test-simple.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/test/ratchet-test.c b/test/ratchet-test.c index 938f0479..ed117f57 100644 --- a/test/ratchet-test.c +++ b/test/ratchet-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/return-status-test.c b/test/return-status-test.c index c15bc6aa..9923f51a 100644 --- a/test/return-status-test.c +++ b/test/return-status-test.c @@ -1,19 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2016 Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/test/root-next-header-and-chain-key-derivation-test.c b/test/root-next-header-and-chain-key-derivation-test.c index f05390ec..cc55fccf 100644 --- a/test/root-next-header-and-chain-key-derivation-test.c +++ b/test/root-next-header-and-chain-key-derivation-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/spiced-random-test.c b/test/spiced-random-test.c index 00d3ed2d..511af09d 100644 --- a/test/spiced-random-test.c +++ b/test/spiced-random-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/tracing.c b/test/tracing.c index 2ae03798..d102dd0f 100644 --- a/test/tracing.c +++ b/test/tracing.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * * This file incorporates work by Balau, see https://balau82.wordpress.com/2010/10/06/trace-and-profile-function-calls-with-gcc/ diff --git a/test/tracing.h b/test/tracing.h index d7e1d9b3..58010da4 100644 --- a/test/tracing.h +++ b/test/tracing.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * * This file incorporates work by Balau, see https://balau82.wordpress.com/2010/10/06/trace-and-profile-function-calls-with-gcc/ diff --git a/test/triple-diffie-hellman-test.c b/test/triple-diffie-hellman-test.c index 3d7009f3..2b69bfa5 100644 --- a/test/triple-diffie-hellman-test.c +++ b/test/triple-diffie-hellman-test.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/user-store-test.c b/test/user-store-test.c index 8cef3205..1a03889f 100644 --- a/test/user-store-test.c +++ b/test/user-store-test.c @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include diff --git a/test/utils.c b/test/utils.c index 038b3d6a..a00a32c8 100644 --- a/test/utils.c +++ b/test/utils.c @@ -1,21 +1,24 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include diff --git a/test/utils.h b/test/utils.h index 7648a54f..a6ff0b0d 100644 --- a/test/utils.h +++ b/test/utils.h @@ -1,20 +1,22 @@ -/* Molch, an implementation of the axolotl ratchet based on libsodium - * Copyright (C) 2015-2016 1984not Security GmbH - * Author: Max Bruckner (FSMaxB) +/* + * Molch, an implementation of the axolotl ratchet based on libsodium * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * ISC License * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (C) 2015-2016 1984not Security GmbH + * Author: Max Bruckner (FSMaxB) * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "../buffer/buffer.h" From 1e0b6cdabff841d32fb8ddcf22da484970b73252 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Mon, 4 Jul 2016 00:08:31 +0200 Subject: [PATCH 53/53] fix format of license in README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9b3e059a..7850b3da 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ This library is licensed under the ISC license. > ISC License > > Copyright (C) 2015-2016 1984not Security GmbH +> > Author: Max Bruckner (FSMaxB) > > Permission to use, copy, modify, and/or distribute this software for any