Skip to content

Commit

Permalink
Correct an encoding error with bcrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
Ragora committed Feb 26, 2017
1 parent 1a80c61 commit efb2f29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def update(self):
connection.send('%s\n' % self.auth_invalid_combination)
else:
player_hash = target_player.hash
if (player_hash == bcrypt.hashpw(password, player_hash) == player_hash):
if (player_hash == bcrypt.hashpw(password.encode("UTF_8"), player_hash.encode("UTF_8")) == player_hash):
connection.id = target_player.id
target_player.connection = connection

Expand Down Expand Up @@ -321,4 +321,4 @@ def on_client_disconnect(self, client):
room = self.world.find_room(id=player.location_id)
room.broadcast(self.game_client_disconnect % player.display_name, player)

self.established_connection_list.remove(client)
self.established_connection_list.remove(client)

0 comments on commit efb2f29

Please sign in to comment.