protocol: Clean up pending Kyber pre-keys from sessions

This commit is contained in:
moiseev-signal
2023-11-17 14:46:03 -08:00
committed by GitHub
parent 55b61dd1dd
commit 0ae3eb3c14
3 changed files with 47 additions and 9 deletions

View File

@@ -127,6 +127,17 @@ fn test_basic_prekey() -> TestResult {
let alice_decrypts = decrypt(alice_store, &bob_address, &bob_outgoing).await?;
{
let record_len = alice_store.session_store.load_session(&bob_address).await
.expect("can load session")
.expect("has session record")
.serialize()
.expect("can serialize session record")
.len();
assert!(1024 > record_len, "Unexpectedly large session record ({record_len} bytes). Did you forget to clean things up?")
}
assert_eq!(
String::from_utf8(alice_decrypts).expect("valid utf8"),
bobs_response
@@ -1662,7 +1673,7 @@ fn test_simultaneous_initiate_lost_message_repeated_messages() -> TestResult {
&alice_store_builder.store,
&alice_address,
&bob_store_builder.store,
&bob_address
&bob_address,
)
.await?
);
@@ -1707,7 +1718,7 @@ fn test_simultaneous_initiate_lost_message_repeated_messages() -> TestResult {
&alice_store_builder.store,
&alice_address,
&bob_store_builder.store,
&bob_address
&bob_address,
)
.await?
);
@@ -1733,7 +1744,7 @@ fn test_simultaneous_initiate_lost_message_repeated_messages() -> TestResult {
&alice_store_builder.store,
&alice_address,
&bob_store_builder.store,
&bob_address
&bob_address,
)
.await?
);
@@ -1778,7 +1789,7 @@ fn test_simultaneous_initiate_lost_message_repeated_messages() -> TestResult {
&alice_store_builder.store,
&alice_address,
&bob_store_builder.store,
&bob_address
&bob_address,
)
.await?
);
@@ -1801,7 +1812,7 @@ fn test_simultaneous_initiate_lost_message_repeated_messages() -> TestResult {
&alice_store_builder.store,
&alice_address,
&bob_store_builder.store,
&bob_address
&bob_address,
)
.await?
);
@@ -1829,7 +1840,7 @@ fn test_simultaneous_initiate_lost_message_repeated_messages() -> TestResult {
&bob_store_builder.store,
&bob_address,
&alice_store_builder.store,
&alice_address
&alice_address,
)
.await?
);
@@ -1852,7 +1863,7 @@ fn test_simultaneous_initiate_lost_message_repeated_messages() -> TestResult {
&bob_store_builder.store,
&bob_address,
&alice_store_builder.store,
&alice_address
&alice_address,
)
.await?
);
@@ -1880,7 +1891,7 @@ fn test_simultaneous_initiate_lost_message_repeated_messages() -> TestResult {
&bob_store_builder.store,
&bob_address,
&alice_store_builder.store,
&alice_address
&alice_address,
)
.await?
);