mirror of
https://github.com/signalapp/libsignal.git
synced 2026-04-26 01:35:22 +02:00
protocol: Throw SessionNotFound for an expired unacknowledged session
For the most part this should happen transparently without any explicit adoption, like the previous change, but for Java code the NoSessionException is now properly declared on SessionCipher.encrypt. (This was always technically possible, but clients were expected to have previously checked for session validity before using SessionCipher; now that there's an expiration involved, that's not strictly possible.)
This commit is contained in:
@@ -13,6 +13,7 @@ use rand::rngs::OsRng;
|
||||
use rand::{CryptoRng, Rng};
|
||||
|
||||
use std::ops::RangeFrom;
|
||||
use std::time::SystemTime;
|
||||
|
||||
// Deliberately not reusing the constants from `protocol`.
|
||||
pub(crate) const PRE_KYBER_MESSAGE_VERSION: u32 = 3;
|
||||
@@ -37,6 +38,7 @@ pub async fn encrypt(
|
||||
remote_address,
|
||||
&mut store.session_store,
|
||||
&mut store.identity_store,
|
||||
SystemTime::now(),
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user