mirror of
https://git.ugnet.gay/CrossTalk/azul.git
synced 2026-11-25 08:40:05 +00:00
bug fixes and improvements
- aliases are now handled properly in ABCH - removed final escargot leftovers (dev webconsole) - OSCAR etc. logging was not at log level debug - removed leftover debug code
This commit is contained in:
1 parent
4bf878556b
commit
6451bb9426
46 files changed
+307
-541
No files matched your search
+36
-36
@@ -81,39 +81,39 @@ class MSIMCtrl:
|
||||
nc1, nc2 = self.nonce[:32], self.nonce[32:]
|
||||
|
||||
# log what we got
|
||||
self.logger.info('Packet email:', email)
|
||||
self.logger.info('Packet response:', response)
|
||||
self.logger.info('Packet clientver:', clientver)
|
||||
self.logger.debug('Packet email:', email)
|
||||
self.logger.debug('Packet response:', response)
|
||||
self.logger.debug('Packet clientver:', clientver)
|
||||
|
||||
if (uuid := self.backend.util_get_uuid_from_email(email)) is None:
|
||||
self.logger.info('E-mail not found!')
|
||||
self.logger.debug('E-mail not found!')
|
||||
else:
|
||||
# get our hashed password
|
||||
hashed_pwd = self.backend.user_service.msim_get_sha1_password(email)
|
||||
|
||||
if hashed_pwd is None:
|
||||
self.logger.info('MySpaceIM frontend-specific password not found!')
|
||||
self.logger.debug('MySpaceIM frontend-specific password not found!')
|
||||
else:
|
||||
final_hash = hashlib.sha1(b''.join([hashed_pwd, nc2])).digest()
|
||||
rc4_key = final_hash[:16] # we only need the first 128 bits of the result
|
||||
|
||||
self.logger.info('Hashed password:', hashed_pwd.hex(' '))
|
||||
self.logger.info('Full hash:', final_hash.hex(' '))
|
||||
self.logger.info('RC4 key:', rc4_key.hex(' '))
|
||||
self.logger.debug('Hashed password:', hashed_pwd.hex(' '))
|
||||
self.logger.debug('Full hash:', final_hash.hex(' '))
|
||||
self.logger.debug('RC4 key:', rc4_key.hex(' '))
|
||||
|
||||
arc4 = ARC4(rc4_key)
|
||||
blob = arc4.decrypt(response)
|
||||
|
||||
self.logger.info('RC4 blob data:', blob)
|
||||
self.logger.debug('RC4 blob data:', blob)
|
||||
|
||||
seperator = blob.find(bytes(4))
|
||||
if seperator != -1:
|
||||
blob_nc1 = blob[:32]
|
||||
blob_email = blob[32:seperator]
|
||||
|
||||
self.logger.info('nc1 (context):', nc1)
|
||||
self.logger.info('nc1 (request):', blob_nc1)
|
||||
self.logger.info('E-mail (blob):', blob_email)
|
||||
self.logger.debug('nc1 (context):', nc1)
|
||||
self.logger.debug('nc1 (request):', blob_nc1)
|
||||
self.logger.debug('E-mail (blob):', blob_email)
|
||||
|
||||
if nc1 == blob_nc1 and email == blob_email.decode():
|
||||
valid = True
|
||||
@@ -127,7 +127,7 @@ class MSIMCtrl:
|
||||
self.bs = self.backend.login(uuid, self.client, BackendEventHandler(self), option=LoginOption.BootOthers)
|
||||
|
||||
# log that they successfully signed in and send reply giving sesskey / user id / username / etc
|
||||
self.logger.info(email, "successfully signed-in!")
|
||||
self.logger.debug(email, "successfully signed-in!")
|
||||
self.send_reply({
|
||||
'lc': 2,
|
||||
'sesskey': self.sesskey,
|
||||
@@ -167,13 +167,13 @@ class MSIMCtrl:
|
||||
|
||||
def get_user_by_id(id: int) -> Optional[User]:
|
||||
if (uuid := self.backend.util_get_uuid_from_user_id(id)) is None:
|
||||
self.logger.info('User ID', id, 'not found!')
|
||||
self.logger.debug('User ID', id, 'not found!')
|
||||
self.send_persist_error(cmd, dsn, lid, rid, f'User ID {id} not found')
|
||||
return None
|
||||
|
||||
found_user = self.backend._load_user_record(uuid)
|
||||
if found_user is None:
|
||||
self.logger.info('Unable to find uuid')
|
||||
self.logger.debug('Unable to find uuid')
|
||||
self.send_persist_error(cmd, dsn, lid, rid, 'Unable to find uuid')
|
||||
return None
|
||||
|
||||
@@ -310,7 +310,7 @@ class MSIMCtrl:
|
||||
body_dict = unmarshal_msim_dict(body)
|
||||
target = body_dict['Target']
|
||||
|
||||
self.logger.info('Target:', target)
|
||||
self.logger.debug('Target:', target)
|
||||
|
||||
self.send_persist_reply(cmd, dsn, lid, rid, {
|
||||
'WebTicket': TARGET_HOST
|
||||
@@ -318,7 +318,7 @@ class MSIMCtrl:
|
||||
|
||||
# 514;0;9 (2^512;0;9) - update contact info
|
||||
case (514, 0, 9):
|
||||
self.logger.info('Update contact info')
|
||||
self.logger.debug('Update contact info')
|
||||
|
||||
# 2;1;16 - undocumented
|
||||
#
|
||||
@@ -328,7 +328,7 @@ class MSIMCtrl:
|
||||
self.send_persist_reply(cmd, dsn, lid, rid, '')
|
||||
|
||||
case _:
|
||||
self.logger.info(f'Unknown persist command: {cmd};{dsn};{lid}')
|
||||
self.logger.debug(f'Unknown persist command: {cmd};{dsn};{lid}')
|
||||
|
||||
def on_connect(self) -> None:
|
||||
self.send_reply({
|
||||
@@ -352,7 +352,7 @@ class MSIMCtrl:
|
||||
f = getattr(self, f'_m_{command}')
|
||||
f(m)
|
||||
except AttributeError:
|
||||
self.logger.info('Invalid command:', command)
|
||||
self.logger.debug('Invalid command:', command)
|
||||
|
||||
def send_reply(self, data_pairs: Dict[str, int | str | bytes | bool]) -> None:
|
||||
self.writer.write(data_pairs)
|
||||
@@ -414,11 +414,11 @@ class BackendEventHandler(event.BackendEventHandler):
|
||||
self.ctrl = ctrl
|
||||
|
||||
def on_maintenance_message(self, *args: Any, **kwargs: Any) -> None:
|
||||
self.ctrl.logger.info('on_maintenance message')
|
||||
self.ctrl.logger.debug('on_maintenance message')
|
||||
pass
|
||||
|
||||
def on_maintenance_boot(self) -> None:
|
||||
self.ctrl.logger.info('on_maintenance_boot')
|
||||
self.ctrl.logger.debug('on_maintenance_boot')
|
||||
pass
|
||||
|
||||
def on_presence_notification(
|
||||
@@ -427,69 +427,69 @@ class BackendEventHandler(event.BackendEventHandler):
|
||||
send_status_on_bl: bool = False, sess_id: Optional[int] = None,
|
||||
updated_phone_info: Optional[Dict[str, Any]] = None,
|
||||
) -> None:
|
||||
self.ctrl.logger.info('on_presence_notification')
|
||||
self.ctrl.logger.debug('on_presence_notification')
|
||||
pass
|
||||
|
||||
def on_presence_self_notification(self, old_substatus: Substatus, *, update_status: bool = True,
|
||||
update_info: bool = True) -> None:
|
||||
self.ctrl.logger.info('on_presence_self_notification')
|
||||
self.ctrl.logger.debug('on_presence_self_notification')
|
||||
pass
|
||||
|
||||
def on_chat_invite(
|
||||
self, chat: Chat, inviter: User, *, circle: bool = False, inviter_id: Optional[str] = None,
|
||||
invite_msg: str = '',
|
||||
) -> None:
|
||||
self.ctrl.logger.info('on_chat_invite')
|
||||
self.ctrl.logger.debug('on_chat_invite')
|
||||
pass
|
||||
|
||||
def on_declined_chat_invite(self, chat: Chat, circle: bool = False) -> None:
|
||||
self.ctrl.logger.info('on_declined_chat_invite')
|
||||
self.ctrl.logger.debug('on_declined_chat_invite')
|
||||
pass
|
||||
|
||||
def on_added_me(self, user: User, *, adder_id: Optional[str] = None,
|
||||
message: Optional[TextWithData] = None) -> None:
|
||||
self.ctrl.logger.info('on_added_me')
|
||||
self.ctrl.logger.debug('on_added_me')
|
||||
pass
|
||||
|
||||
def on_removed_me(self, user: User) -> None:
|
||||
self.ctrl.logger.info('on_removed_me')
|
||||
self.ctrl.logger.debug('on_removed_me')
|
||||
pass
|
||||
|
||||
def on_contact_request_denied(self, user_added: User, message: Optional[str], *,
|
||||
contact_id: Optional[str] = None) -> None:
|
||||
self.ctrl.logger.info('on_contact_request_denied')
|
||||
self.ctrl.logger.debug('on_contact_request_denied')
|
||||
pass
|
||||
|
||||
def on_oim_sent(self, oim: OIM) -> None:
|
||||
self.ctrl.logger.info('on_oim_sent')
|
||||
self.ctrl.logger.debug('on_oim_sent')
|
||||
pass
|
||||
|
||||
def on_login_elsewhere(self, option: LoginOption) -> None:
|
||||
self.ctrl.logger.info('on_login_elsewhere')
|
||||
self.ctrl.logger.debug('on_login_elsewhere')
|
||||
pass
|
||||
|
||||
def on_circle_invite_revoked(self, chat_id: str) -> None:
|
||||
self.ctrl.logger.info('on_circle_invite_revoked')
|
||||
self.ctrl.logger.debug('on_circle_invite_revoked')
|
||||
pass
|
||||
|
||||
def on_accepted_circle_invite(self, circle: Circle) -> None:
|
||||
self.ctrl.logger.info('on_accepted_circle_invite')
|
||||
self.ctrl.logger.debug('on_accepted_circle_invite')
|
||||
pass
|
||||
|
||||
def on_circle_updated(self, circle: Circle) -> None:
|
||||
self.ctrl.logger.info('on_circle_updated')
|
||||
self.ctrl.logger.debug('on_circle_updated')
|
||||
pass
|
||||
|
||||
def on_left_circle(self, circle: Circle) -> None:
|
||||
self.ctrl.logger.info('on_left_circle')
|
||||
self.ctrl.logger.debug('on_left_circle')
|
||||
pass
|
||||
|
||||
def on_circle_role_updated(self, chat_id: str, role: CircleRole) -> None:
|
||||
self.ctrl.logger.info('on_circle_role_updated')
|
||||
self.ctrl.logger.debug('on_circle_role_updated')
|
||||
pass
|
||||
|
||||
def on_circle_created(self, circle: Circle) -> None:
|
||||
self.ctrl.logger.info('on_circle_created')
|
||||
self.ctrl.logger.debug('on_circle_created')
|
||||
pass
|
||||
|
||||
def on_close(self) -> None:
|
||||
|
||||
Reference in new issue
Block a user