diff options
author | Mark Haines <mark.haines@matrix.org> | 2015-07-08 16:00:08 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2015-07-08 16:04:18 +0100 |
commit | 0e988237f6fcb826afc42719adc335dcc7ca0e2e (patch) | |
tree | 004312c4b121b2278a5327847db28f0c20639323 /src/account.cpp | |
parent | 532dc0d4e79192a0c7fd1758322f6cae06959859 (diff) |
Don't pass a key id when creating a new outbound session
Diffstat (limited to 'src/account.cpp')
-rw-r--r-- | src/account.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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( |