diff options
Diffstat (limited to 'libs/libaxolotl/src/group_session_builder.c')
-rw-r--r-- | libs/libaxolotl/src/group_session_builder.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/libs/libaxolotl/src/group_session_builder.c b/libs/libaxolotl/src/group_session_builder.c index 4ac825b142..13db334c8e 100644 --- a/libs/libaxolotl/src/group_session_builder.c +++ b/libs/libaxolotl/src/group_session_builder.c @@ -2,21 +2,21 @@ #include <assert.h> #include <string.h> -#include "axolotl_internal.h" #include "sender_key_record.h" #include "sender_key_state.h" #include "sender_key.h" #include "protocol.h" #include "key_helper.h" +#include "signal_protocol_internal.h" struct group_session_builder { - axolotl_store_context *store; - axolotl_context *global_context; + signal_protocol_store_context *store; + signal_context *global_context; }; int group_session_builder_create(group_session_builder **builder, - axolotl_store_context *store, axolotl_context *global_context) + signal_protocol_store_context *store, signal_context *global_context) { group_session_builder *result = 0; @@ -25,7 +25,7 @@ int group_session_builder_create(group_session_builder **builder, result = malloc(sizeof(group_session_builder)); if(!result) { - return AX_ERR_NOMEM; + return SG_ERR_NOMEM; } memset(result, 0, sizeof(group_session_builder)); @@ -37,7 +37,7 @@ int group_session_builder_create(group_session_builder **builder, } int group_session_builder_process_session(group_session_builder *builder, - const axolotl_sender_key_name *sender_key_name, + const signal_protocol_sender_key_name *sender_key_name, sender_key_distribution_message *distribution_message) { int result = 0; @@ -45,9 +45,9 @@ int group_session_builder_process_session(group_session_builder *builder, assert(builder); assert(builder->store); - axolotl_lock(builder->global_context); + signal_lock(builder->global_context); - result = axolotl_sender_key_load_key(builder->store, &record, sender_key_name); + result = signal_protocol_sender_key_load_key(builder->store, &record, sender_key_name); if(result < 0) { goto complete; } @@ -61,48 +61,48 @@ int group_session_builder_process_session(group_session_builder *builder, goto complete; } - result = axolotl_sender_key_store_key(builder->store, sender_key_name, record); + result = signal_protocol_sender_key_store_key(builder->store, sender_key_name, record); complete: - AXOLOTL_UNREF(record); - axolotl_unlock(builder->global_context); + SIGNAL_UNREF(record); + signal_unlock(builder->global_context); return result; } int group_session_builder_create_session(group_session_builder *builder, sender_key_distribution_message **distribution_message, - const axolotl_sender_key_name *sender_key_name) + const signal_protocol_sender_key_name *sender_key_name) { int result = 0; sender_key_record *record = 0; sender_key_state *state = 0; uint32_t sender_key_id = 0; - axolotl_buffer *sender_key = 0; + signal_buffer *sender_key = 0; ec_key_pair *sender_signing_key = 0; sender_chain_key *chain_key = 0; - axolotl_buffer *seed = 0; + signal_buffer *seed = 0; assert(builder); assert(builder->store); - axolotl_lock(builder->global_context); + signal_lock(builder->global_context); - result = axolotl_sender_key_load_key(builder->store, &record, sender_key_name); + result = signal_protocol_sender_key_load_key(builder->store, &record, sender_key_name); if(result < 0) { goto complete; } if(sender_key_record_is_empty(record)) { - result = axolotl_key_helper_generate_sender_key_id(&sender_key_id, builder->global_context); + result = signal_protocol_key_helper_generate_sender_key_id(&sender_key_id, builder->global_context); if(result < 0) { goto complete; } - result = axolotl_key_helper_generate_sender_key(&sender_key, builder->global_context); + result = signal_protocol_key_helper_generate_sender_key(&sender_key, builder->global_context); if(result < 0) { goto complete; } - result = axolotl_key_helper_generate_sender_signing_key(&sender_signing_key, builder->global_context); + result = signal_protocol_key_helper_generate_sender_signing_key(&sender_signing_key, builder->global_context); if(result < 0) { goto complete; } @@ -112,7 +112,7 @@ int group_session_builder_create_session(group_session_builder *builder, goto complete; } - result = axolotl_sender_key_store_key(builder->store, sender_key_name, record); + result = signal_protocol_sender_key_store_key(builder->store, sender_key_name, record); if(result < 0) { goto complete; } @@ -129,15 +129,15 @@ int group_session_builder_create_session(group_session_builder *builder, result = sender_key_distribution_message_create(distribution_message, sender_key_state_get_key_id(state), sender_chain_key_get_iteration(chain_key), - axolotl_buffer_data(seed), axolotl_buffer_len(seed), + signal_buffer_data(seed), signal_buffer_len(seed), sender_key_state_get_signing_key_public(state), builder->global_context); complete: - axolotl_buffer_free(sender_key); - AXOLOTL_UNREF(sender_signing_key); - AXOLOTL_UNREF(record); - axolotl_unlock(builder->global_context); + signal_buffer_free(sender_key); + SIGNAL_UNREF(sender_signing_key); + SIGNAL_UNREF(record); + signal_unlock(builder->global_context); return result; } |