From 0e988237f6fcb826afc42719adc335dcc7ca0e2e Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Wed, 8 Jul 2015 16:00:08 +0100 Subject: Don't pass a key id when creating a new outbound session --- src/account.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/account.cpp') diff --git a/src/account.cpp b/src/account.cpp index a171f5c..5bbd6a6 100644 --- a/src/account.cpp +++ b/src/account.cpp @@ -29,11 +29,12 @@ olm::OneTimeKey const * olm::Account::lookup_key( } std::size_t olm::Account::remove_key( - std::uint32_t id + olm::Curve25519PublicKey const & public_key ) { OneTimeKey * i; for (i = one_time_keys.begin(); i != one_time_keys.end(); ++i) { - if (i->id == id) { + if (0 == memcmp(i->key.public_key, public_key.public_key, 32)) { + std::uint32_t id = i->id; one_time_keys.erase(i); return id; } @@ -42,7 +43,7 @@ std::size_t olm::Account::remove_key( } std::size_t olm::Account::new_account_random_length() { - return 103 * 32; + return 12 * 32; } std::size_t olm::Account::new_account( -- cgit v1.2.3