mirror of
https://github.com/signalapp/libsignal.git
synced 2026-04-26 01:35:22 +02:00
[#289] introduce wrapper structs for DeviceId, SignedPreKeyId, and PreKeyId
This commit is contained in:
committed by
Jordan Rose
parent
9ad236264d
commit
ec3c2d32bc
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright 2020 Signal Messenger, LLC.
|
||||
// Copyright 2020-2022 Signal Messenger, LLC.
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
//
|
||||
|
||||
@@ -16,8 +16,8 @@ fn test_basic_prekey_v3() -> Result<(), SignalProtocolError> {
|
||||
async {
|
||||
let mut csprng = OsRng;
|
||||
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1);
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1);
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1.into());
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1.into());
|
||||
|
||||
let mut alice_store = support::test_in_memory_protocol_store()?;
|
||||
let mut bob_store = support::test_in_memory_protocol_store()?;
|
||||
@@ -37,9 +37,9 @@ fn test_basic_prekey_v3() -> Result<(), SignalProtocolError> {
|
||||
|
||||
let bob_pre_key_bundle = PreKeyBundle::new(
|
||||
bob_store.get_local_registration_id(None).await?,
|
||||
1, // device id
|
||||
Some((pre_key_id, bob_pre_key_pair.public_key)), // pre key
|
||||
signed_pre_key_id, // signed pre key id
|
||||
1.into(), // device id
|
||||
Some((pre_key_id.into(), bob_pre_key_pair.public_key)), // pre key
|
||||
signed_pre_key_id.into(), // signed pre key id
|
||||
bob_signed_pre_key_pair.public_key,
|
||||
bob_signed_pre_key_signature.to_vec(),
|
||||
*bob_store.get_identity_key_pair(None).await?.identity_key(),
|
||||
@@ -83,16 +83,16 @@ fn test_basic_prekey_v3() -> Result<(), SignalProtocolError> {
|
||||
|
||||
bob_store
|
||||
.save_pre_key(
|
||||
pre_key_id,
|
||||
&PreKeyRecord::new(pre_key_id, &bob_pre_key_pair),
|
||||
pre_key_id.into(),
|
||||
&PreKeyRecord::new(pre_key_id.into(), &bob_pre_key_pair),
|
||||
None,
|
||||
)
|
||||
.await?;
|
||||
bob_store
|
||||
.save_signed_pre_key(
|
||||
signed_pre_key_id,
|
||||
signed_pre_key_id.into(),
|
||||
&SignedPreKeyRecord::new(
|
||||
signed_pre_key_id,
|
||||
signed_pre_key_id.into(),
|
||||
/*timestamp*/ 42,
|
||||
&bob_signed_pre_key_pair,
|
||||
&bob_signed_pre_key_signature,
|
||||
@@ -157,9 +157,9 @@ fn test_basic_prekey_v3() -> Result<(), SignalProtocolError> {
|
||||
|
||||
let bob_pre_key_bundle = PreKeyBundle::new(
|
||||
bob_store.get_local_registration_id(None).await?,
|
||||
1, // device id
|
||||
Some((pre_key_id + 1, bob_pre_key_pair.public_key)), // pre key,
|
||||
signed_pre_key_id + 1,
|
||||
1.into(), // device id
|
||||
Some(((pre_key_id + 1).into(), bob_pre_key_pair.public_key)), // pre key,
|
||||
(signed_pre_key_id + 1).into(),
|
||||
bob_signed_pre_key_pair.public_key,
|
||||
bob_signed_pre_key_signature.to_vec(),
|
||||
*bob_store.get_identity_key_pair(None).await?.identity_key(),
|
||||
@@ -167,16 +167,16 @@ fn test_basic_prekey_v3() -> Result<(), SignalProtocolError> {
|
||||
|
||||
bob_store
|
||||
.save_pre_key(
|
||||
pre_key_id + 1,
|
||||
&PreKeyRecord::new(pre_key_id + 1, &bob_pre_key_pair),
|
||||
(pre_key_id + 1).into(),
|
||||
&PreKeyRecord::new((pre_key_id + 1).into(), &bob_pre_key_pair),
|
||||
None,
|
||||
)
|
||||
.await?;
|
||||
bob_store
|
||||
.save_signed_pre_key(
|
||||
signed_pre_key_id + 1,
|
||||
(signed_pre_key_id + 1).into(),
|
||||
&SignedPreKeyRecord::new(
|
||||
signed_pre_key_id + 1,
|
||||
(signed_pre_key_id + 1).into(),
|
||||
/*timestamp*/ 42,
|
||||
&bob_signed_pre_key_pair,
|
||||
&bob_signed_pre_key_signature,
|
||||
@@ -226,9 +226,9 @@ fn test_basic_prekey_v3() -> Result<(), SignalProtocolError> {
|
||||
// Sign pre-key with wrong key:
|
||||
let bob_pre_key_bundle = PreKeyBundle::new(
|
||||
bob_store.get_local_registration_id(None).await?,
|
||||
1, // device id
|
||||
Some((pre_key_id, bob_pre_key_pair.public_key)), // pre key
|
||||
signed_pre_key_id,
|
||||
1.into(), // device id
|
||||
Some((pre_key_id.into(), bob_pre_key_pair.public_key)), // pre key
|
||||
signed_pre_key_id.into(),
|
||||
bob_signed_pre_key_pair.public_key,
|
||||
bob_signed_pre_key_signature.to_vec(),
|
||||
*alice_store
|
||||
@@ -260,8 +260,8 @@ fn chain_jump_over_limit() -> Result<(), SignalProtocolError> {
|
||||
async {
|
||||
let mut csprng = OsRng;
|
||||
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1);
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1);
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1.into());
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1.into());
|
||||
|
||||
let mut alice_store = support::test_in_memory_protocol_store()?;
|
||||
let mut bob_store = support::test_in_memory_protocol_store()?;
|
||||
@@ -281,9 +281,9 @@ fn chain_jump_over_limit() -> Result<(), SignalProtocolError> {
|
||||
|
||||
let bob_pre_key_bundle = PreKeyBundle::new(
|
||||
bob_store.get_local_registration_id(None).await?,
|
||||
1, // device id
|
||||
Some((pre_key_id, bob_pre_key_pair.public_key)), // pre key
|
||||
signed_pre_key_id, // signed pre key id
|
||||
1.into(), // device id
|
||||
Some((pre_key_id.into(), bob_pre_key_pair.public_key)), // pre key
|
||||
signed_pre_key_id.into(), // signed pre key id
|
||||
bob_signed_pre_key_pair.public_key,
|
||||
bob_signed_pre_key_signature.to_vec(),
|
||||
*bob_store.get_identity_key_pair(None).await?.identity_key(),
|
||||
@@ -301,16 +301,16 @@ fn chain_jump_over_limit() -> Result<(), SignalProtocolError> {
|
||||
|
||||
bob_store
|
||||
.save_pre_key(
|
||||
pre_key_id,
|
||||
&PreKeyRecord::new(pre_key_id, &bob_pre_key_pair),
|
||||
pre_key_id.into(),
|
||||
&PreKeyRecord::new(pre_key_id.into(), &bob_pre_key_pair),
|
||||
None,
|
||||
)
|
||||
.await?;
|
||||
bob_store
|
||||
.save_signed_pre_key(
|
||||
signed_pre_key_id,
|
||||
signed_pre_key_id.into(),
|
||||
&SignedPreKeyRecord::new(
|
||||
signed_pre_key_id,
|
||||
signed_pre_key_id.into(),
|
||||
/*timestamp*/ 42,
|
||||
&bob_signed_pre_key_pair,
|
||||
&bob_signed_pre_key_signature,
|
||||
@@ -348,8 +348,10 @@ fn chain_jump_over_limit_with_self() -> Result<(), SignalProtocolError> {
|
||||
async {
|
||||
let mut csprng = OsRng;
|
||||
|
||||
let a1_address = ProtocolAddress::new("+14151111111".to_owned(), 1);
|
||||
let a2_address = ProtocolAddress::new("+14151111111".to_owned(), 2);
|
||||
let device_id_1: DeviceId = 1.into();
|
||||
let a1_address = ProtocolAddress::new("+14151111111".to_owned(), device_id_1);
|
||||
let device_id_2: DeviceId = 2.into();
|
||||
let a2_address = ProtocolAddress::new("+14151111111".to_owned(), device_id_2);
|
||||
|
||||
let mut a1_store = support::test_in_memory_protocol_store()?;
|
||||
let mut a2_store = a1_store.clone(); // same key!
|
||||
@@ -369,9 +371,9 @@ fn chain_jump_over_limit_with_self() -> Result<(), SignalProtocolError> {
|
||||
|
||||
let a2_pre_key_bundle = PreKeyBundle::new(
|
||||
a2_store.get_local_registration_id(None).await?,
|
||||
1, // device id
|
||||
Some((pre_key_id, a2_pre_key_pair.public_key)), // pre key
|
||||
signed_pre_key_id, // signed pre key id
|
||||
1.into(), // device id
|
||||
Some((pre_key_id.into(), a2_pre_key_pair.public_key)), // pre key
|
||||
signed_pre_key_id.into(), // signed pre key id
|
||||
a2_signed_pre_key_pair.public_key,
|
||||
a2_signed_pre_key_signature.to_vec(),
|
||||
*a2_store.get_identity_key_pair(None).await?.identity_key(),
|
||||
@@ -389,16 +391,16 @@ fn chain_jump_over_limit_with_self() -> Result<(), SignalProtocolError> {
|
||||
|
||||
a2_store
|
||||
.save_pre_key(
|
||||
pre_key_id,
|
||||
&PreKeyRecord::new(pre_key_id, &a2_pre_key_pair),
|
||||
pre_key_id.into(),
|
||||
&PreKeyRecord::new(pre_key_id.into(), &a2_pre_key_pair),
|
||||
None,
|
||||
)
|
||||
.await?;
|
||||
a2_store
|
||||
.save_signed_pre_key(
|
||||
signed_pre_key_id,
|
||||
signed_pre_key_id.into(),
|
||||
&SignedPreKeyRecord::new(
|
||||
signed_pre_key_id,
|
||||
signed_pre_key_id.into(),
|
||||
/*timestamp*/ 42,
|
||||
&a2_signed_pre_key_pair,
|
||||
&a2_signed_pre_key_signature,
|
||||
@@ -441,7 +443,7 @@ fn chain_jump_over_limit_with_self() -> Result<(), SignalProtocolError> {
|
||||
#[test]
|
||||
fn test_bad_signed_pre_key_signature() -> Result<(), SignalProtocolError> {
|
||||
async {
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1);
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1.into());
|
||||
|
||||
let mut alice_store = support::test_in_memory_protocol_store()?;
|
||||
let bob_store = support::test_in_memory_protocol_store()?;
|
||||
@@ -468,9 +470,9 @@ fn test_bad_signed_pre_key_signature() -> Result<(), SignalProtocolError> {
|
||||
|
||||
let bob_pre_key_bundle = PreKeyBundle::new(
|
||||
bob_store.get_local_registration_id(None).await?,
|
||||
1,
|
||||
Some((pre_key_id, bob_pre_key_pair.public_key)),
|
||||
signed_pre_key_id,
|
||||
1.into(),
|
||||
Some((pre_key_id.into(), bob_pre_key_pair.public_key)),
|
||||
signed_pre_key_id.into(),
|
||||
bob_signed_pre_key_pair.public_key,
|
||||
bad_signature,
|
||||
*bob_store.get_identity_key_pair(None).await?.identity_key(),
|
||||
@@ -492,9 +494,9 @@ fn test_bad_signed_pre_key_signature() -> Result<(), SignalProtocolError> {
|
||||
|
||||
let bob_pre_key_bundle = PreKeyBundle::new(
|
||||
bob_store.get_local_registration_id(None).await?,
|
||||
1,
|
||||
Some((pre_key_id, bob_pre_key_pair.public_key)),
|
||||
signed_pre_key_id,
|
||||
1.into(),
|
||||
Some((pre_key_id.into(), bob_pre_key_pair.public_key)),
|
||||
signed_pre_key_id.into(),
|
||||
bob_signed_pre_key_pair.public_key,
|
||||
bob_signed_pre_key_signature,
|
||||
*bob_store.get_identity_key_pair(None).await?.identity_key(),
|
||||
@@ -521,8 +523,8 @@ fn test_bad_signed_pre_key_signature() -> Result<(), SignalProtocolError> {
|
||||
#[test]
|
||||
fn repeat_bundle_message_v3() -> Result<(), SignalProtocolError> {
|
||||
async {
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1);
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1);
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1.into());
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1.into());
|
||||
|
||||
let mut alice_store = support::test_in_memory_protocol_store()?;
|
||||
let mut bob_store = support::test_in_memory_protocol_store()?;
|
||||
@@ -543,9 +545,9 @@ fn repeat_bundle_message_v3() -> Result<(), SignalProtocolError> {
|
||||
|
||||
let bob_pre_key_bundle = PreKeyBundle::new(
|
||||
bob_store.get_local_registration_id(None).await?,
|
||||
1, // device id
|
||||
Some((pre_key_id, bob_pre_key_pair.public_key)), // pre key
|
||||
signed_pre_key_id, // signed pre key id
|
||||
1.into(), // device id
|
||||
Some((pre_key_id.into(), bob_pre_key_pair.public_key)), // pre key
|
||||
signed_pre_key_id.into(), // signed pre key id
|
||||
bob_signed_pre_key_pair.public_key,
|
||||
bob_signed_pre_key_signature.to_vec(),
|
||||
*bob_store.get_identity_key_pair(None).await?.identity_key(),
|
||||
@@ -594,16 +596,16 @@ fn repeat_bundle_message_v3() -> Result<(), SignalProtocolError> {
|
||||
|
||||
bob_store
|
||||
.save_pre_key(
|
||||
pre_key_id,
|
||||
&PreKeyRecord::new(pre_key_id, &bob_pre_key_pair),
|
||||
pre_key_id.into(),
|
||||
&PreKeyRecord::new(pre_key_id.into(), &bob_pre_key_pair),
|
||||
None,
|
||||
)
|
||||
.await?;
|
||||
bob_store
|
||||
.save_signed_pre_key(
|
||||
signed_pre_key_id,
|
||||
signed_pre_key_id.into(),
|
||||
&SignedPreKeyRecord::new(
|
||||
signed_pre_key_id,
|
||||
signed_pre_key_id.into(),
|
||||
/*timestamp*/ 42,
|
||||
&bob_signed_pre_key_pair,
|
||||
&bob_signed_pre_key_signature,
|
||||
@@ -656,8 +658,8 @@ fn bad_message_bundle() -> Result<(), SignalProtocolError> {
|
||||
async {
|
||||
let mut csprng = OsRng;
|
||||
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1);
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1);
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1.into());
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1.into());
|
||||
|
||||
let mut alice_store = support::test_in_memory_protocol_store()?;
|
||||
let mut bob_store = support::test_in_memory_protocol_store()?;
|
||||
@@ -677,9 +679,9 @@ fn bad_message_bundle() -> Result<(), SignalProtocolError> {
|
||||
|
||||
let bob_pre_key_bundle = PreKeyBundle::new(
|
||||
bob_store.get_local_registration_id(None).await?,
|
||||
1, // device id
|
||||
Some((pre_key_id, bob_pre_key_pair.public_key)),
|
||||
signed_pre_key_id, // signed pre key id
|
||||
1.into(), // device id
|
||||
Some((pre_key_id.into(), bob_pre_key_pair.public_key)),
|
||||
signed_pre_key_id.into(), // signed pre key id
|
||||
bob_signed_pre_key_pair.public_key,
|
||||
bob_signed_pre_key_signature.to_vec(),
|
||||
*bob_store.get_identity_key_pair(None).await?.identity_key(),
|
||||
@@ -697,16 +699,16 @@ fn bad_message_bundle() -> Result<(), SignalProtocolError> {
|
||||
|
||||
bob_store
|
||||
.save_pre_key(
|
||||
pre_key_id,
|
||||
&PreKeyRecord::new(pre_key_id, &bob_pre_key_pair),
|
||||
pre_key_id.into(),
|
||||
&PreKeyRecord::new(pre_key_id.into(), &bob_pre_key_pair),
|
||||
None,
|
||||
)
|
||||
.await?;
|
||||
bob_store
|
||||
.save_signed_pre_key(
|
||||
signed_pre_key_id,
|
||||
signed_pre_key_id.into(),
|
||||
&SignedPreKeyRecord::new(
|
||||
signed_pre_key_id,
|
||||
signed_pre_key_id.into(),
|
||||
/*timestamp*/ 42,
|
||||
&bob_signed_pre_key_pair,
|
||||
&bob_signed_pre_key_signature,
|
||||
@@ -730,7 +732,7 @@ fn bad_message_bundle() -> Result<(), SignalProtocolError> {
|
||||
|
||||
let original_message = "L'homme est condamné à être libre";
|
||||
|
||||
assert!(bob_store.get_pre_key(pre_key_id, None).await.is_ok());
|
||||
assert!(bob_store.get_pre_key(pre_key_id.into(), None).await.is_ok());
|
||||
let outgoing_message = encrypt(&mut alice_store, &bob_address, original_message).await?;
|
||||
|
||||
assert_eq!(
|
||||
@@ -750,7 +752,7 @@ fn bad_message_bundle() -> Result<(), SignalProtocolError> {
|
||||
assert!(decrypt(&mut bob_store, &alice_address, &incoming_message)
|
||||
.await
|
||||
.is_err());
|
||||
assert!(bob_store.get_pre_key(pre_key_id, None).await.is_ok());
|
||||
assert!(bob_store.get_pre_key(pre_key_id.into(), None).await.is_ok());
|
||||
|
||||
let incoming_message = CiphertextMessage::PreKeySignalMessage(
|
||||
PreKeySignalMessage::try_from(outgoing_message.as_slice())?,
|
||||
@@ -763,7 +765,10 @@ fn bad_message_bundle() -> Result<(), SignalProtocolError> {
|
||||
original_message
|
||||
);
|
||||
assert!(matches!(
|
||||
bob_store.get_pre_key(pre_key_id, None).await.unwrap_err(),
|
||||
bob_store
|
||||
.get_pre_key(pre_key_id.into(), None)
|
||||
.await
|
||||
.unwrap_err(),
|
||||
SignalProtocolError::InvalidPreKeyId
|
||||
));
|
||||
|
||||
@@ -776,8 +781,8 @@ fn bad_message_bundle() -> Result<(), SignalProtocolError> {
|
||||
#[test]
|
||||
fn optional_one_time_prekey() -> Result<(), SignalProtocolError> {
|
||||
async {
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1);
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1);
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1.into());
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1.into());
|
||||
|
||||
let mut alice_store = support::test_in_memory_protocol_store()?;
|
||||
let mut bob_store = support::test_in_memory_protocol_store()?;
|
||||
@@ -796,9 +801,9 @@ fn optional_one_time_prekey() -> Result<(), SignalProtocolError> {
|
||||
|
||||
let bob_pre_key_bundle = PreKeyBundle::new(
|
||||
bob_store.get_local_registration_id(None).await?,
|
||||
1, // device id
|
||||
None, // no pre key
|
||||
signed_pre_key_id, // signed pre key id
|
||||
1.into(), // device id
|
||||
None, // no pre key
|
||||
signed_pre_key_id.into(), // signed pre key id
|
||||
bob_signed_pre_key_pair.public_key,
|
||||
bob_signed_pre_key_signature.to_vec(),
|
||||
*bob_store.get_identity_key_pair(None).await?.identity_key(),
|
||||
@@ -838,9 +843,9 @@ fn optional_one_time_prekey() -> Result<(), SignalProtocolError> {
|
||||
|
||||
bob_store
|
||||
.save_signed_pre_key(
|
||||
signed_pre_key_id,
|
||||
signed_pre_key_id.into(),
|
||||
&SignedPreKeyRecord::new(
|
||||
signed_pre_key_id,
|
||||
signed_pre_key_id.into(),
|
||||
/*timestamp*/ 42,
|
||||
&bob_signed_pre_key_pair,
|
||||
&bob_signed_pre_key_signature,
|
||||
@@ -874,8 +879,8 @@ fn message_key_limits() -> Result<(), SignalProtocolError> {
|
||||
async {
|
||||
let (alice_session_record, bob_session_record) = initialize_sessions_v3()?;
|
||||
|
||||
let alice_address = ProtocolAddress::new("+14159999999".to_owned(), 1);
|
||||
let bob_address = ProtocolAddress::new("+14158888888".to_owned(), 1);
|
||||
let alice_address = ProtocolAddress::new("+14159999999".to_owned(), 1.into());
|
||||
let bob_address = ProtocolAddress::new("+14158888888".to_owned(), 1.into());
|
||||
|
||||
let mut alice_store = support::test_in_memory_protocol_store()?;
|
||||
let mut bob_store = support::test_in_memory_protocol_store()?;
|
||||
@@ -936,8 +941,8 @@ fn run_session_interaction(
|
||||
async {
|
||||
use rand::seq::SliceRandom;
|
||||
|
||||
let alice_address = ProtocolAddress::new("+14159999999".to_owned(), 1);
|
||||
let bob_address = ProtocolAddress::new("+14158888888".to_owned(), 1);
|
||||
let alice_address = ProtocolAddress::new("+14159999999".to_owned(), 1.into());
|
||||
let bob_address = ProtocolAddress::new("+14158888888".to_owned(), 1.into());
|
||||
|
||||
let mut alice_store = support::test_in_memory_protocol_store()?;
|
||||
let mut bob_store = support::test_in_memory_protocol_store()?;
|
||||
@@ -1141,8 +1146,8 @@ fn basic_simultaneous_initiate() -> Result<(), SignalProtocolError> {
|
||||
async {
|
||||
let mut csprng = OsRng;
|
||||
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1);
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1);
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1.into());
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1.into());
|
||||
|
||||
let mut alice_store = support::test_in_memory_protocol_store()?;
|
||||
let mut bob_store = support::test_in_memory_protocol_store()?;
|
||||
@@ -1281,8 +1286,8 @@ fn simultaneous_initiate_with_lossage() -> Result<(), SignalProtocolError> {
|
||||
async {
|
||||
let mut csprng = OsRng;
|
||||
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1);
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1);
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1.into());
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1.into());
|
||||
|
||||
let mut alice_store = support::test_in_memory_protocol_store()?;
|
||||
let mut bob_store = support::test_in_memory_protocol_store()?;
|
||||
@@ -1403,8 +1408,8 @@ fn simultaneous_initiate_lost_message() -> Result<(), SignalProtocolError> {
|
||||
async {
|
||||
let mut csprng = OsRng;
|
||||
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1);
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1);
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1.into());
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1.into());
|
||||
|
||||
let mut alice_store = support::test_in_memory_protocol_store()?;
|
||||
let mut bob_store = support::test_in_memory_protocol_store()?;
|
||||
@@ -1534,8 +1539,8 @@ fn simultaneous_initiate_repeated_messages() -> Result<(), SignalProtocolError>
|
||||
async {
|
||||
let mut csprng = OsRng;
|
||||
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1);
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1);
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1.into());
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1.into());
|
||||
|
||||
let mut alice_store = support::test_in_memory_protocol_store()?;
|
||||
let mut bob_store = support::test_in_memory_protocol_store()?;
|
||||
@@ -1736,8 +1741,8 @@ fn simultaneous_initiate_lost_message_repeated_messages() -> Result<(), SignalPr
|
||||
async {
|
||||
let mut csprng = OsRng;
|
||||
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1);
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1);
|
||||
let alice_address = ProtocolAddress::new("+14151111111".to_owned(), 1.into());
|
||||
let bob_address = ProtocolAddress::new("+14151111112".to_owned(), 1.into());
|
||||
|
||||
let mut alice_store = support::test_in_memory_protocol_store()?;
|
||||
let mut bob_store = support::test_in_memory_protocol_store()?;
|
||||
|
||||
Reference in New Issue
Block a user