Skip to content

Commit

Permalink
Remove IRC password functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Askaholic committed Oct 15, 2023
1 parent 455912e commit 80064cc
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions server/lobbyconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,14 +511,16 @@ async def command_auth(self, message):

username = row.login

new_irc_password = hexlify(os.urandom(16)).decode()
# DEPRECATED: IRC passwords are handled outside of the lobby server.
# This message remains here for backwards compatibility, but the data
# sent is meaningless and can be ignored by clients.
await self.send({
"command": "irc_password",
"password": new_irc_password
"password": hexlify(os.urandom(16)).decode()
})

await self.on_player_login(
player_id, username, new_irc_password, unique_id, auth_method
player_id, username, unique_id, auth_method
)

async def command_hello(self, message):
Expand All @@ -543,14 +545,13 @@ async def command_hello(self, message):
)

await self.on_player_login(
player_id, username, password, unique_id, "password"
player_id, username, unique_id, "password"
)

async def on_player_login(
self,
player_id: int,
username: str,
password: str,
unique_id: str,
method: str
):
Expand Down Expand Up @@ -582,7 +583,6 @@ async def on_player_login(
last_login=func.now()
)
)
await self.update_irc_password(conn, username, password)

self.player = Player(
login=username,
Expand Down Expand Up @@ -679,22 +679,6 @@ async def on_player_login(

await self.send_game_list()

async def update_irc_password(self, conn, login, password):
# Since the password is hashed on the client, what we get at this point
# is really md5(md5(sha256(password))). This is entirely insane.
temp = md5(password.encode()).hexdigest()
irc_pass = "md5:" + md5(temp.encode()).hexdigest()

try:
await conn.execute(
"UPDATE anope.anope_db_NickCore "
"SET pass = :passwd WHERE display = :display",
passwd=irc_pass,
display=login
)
except (OperationalError, ProgrammingError):
self._logger.error("Failure updating NickServ password for %s", login)

async def command_restore_game_session(self, message):
assert self.player is not None

Expand Down

0 comments on commit 80064cc

Please sign in to comment.