From f93f2dee5b9f0ca3b30b545143194431d9136549 Mon Sep 17 00:00:00 2001 From: boxdot Date: Tue, 25 Jun 2024 20:20:30 +0200 Subject: [PATCH] upgrade libsignal to v0.51.0 (#253) --- presage-store-sled/src/protocol.rs | 9 +++++++-- presage/Cargo.toml | 4 ++-- presage/src/manager/registered.rs | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/presage-store-sled/src/protocol.rs b/presage-store-sled/src/protocol.rs index 61530feca..378ed242a 100644 --- a/presage-store-sled/src/protocol.rs +++ b/presage-store-sled/src/protocol.rs @@ -655,7 +655,7 @@ mod tests { use presage::{ libsignal_service::protocol::{ self, Direction, GenericSignedPreKey, IdentityKeyStore, PreKeyRecord, PreKeyStore, - SessionRecord, SessionStore, SignedPreKeyRecord, SignedPreKeyStore, + SessionRecord, SessionStore, SignedPreKeyRecord, SignedPreKeyStore, Timestamp, }, store::Store, }; @@ -746,7 +746,12 @@ mod tests { ) -> bool { let mut db = SledStore::temporary().unwrap().aci_protocol_store(); let id = id.into(); - let signed_pre_key_record = SignedPreKeyRecord::new(id, timestamp, &key_pair.0, &signature); + let signed_pre_key_record = SignedPreKeyRecord::new( + id, + Timestamp::from_epoch_millis(timestamp), + &key_pair.0, + &signature, + ); db.save_signed_pre_key(id, &signed_pre_key_record) .await .unwrap(); diff --git a/presage/Cargo.toml b/presage/Cargo.toml index e8c90fe22..fc8c3b2c6 100644 --- a/presage/Cargo.toml +++ b/presage/Cargo.toml @@ -7,8 +7,8 @@ edition = "2021" license = "AGPL-3.0-only" [dependencies] -libsignal-service = { git = "https://github.com/whisperfish/libsignal-service-rs", rev = "1e04a655c62271ffdfe70b053a6150e0cc2cb155" } -libsignal-service-hyper = { git = "https://github.com/whisperfish/libsignal-service-rs", rev = "1e04a655c62271ffdfe70b053a6150e0cc2cb155" } +libsignal-service = { git = "https://github.com/whisperfish/libsignal-service-rs", rev = "5a496fd" } +libsignal-service-hyper = { git = "https://github.com/whisperfish/libsignal-service-rs", rev = "5a496fd" } base64 = "0.21" futures = "0.3" diff --git a/presage/src/manager/registered.rs b/presage/src/manager/registered.rs index 4946dc1c3..250fc39f6 100644 --- a/presage/src/manager/registered.rs +++ b/presage/src/manager/registered.rs @@ -392,7 +392,7 @@ impl Manager { .as_secs(); if let Some(expiration) = sender_certificate.and_then(|s| s.expiration().ok()) { - expiration >= seconds_since_epoch - 600 + seconds_since_epoch <= expiration.epoch_millis() / 1000 + 600 } else { true }