|
@ -1384,14 +1384,14 @@ class auth_aes128_sha1(auth_base): |
|
|
def server_udp_post_decrypt(self, buf): |
|
|
def server_udp_post_decrypt(self, buf): |
|
|
uid = buf[-8:-4] |
|
|
uid = buf[-8:-4] |
|
|
if uid in self.server_info.users: |
|
|
if uid in self.server_info.users: |
|
|
self.user_key = self.hashfunc(self.server_info.users[uid]).digest() |
|
|
user_key = self.hashfunc(self.server_info.users[uid]).digest() |
|
|
else: |
|
|
else: |
|
|
uid = None |
|
|
uid = None |
|
|
if not self.server_info.users: |
|
|
if not self.server_info.users: |
|
|
self.user_key = self.server_info.key |
|
|
user_key = self.server_info.key |
|
|
else: |
|
|
else: |
|
|
self.user_key = self.server_info.recv_iv |
|
|
user_key = self.server_info.recv_iv |
|
|
if hmac.new(self.user_key, buf[:-4], self.hashfunc).digest()[:4] != buf[-4:]: |
|
|
if hmac.new(user_key, buf[:-4], self.hashfunc).digest()[:4] != buf[-4:]: |
|
|
return (b'', None) |
|
|
return (b'', None) |
|
|
return (buf[:-8], uid) |
|
|
return (buf[:-8], uid) |
|
|
|
|
|
|
|
|