Skip to content

Commit

Permalink
Potential fix for kyber errors (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schmiddiii authored Dec 27, 2023
1 parent 6d7003f commit d884ef6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions presage/src/manager/linking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,19 @@ impl<S: Store> Manager<S, Linking> {
&registration_data.service_ids
);

Ok(Manager {
let mut manager = Manager {
rng,
store,
store: store.clone(),
state: Registered::with_data(registration_data),
})
};

// Register pre-keys with the server. If this fails, this can lead to issues receiving, in that case clear the registration and propagate the error.
if let Err(e) = manager.register_pre_keys().await {
store.clear_registration()?;
Err(e)
} else {
Ok(manager)
}
}
Err(e) => {
store.clear_registration()?;
Expand Down

0 comments on commit d884ef6

Please sign in to comment.