diff options
author | Mark Haines <mark.haines@matrix.org> | 2015-07-07 16:42:03 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2015-07-07 16:42:03 +0100 |
commit | 3a382aec59937b086c37f039f1b011f253e80e97 (patch) | |
tree | 9c544b2fa307b4920e0f945e05cff3251db524e6 /src/session.cpp | |
parent | 2a873fd4e1d53c45898b27e1c953b551b2cf6023 (diff) |
Encode the account keys as a signed JSON object
Diffstat (limited to 'src/session.cpp')
-rw-r--r-- | src/session.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/session.cpp b/src/session.cpp index 08498e4..0457042 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -74,15 +74,16 @@ std::size_t olm::Session::new_outbound_session( olm::curve25519_generate_key(random + 32, ratchet_key); received_message = false; - alice_identity_key.id = local_account.identity_key.id; - alice_identity_key.key = local_account.identity_key.key; + alice_identity_key.id = 0; + alice_identity_key.key = local_account.identity_keys.curve25519_key; alice_base_key = base_key; bob_one_time_key_id = one_time_key.id; std::uint8_t shared_secret[96]; olm::curve25519_shared_secret( - local_account.identity_key.key, one_time_key.key, shared_secret + local_account.identity_keys.curve25519_key, + one_time_key.key, shared_secret ); olm::curve25519_shared_secret( base_key, identity_key, shared_secret + 32 @@ -148,7 +149,7 @@ std::size_t olm::Session::new_inbound_session( olm::Curve25519PublicKey ratchet_key; std::memcpy(ratchet_key.public_key, message_reader.ratchet_key, 32); - olm::LocalKey const * bob_one_time_key = local_account.lookup_key( + olm::OneTimeKey const * bob_one_time_key = local_account.lookup_key( bob_one_time_key_id ); @@ -163,7 +164,8 @@ std::size_t olm::Session::new_inbound_session( bob_one_time_key->key, alice_identity_key.key, shared_secret ); olm::curve25519_shared_secret( - local_account.identity_key.key, alice_base_key, shared_secret + 32 + local_account.identity_keys.curve25519_key, + alice_base_key, shared_secret + 32 ); olm::curve25519_shared_secret( bob_one_time_key->key, alice_base_key, shared_secret + 64 |