From 5291ec78b5e0187aa873f911b9d907aa0139def5 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Wed, 8 Jul 2015 14:53:25 +0100 Subject: Send the public part of the one time key rather than passing an identifier --- src/account.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/account.cpp') diff --git a/src/account.cpp b/src/account.cpp index 54edf6e..297d2f4 100644 --- a/src/account.cpp +++ b/src/account.cpp @@ -18,10 +18,12 @@ olm::OneTimeKey const * olm::Account::lookup_key( - std::uint32_t id + olm::Curve25519PublicKey const & public_key ) { for (olm::OneTimeKey const & key : one_time_keys) { - if (key.id == id) return &key; + if (0 == memcmp(key.key.public_key, public_key.public_key, 32)) { + return &key; + } } return 0; } -- cgit v1.2.3