diff options
author | Mark Haines <mark.haines@matrix.org> | 2015-06-12 14:09:41 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2015-06-12 14:09:41 +0100 |
commit | 6ecea67718803e96e00a18f97ae8abc83ecaa1c2 (patch) | |
tree | 41de34500c1dfa104b791606a67b6bcf84a14ed9 /include/axolotl/session.hh | |
parent | 08a7e44a966047a10d7e959d4a8cdeaaf4139ce0 (diff) |
Implement the session key exchange
Diffstat (limited to 'include/axolotl/session.hh')
-rw-r--r-- | include/axolotl/session.hh | 29 |
1 files changed, 17 insertions, 12 deletions
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 ); |