From 7577ddfc003d56b663115f365e0d862fcd9cf720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Fri, 10 Apr 2020 16:18:29 +0200 Subject: [PATCH] crypto: Remove one-time keys after a inbound session was created successfully. --- src/crypto/olm.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/crypto/olm.rs b/src/crypto/olm.rs index a615fa0b..e4cb1f1e 100644 --- a/src/crypto/olm.rs +++ b/src/crypto/olm.rs @@ -199,6 +199,14 @@ impl Account { .await .create_inbound_session_from(their_identity_key, message)?; + self.inner + .lock() + .await + .remove_one_time_keys(&session) + .expect( + "Session was successfully created but the account doesn't hold a matching one-time key", + ); + let now = Instant::now(); Ok(Session {