diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2017-04-22 23:37:33 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2017-04-23 00:19:38 +0300 |
commit | 5048672e81f3ee9aa864ef9d736a3d74da051754 (patch) | |
tree | 8148405d428027ceab0528cf186a9faf3817b196 /libs/libaxolotl/src/ratchet.c | |
parent | df4c8656be0e85a69a238f3fc3f4d53568c53828 (diff) |
libs: libsignal-c: sync with upstream
Diffstat (limited to 'libs/libaxolotl/src/ratchet.c')
-rwxr-xr-x | libs/libaxolotl/src/ratchet.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libs/libaxolotl/src/ratchet.c b/libs/libaxolotl/src/ratchet.c index bf65ee3e8b..83ab5a1eac 100755 --- a/libs/libaxolotl/src/ratchet.c +++ b/libs/libaxolotl/src/ratchet.c @@ -1086,16 +1086,18 @@ int ratcheting_session_alice_initialize( goto complete; } -complete: - if(result >= 0) { - session_state_set_session_version(state, CIPHERTEXT_CURRENT_VERSION); - session_state_set_remote_identity_key(state, parameters->their_identity_key); - session_state_set_local_identity_key(state, parameters->our_identity_key->public_key); - session_state_add_receiver_chain(state, parameters->their_ratchet_key, derived_chain); - session_state_set_sender_chain(state, sending_ratchet_key, sending_chain_key); - session_state_set_root_key(state, sending_chain_root); + result = session_state_add_receiver_chain(state, parameters->their_ratchet_key, derived_chain); + if(result < 0) { + goto complete; } + session_state_set_session_version(state, CIPHERTEXT_CURRENT_VERSION); + session_state_set_remote_identity_key(state, parameters->their_identity_key); + session_state_set_local_identity_key(state, parameters->our_identity_key->public_key); + session_state_set_sender_chain(state, sending_ratchet_key, sending_chain_key); + session_state_set_root_key(state, sending_chain_root); + +complete: vpool_final(&vp); if(agreement) { free(agreement); |