crypto: Remove one-time keys after a inbound session was created successfully.

master
Damir Jelić 2020-04-10 16:18:29 +02:00
parent c282d9fabc
commit 7577ddfc00
1 changed files with 8 additions and 0 deletions

View File

@ -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 {