Compare commits

...

2 Commits

Author SHA1 Message Date
Nicola C bd6032aa24
Merge 14ceab8466 into 9f2fa373ce 2023-10-08 16:52:55 +02:00
Nicola 14ceab8466 Removed error-prone length parameter 2023-10-08 16:52:50 +02:00
2 changed files with 3 additions and 4 deletions

View File

@ -142,7 +142,7 @@ class CryptStateOCB2:
head = bytes((eiv[0], *tag[:3]))
return head + dst
def decrypt(self, source: bytes, len_plain: int | None = None) -> bytes:
def decrypt(self, source: bytes) -> bytes:
"""
Decrypt a message
@ -162,8 +162,7 @@ class CryptStateOCB2:
if len(source) < 4:
raise DecryptFailedException('Source <4 bytes long!')
if not len_plain:
len_plain = len(source) - 4 # The entire packet length, minus the header
len_plain = len(source) - 4 # The entire packet length, minus the header
div = self.decrypt_iv.copy()
ivbyte = source[0]

View File

@ -333,7 +333,7 @@ class Mumble(threading.Thread):
except socket.error:
pass
receive_buffer = self.ocb.decrypt(encrypted_buffer, len(encrypted_buffer))
receive_buffer = self.ocb.decrypt(encrypted_buffer)
while len(receive_buffer) >= 6: # header is present (type + length)
self.Log.debug("read control connection")