From 6ecea67718803e96e00a18f97ae8abc83ecaa1c2 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Fri, 12 Jun 2015 14:09:41 +0100 Subject: Implement the session key exchange --- include/axolotl/session.hh | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'include/axolotl/session.hh') diff --git a/include/axolotl/session.hh b/include/axolotl/session.hh index c69699d..1c3395a 100644 --- a/include/axolotl/session.hh +++ b/include/axolotl/session.hh @@ -5,14 +5,13 @@ namespace axolotl { +class Account; + struct RemoteKey { std::uint32_t id; Curve25519PublicKey key; }; -struct RemoteKeys { -}; - enum struct MessageType { PRE_KEY_MESSAGE = 0, @@ -21,28 +20,34 @@ enum struct MessageType { struct Session { + + Session(); + + Ratchet ratchet; + ErrorCode last_error; + bool received_message; + RemoteKey alice_identity_key; - RemoteKey alice_base_key; - RemoteKey bob_identity_key; - RemoteKey bob_one_time_key; - Ratchet ratchet; + Curve25519PublicKey alice_base_key; + std::uint32_t bob_one_time_key_id; + - void initialise_outbound_session_random_length(); + std::size_t new_outbound_session_random_length(); - void initialise_outbound_session( + std::size_t new_outbound_session( Account const & local_account, - RemoteKey const & identity_key, + Curve25519PublicKey const & identity_key, RemoteKey const & one_time_key, std::uint8_t const * random, std::size_t random_length ); - void initialise_inbound_session( + std::size_t new_inbound_session( Account & local_account, std::uint8_t const * one_time_key_message, std::size_t message_length ); - void matches_inbound_session( + bool matches_inbound_session( std::uint8_t const * one_time_key_message, std::size_t message_length ); -- cgit v1.2.3