match self {
Auth::NoLogin => false,
Auth::Plain { password } => signature == password,
- Auth::Scrypt { phc } => match PasswordHash::new(&phc) {
+ Auth::Scrypt { phc } => match PasswordHash::new(phc) {
Ok(hash) => Scrypt.verify_password(signature.as_bytes(), &hash).is_ok(),
Err(err) => {
error!("Failed to parse {:?} as PHC string format specification: {}", phc, err);
ServerMessage::LoginAuthChallenge { challenge }
}
(&mut ClientState::LoginAuthIssued { username, ref challenge }, ClientMessage::LoginAuthResponse { signature }) => {
- if self.server.verify(username, &challenge, &signature).await {
+ if self.server.verify(username, challenge, &signature).await {
self.client = ClientState::LoggedIn { username, state: LoggedInState::Idle };
ServerMessage::LoginSuccess
} else {
let game = &mut self.dealer.game;
match self.server.take_action(game.id(), game.actions_len(), &action).await? {
ActionStatus::Committed => match game.take_action(action) {
- Ok(()) => return Ok(ActionStatus::Committed),
- Err(err) => return Err(RedisError::from((ErrorKind::ClientError, "Invalid action", err.to_string()))),
+ Ok(()) => Ok(ActionStatus::Committed),
+ Err(err) => Err(RedisError::from((ErrorKind::ClientError, "Invalid action", err.to_string()))),
},
ActionStatus::Interrupted => {
debug!("Action {:?} was interrupted", action);
}
pub fn matches(&self, game: &GameSummary) -> bool {
- self.filter.matches(&game)
+ self.filter.matches(game)
}
}