Skip to content
2 changes: 1 addition & 1 deletion src/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub async fn do_handshake(
let client_payload = device.core.get_client_payload().encode_to_vec();

let mut handshake_state = HandshakeState::new(
device.core.noise_key,
device.core.noise_key.clone(),
client_payload,
NOISE_START_PATTERN,
&WA_CONN_HEADER,
Expand Down
16 changes: 8 additions & 8 deletions src/pair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ pub use wacore::pair::{DeviceState, PairCryptoError, PairUtils};

pub fn make_qr_data(store: &crate::store::Device, ref_str: String) -> String {
let device_state = DeviceState {
identity_key: store.identity_key,
noise_key: store.noise_key,
identity_key: store.identity_key.clone(),
noise_key: store.noise_key.clone(),
adv_secret_key: store.adv_secret_key,
};
PairUtils::make_qr_data(&device_state, ref_str)
Expand Down Expand Up @@ -49,8 +49,8 @@ pub async fn handle_iq(client: &Arc<Client>, node: &Node) -> bool {

let device_snapshot = client.persistence_manager.get_device_snapshot().await;
let device_state = DeviceState {
identity_key: device_snapshot.identity_key,
noise_key: device_snapshot.noise_key,
identity_key: device_snapshot.identity_key.clone(),
noise_key: device_snapshot.noise_key.clone(),
adv_secret_key: device_snapshot.adv_secret_key,
};

Expand Down Expand Up @@ -182,8 +182,8 @@ async fn handle_pair_success(client: &Arc<Client>, request_node: &Node, success_

let device_snapshot = client.persistence_manager.get_device_snapshot().await;
let device_state = DeviceState {
identity_key: device_snapshot.identity_key,
noise_key: device_snapshot.noise_key,
identity_key: device_snapshot.identity_key.clone(),
noise_key: device_snapshot.noise_key.clone(),
adv_secret_key: device_snapshot.adv_secret_key,
};

Expand Down Expand Up @@ -332,8 +332,8 @@ pub async fn pair_with_qr_code(client: &Arc<Client>, qr_code: &str) -> Result<()

let device_snapshot = client.persistence_manager.get_device_snapshot().await;
let device_state = DeviceState {
identity_key: device_snapshot.identity_key,
noise_key: device_snapshot.noise_key,
identity_key: device_snapshot.identity_key.clone(),
noise_key: device_snapshot.noise_key.clone(),
adv_secret_key: device_snapshot.adv_secret_key,
};

Expand Down
2 changes: 1 addition & 1 deletion src/store/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ macro_rules! impl_store_wrapper {
#[async_trait]
impl IdentityKeyStore for Device {
async fn get_identity_key_pair(&self) -> SignalResult<IdentityKeyPair> {
Ok(self.identity_key.into())
Ok(self.identity_key.clone().into())
}

async fn get_local_registration_id(&self) -> SignalResult<u32> {
Expand Down
2 changes: 1 addition & 1 deletion wacore/libsignal/benches/libsignal_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl IdentityKeyStore for InMemoryIdentityKeyStore {
async fn get_identity_key_pair(
&self,
) -> wacore_libsignal::protocol::error::Result<IdentityKeyPair> {
Ok(self.identity_key_pair)
Ok(self.identity_key_pair.clone())
}

async fn get_local_registration_id(&self) -> wacore_libsignal::protocol::error::Result<u32> {
Expand Down
Loading
Loading